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.
28 lines
622 B
28 lines
622 B
<?php
|
|
namespace base\storage;
|
|
class FileDriver implements StorageInterface{
|
|
|
|
public function read($name){
|
|
return file_get_contents($name);
|
|
}
|
|
|
|
public function write($name, $content, $option=null){
|
|
return file_put_contents($name, $content, LOCK_EX);
|
|
}
|
|
|
|
public function append($name, $content){
|
|
return file_put_contents($name, $content, LOCK_EX|FILE_APPEND);
|
|
}
|
|
|
|
public function delete($name){
|
|
return @unlink($name);
|
|
}
|
|
|
|
public function isExists($name){
|
|
return file_exists($name);
|
|
}
|
|
|
|
public function move($oldName, $newName){
|
|
return rename($oldName, $newName);
|
|
}
|
|
}
|