diff options
author | Felix Moeller <mail@felixmoeller.de> | 2012-10-28 23:58:08 +0100 |
---|---|---|
committer | Felix Moeller <mail@felixmoeller.de> | 2012-10-28 23:58:08 +0100 |
commit | dfc8228fb47220e9fe107368da2ebd5da79e780a (patch) | |
tree | fb9ee5821bb9d1ca1058336d796a5d00de3a9cb5 /lib/filestorage | |
parent | e5a74903e453e0628a1544ddc37ee05454a38462 (diff) | |
download | nextcloud-server-dfc8228fb47220e9fe107368da2ebd5da79e780a.tar.gz nextcloud-server-dfc8228fb47220e9fe107368da2ebd5da79e780a.zip |
NoSpaceAfterComma
Diffstat (limited to 'lib/filestorage')
-rw-r--r-- | lib/filestorage/common.php | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/filestorage/common.php b/lib/filestorage/common.php index f24a5704913..cf09ea71e8c 100644 --- a/lib/filestorage/common.php +++ b/lib/filestorage/common.php @@ -95,16 +95,16 @@ abstract class OC_Filestorage_Common extends OC_Filestorage { } // abstract public function unlink($path); public function rename($path1,$path2) { - if($this->copy($path1,$path2)) { + if($this->copy($path1, $path2)) { return $this->unlink($path1); }else{ return false; } } public function copy($path1,$path2) { - $source=$this->fopen($path1,'r'); - $target=$this->fopen($path2,'w'); - $count=OC_Helper::streamCopy($source,$target); + $source=$this->fopen($path1, 'r'); + $target=$this->fopen($path2, 'w'); + $count=OC_Helper::streamCopy($source, $target); return $count>0; } // abstract public function fopen($path,$mode); @@ -188,25 +188,25 @@ abstract class OC_Filestorage_Common extends OC_Filestorage { if($this->is_dir($path)) { return 'httpd/unix-directory'; } - $source=$this->fopen($path,'r'); + $source=$this->fopen($path, 'r'); if(!$source) { return false; } - $head=fread($source,8192);//8kb should suffice to determine a mimetype - if($pos=strrpos($path,'.')) { - $extension=substr($path,$pos); + $head=fread($source, 8192);//8kb should suffice to determine a mimetype + if($pos=strrpos($path, '.')) { + $extension=substr($path, $pos); }else{ $extension=''; } $tmpFile=OC_Helper::tmpFile($extension); - file_put_contents($tmpFile,$head); + file_put_contents($tmpFile, $head); $mime=OC_Helper::getMimeType($tmpFile); unlink($tmpFile); return $mime; } public function hash($type,$path,$raw = false) { $tmpFile=$this->getLocalFile(); - $hash=hash($type,$tmpFile,$raw); + $hash=hash($type, $tmpFile, $raw); unlink($tmpFile); return $hash; } @@ -218,23 +218,23 @@ abstract class OC_Filestorage_Common extends OC_Filestorage { return $this->toTmpFile($path); } private function toTmpFile($path) {//no longer in the storage api, still usefull here - $source=$this->fopen($path,'r'); + $source=$this->fopen($path, 'r'); if(!$source) { return false; } - if($pos=strrpos($path,'.')) { - $extension=substr($path,$pos); + if($pos=strrpos($path, '.')) { + $extension=substr($path, $pos); }else{ $extension=''; } $tmpFile=OC_Helper::tmpFile($extension); - $target=fopen($tmpFile,'w'); - OC_Helper::streamCopy($source,$target); + $target=fopen($tmpFile, 'w'); + OC_Helper::streamCopy($source, $target); return $tmpFile; } public function getLocalFolder($path) { $baseDir=OC_Helper::tmpFolder(); - $this->addLocalFolder($path,$baseDir); + $this->addLocalFolder($path, $baseDir); return $baseDir; } private function addLocalFolder($path,$target) { @@ -243,10 +243,10 @@ abstract class OC_Filestorage_Common extends OC_Filestorage { if($file!=='.' and $file!=='..') { if($this->is_dir($path.'/'.$file)) { mkdir($target.'/'.$file); - $this->addLocalFolder($path.'/'.$file,$target.'/'.$file); + $this->addLocalFolder($path.'/'.$file, $target.'/'.$file); }else{ $tmp=$this->toTmpFile($path.'/'.$file); - rename($tmp,$target.'/'.$file); + rename($tmp, $target.'/'.$file); } } } |