Skip to content
Snippets Groups Projects
Commit e107cc72 authored by Henri-Damien LAURENT's avatar Henri-Damien LAURENT
Browse files

Storm Filesystem : Adding rmdir

parent 58aece26
Branches
1 merge request!53Addingrmdir et delete files at
......@@ -30,6 +30,11 @@ class Storm_FileSystem_Disk extends Storm_FileSystem_Abstract {
}
public function rmdir($path) {
return rmdir($path);
}
public function fileExists($path) {
return file_exists($path);
}
......
......@@ -97,7 +97,6 @@ class Storm_FileSystem_Volatile extends Storm_FileSystem_Abstract {
public function rename(string $from, string $to) : bool {
if (!$this->fileExists($from))
return false;
$this->filePutContents($to, $this->fileGetContents($from))
->rm($from);
......@@ -132,6 +131,12 @@ class Storm_FileSystem_Volatile extends Storm_FileSystem_Abstract {
}
public function rmdir($path) {
$this->asPath($path)->rm();
return $this;
}
public function delete(string $path) : bool {
$this->rm($path);
return !$this->isReadable($path);
......@@ -171,6 +176,11 @@ class Storm_FileSystem_Volatile extends Storm_FileSystem_Abstract {
}
public function isDirectory($path) {
return $this->entryAt($path)->isDirectory();
}
public function directoryNamesAt($path) {
$collection = $this->entryAt($path)->select(
function ($entry) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment