You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.0 KiB
56 lines
1.0 KiB
|
3 years ago
|
<?php
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 文件存储驱动接口
|
||
|
|
*/
|
||
|
|
|
||
|
|
namespace base\storage;
|
||
|
|
|
||
|
|
Interface StorageInterface {
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 读取文件
|
||
|
|
* @param string $name 文件名
|
||
|
|
* @return string
|
||
|
|
*/
|
||
|
|
public function read($name);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 写入文件
|
||
|
|
* @param string $name 文件名
|
||
|
|
* @param string $content 文件内容
|
||
|
|
* @param array $option 写入参数
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function write($name, $content, $option);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 追加内容
|
||
|
|
* @param string $name 文件名
|
||
|
|
* @param string $content 追加内容
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function append($name, $content);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 删除文件
|
||
|
|
* @param string $name 文件名
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function delete($name);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 判断文件存在
|
||
|
|
* @param string $name 文件名
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function isExists($name);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 移动文件
|
||
|
|
* @param string $oldName 原文件名/路径
|
||
|
|
* @param string $newName 新路径名/目录
|
||
|
|
* @return boolean
|
||
|
|
*/
|
||
|
|
public function move($oldName, $newName);
|
||
|
|
}
|