diff options
Diffstat (limited to 'lib/filesystemview.php')
-rw-r--r-- | lib/filesystemview.php | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php index 872da992fab..936e1feb412 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -142,7 +142,7 @@ class OC_FilesystemView { * @return string */ public function getLocalFile($path) { - $parent=substr($path, 0, strrpos($path,'/')); + $parent=substr($path, 0, strrpos($path, '/')); if(OC_Filesystem::isValidPath($parent) and $storage=$this->getStorage($path)) { return $storage->getLocalFile($this->getInternalPath($path)); } @@ -152,7 +152,7 @@ class OC_FilesystemView { * @return string */ public function getLocalFolder($path) { - $parent=substr($path, 0, strrpos($path,'/')); + $parent=substr($path, 0, strrpos($path, '/')); if(OC_Filesystem::isValidPath($parent) and $storage=$this->getStorage($path)) { return $storage->getLocalFolder($this->getInternalPath($path)); } @@ -215,13 +215,13 @@ class OC_FilesystemView { * @deprecated Replaced by isReadable() as part of CRUDS */ public function is_readable($path) { - return $this->basicOperation('isReadable',$path); + return $this->basicOperation('isReadable', $path); } /** * @deprecated Replaced by isCreatable(), isUpdatable(), isDeletable() as part of CRUDS */ public function is_writable($path) { - return $this->basicOperation('isUpdatable',$path); + return $this->basicOperation('isUpdatable', $path); } public function isCreatable($path) { return $this->basicOperation('isCreatable', $path); @@ -251,7 +251,7 @@ class OC_FilesystemView { return $this->basicOperation('filemtime', $path); } public function touch($path, $mtime=null) { - if(!is_null($mtime) and !is_numeric($mtime)){ + if(!is_null($mtime) and !is_numeric($mtime)) { $mtime = strtotime($mtime); } return $this->basicOperation('touch', $path, array('write'), $mtime); @@ -266,7 +266,7 @@ class OC_FilesystemView { $path = $this->getRelativePath($absolutePath); $exists = $this->file_exists($path); $run = true; - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { if(!$exists) { OC_Hook::emit( OC_Filesystem::CLASSNAME, @@ -294,7 +294,7 @@ class OC_FilesystemView { $count=OC_Helper::streamCopy($data, $target); fclose($target); fclose($data); - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { if(!$exists) { OC_Hook::emit( OC_Filesystem::CLASSNAME, @@ -325,8 +325,8 @@ class OC_FilesystemView { return $this->basicOperation( 'deleteAll', $directory, array('delete'), $empty ); } public function rename($path1, $path2) { - $postFix1=(substr($path1,-1,1)==='/')?'/':''; - $postFix2=(substr($path2,-1,1)==='/')?'/':''; + $postFix1=(substr($path1, -1, 1)==='/')?'/':''; + $postFix2=(substr($path2, -1, 1)==='/')?'/':''; $absolutePath1 = OC_Filesystem::normalizePath($this->getAbsolutePath($path1)); $absolutePath2 = OC_Filesystem::normalizePath($this->getAbsolutePath($path2)); if(OC_FileProxy::runPreProxies('rename', $absolutePath1, $absolutePath2) and OC_Filesystem::isValidPath($path2)) { @@ -337,7 +337,7 @@ class OC_FilesystemView { return false; } $run=true; - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_rename, array( @@ -362,7 +362,7 @@ class OC_FilesystemView { $storage1->unlink($this->getInternalPath($path1.$postFix1)); $result = $count>0; } - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_rename, @@ -377,8 +377,8 @@ class OC_FilesystemView { } } public function copy($path1, $path2) { - $postFix1=(substr($path1,-1,1)==='/')?'/':''; - $postFix2=(substr($path2,-1,1)==='/')?'/':''; + $postFix1=(substr($path1, -1, 1)==='/')?'/':''; + $postFix2=(substr($path2, -1, 1)==='/')?'/':''; $absolutePath1 = OC_Filesystem::normalizePath($this->getAbsolutePath($path1)); $absolutePath2 = OC_Filesystem::normalizePath($this->getAbsolutePath($path2)); if(OC_FileProxy::runPreProxies('copy', $absolutePath1, $absolutePath2) and OC_Filesystem::isValidPath($path2)) { @@ -389,7 +389,7 @@ class OC_FilesystemView { return false; } $run=true; - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_copy, @@ -433,7 +433,7 @@ class OC_FilesystemView { $target = $this->fopen($path2.$postFix2, 'w'); $result = OC_Helper::streamCopy($source, $target); } - if( $this->fakeRoot==OC_Filesystem::getRoot() ){ + if( $this->fakeRoot==OC_Filesystem::getRoot() ) { OC_Hook::emit( OC_Filesystem::CLASSNAME, OC_Filesystem::signal_post_copy, @@ -489,7 +489,7 @@ class OC_FilesystemView { $hooks[]='write'; break; default: - OC_Log::write('core','invalid mode ('.$mode.') for '.$path,OC_Log::ERROR); + OC_Log::write('core', 'invalid mode ('.$mode.') for '.$path, OC_Log::ERROR); } return $this->basicOperation('fopen', $path, $hooks, $mode); @@ -501,7 +501,7 @@ class OC_FilesystemView { $extension=''; $extOffset=strpos($path, '.'); if($extOffset !== false) { - $extension=substr($path, strrpos($path,'.')); + $extension=substr($path, strrpos($path, '.')); } $tmpFile = OC_Helper::tmpFile($extension); file_put_contents($tmpFile, $source); @@ -530,7 +530,7 @@ class OC_FilesystemView { return $this->basicOperation('getMimeType', $path); } public function hash($type, $path, $raw = false) { - $postFix=(substr($path,-1,1)==='/')?'/':''; + $postFix=(substr($path, -1, 1)==='/')?'/':''; $absolutePath = OC_Filesystem::normalizePath($this->getAbsolutePath($path)); if (OC_FileProxy::runPreProxies('hash', $absolutePath) && OC_Filesystem::isValidPath($path)) { $path = $this->getRelativePath($absolutePath); @@ -570,7 +570,7 @@ class OC_FilesystemView { * OC_Filestorage for delegation to a storage backend for execution */ private function basicOperation($operation, $path, $hooks=array(), $extraParam=null) { - $postFix=(substr($path,-1,1)==='/')?'/':''; + $postFix=(substr($path, -1, 1)==='/')?'/':''; $absolutePath = OC_Filesystem::normalizePath($this->getAbsolutePath($path)); if(OC_FileProxy::runPreProxies($operation, $absolutePath, $extraParam) and OC_Filesystem::isValidPath($path)) { $path = $this->getRelativePath($absolutePath); @@ -578,7 +578,7 @@ class OC_FilesystemView { return false; } $internalPath = $this->getInternalPath($path.$postFix); - $run=$this->runHooks($hooks,$path); + $run=$this->runHooks($hooks, $path); if($run and $storage = $this->getStorage($path.$postFix)) { if(!is_null($extraParam)) { $result = $storage->$operation($internalPath, $extraParam); @@ -588,7 +588,7 @@ class OC_FilesystemView { $result = OC_FileProxy::runPostProxies($operation, $this->getAbsolutePath($path), $result); if(OC_Filesystem::$loaded and $this->fakeRoot==OC_Filesystem::getRoot()) { if($operation!='fopen') {//no post hooks for fopen, the file stream is still open - $this->runHooks($hooks,$path, true); + $this->runHooks($hooks, $path, true); } } return $result; @@ -597,7 +597,7 @@ class OC_FilesystemView { return null; } - private function runHooks($hooks,$path,$post=false) { + private function runHooks($hooks, $path, $post=false) { $prefix=($post)?'post_':''; $run=true; if(OC_Filesystem::$loaded and $this->fakeRoot==OC_Filesystem::getRoot()) { |