diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-16 00:54:38 +0400 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-16 00:55:14 +0400 |
commit | 13cbd7f578a47f3730c57b379a2ae5e9996ce84c (patch) | |
tree | 580579b3aae2a754cf271ee26ea3b82afba4924e /lib/filestorage | |
parent | 5608aaee8a8bbf913f4abb665f18fbe510da7214 (diff) |
some filesystem fixes
Diffstat (limited to 'lib/filestorage')
-rw-r--r-- | lib/filestorage/local.php | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 3bbdd6b4137..07759b0e88c 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -79,9 +79,8 @@ class OC_Filestorage_Local extends OC_Filestorage{ } } public function unlink($path){ - if($return=unlink($this->datadir.$path)){ - $this->clearFolderSizeCache($path); - } + $return=$this->delTree($path); + $this->clearFolderSizeCache($path); return $return; } public function rename($path1,$path2){ @@ -195,7 +194,8 @@ class OC_Filestorage_Local extends OC_Filestorage{ } } - public function delTree($dir) { + private function delTree($dir) { + error_log('del'.$dir); $dirRelative=$dir; $dir=$this->datadir.$dir; if (!file_exists($dir)) return true; @@ -218,36 +218,6 @@ class OC_Filestorage_Local extends OC_Filestorage{ return $return; } - public function find($path){ - $return=System::find($this->datadir.$path); - foreach($return as &$file){ - $file=str_replace($file,$this->datadir,''); - } - return $return; - } - - public function getTree($dir) { - if(substr($dir,-1,1)=='/'){ - $dir=substr($dir,0,-1); - } - $tree=array(); - $tree[]=$dir; - $dirRelative=$dir; - $dir=$this->datadir.$dir; - if (!file_exists($dir)) return true; - foreach (scandir($dir) as $item) { - if ($item == '.' || $item == '..') continue; - if(is_file($dir.'/'.$item)){ - $tree[]=$dirRelative.'/'.$item; - }elseif(is_dir($dir.'/'.$item)){ - if ($subTree=$this->getTree($dirRelative. "/" . $item)){ - $tree=array_merge($tree,$subTree); - } - } - } - return $tree; - } - public function hash($type,$path,$raw){ return hash_file($type,$this->datadir.$path,$raw); } |