diff options
Diffstat (limited to 'apps/files_external/lib')
-rwxr-xr-x | apps/files_external/lib/config.php | 2 | ||||
-rw-r--r-- | apps/files_external/lib/ftp.php | 14 | ||||
-rw-r--r-- | apps/files_external/lib/google.php | 4 | ||||
-rw-r--r-- | apps/files_external/lib/smb.php | 10 | ||||
-rw-r--r-- | apps/files_external/lib/streamwrapper.php | 22 | ||||
-rw-r--r-- | apps/files_external/lib/swift.php | 44 | ||||
-rw-r--r-- | apps/files_external/lib/webdav.php | 18 |
7 files changed, 57 insertions, 57 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php index 9dc3cdd7147..57a6438ff10 100755 --- a/apps/files_external/lib/config.php +++ b/apps/files_external/lib/config.php @@ -256,7 +256,7 @@ class OC_Mount_Config { foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) { $content .= "\t\t'".$group."' => array (\n"; foreach ($mounts as $mountPoint => $mount) { - $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n"; + $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).", \n"; } $content .= "\t\t),\n"; diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php index 13d1387f287..2fc2a3a1a37 100644 --- a/apps/files_external/lib/ftp.php +++ b/apps/files_external/lib/ftp.php @@ -43,7 +43,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{ $url.='://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path; return $url; } - public function fopen($path,$mode) { + public function fopen($path, $mode) { switch($mode) { case 'r': case 'rb': @@ -53,7 +53,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{ case 'ab': //these are supported by the wrapper $context = stream_context_create(array('ftp' => array('overwrite' => true))); - return fopen($this->constructUrl($path),$mode, false,$context); + return fopen($this->constructUrl($path), $mode, false, $context); case 'r+': case 'w+': case 'wb+': @@ -63,18 +63,18 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{ case 'c': case 'c+': //emulate these - if(strrpos($path,'.')!==false) { - $ext=substr($path, strrpos($path,'.')); + if(strrpos($path, '.')!==false) { + $ext=substr($path, strrpos($path, '.')); }else{ $ext=''; } $tmpFile=OCP\Files::tmpFile($ext); - OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack'); + OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack'); if($this->file_exists($path)) { - $this->getFile($path,$tmpFile); + $this->getFile($path, $tmpFile); } self::$tempFiles[$tmpFile]=$path; - return fopen('close://'.$tmpFile,$mode); + return fopen('close://'.$tmpFile, $mode); } } diff --git a/apps/files_external/lib/google.php b/apps/files_external/lib/google.php index 32d57ed3cef..e5de81280ac 100644 --- a/apps/files_external/lib/google.php +++ b/apps/files_external/lib/google.php @@ -394,8 +394,8 @@ class OC_Filestorage_Google extends OC_Filestorage_Common { case 'x+': case 'c': case 'c+': - if (strrpos($path,'.') !== false) { - $ext = substr($path, strrpos($path,'.')); + if (strrpos($path, '.') !== false) { + $ext = substr($path, strrpos($path, '.')); } else { $ext = ''; } diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php index eed2582dc99..d7636894347 100644 --- a/apps/files_external/lib/smb.php +++ b/apps/files_external/lib/smb.php @@ -24,14 +24,14 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{ if(!$this->root || $this->root[0]!='/') { $this->root='/'.$this->root; } - if(substr($this->root,-1,1)!='/') { + if(substr($this->root,-1, 1)!='/') { $this->root.='/'; } if(!$this->share || $this->share[0]!='/') { $this->share='/'.$this->share; } - if(substr($this->share,-1,1)=='/') { - $this->share=substr($this->share,0,-1); + if(substr($this->share, -1, 1)=='/') { + $this->share=substr($this->share, 0, -1); } //create the root folder if necesary @@ -42,7 +42,7 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{ public function constructUrl($path) { if(substr($path,-1)=='/') { - $path=substr($path,0,-1); + $path=substr($path, 0, -1); } return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path; } @@ -67,7 +67,7 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{ * @param int $time * @return bool */ - public function hasUpdated($path,$time) { + public function hasUpdated($path, $time) { if(!$path and $this->root=='/') { //mtime doesn't work for shares, but giving the nature of the backend, doing a full update is still just fast enough return true; diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php index 7263ef23253..b66a0f0ee1b 100644 --- a/apps/files_external/lib/streamwrapper.php +++ b/apps/files_external/lib/streamwrapper.php @@ -50,34 +50,34 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{ return $succes; } - public function fopen($path,$mode) { - return fopen($this->constructUrl($path),$mode); + public function fopen($path, $mode) { + return fopen($this->constructUrl($path), $mode); } public function free_space($path) { return 0; } - public function touch($path,$mtime=null) { + public function touch($path, $mtime=null) { if(is_null($mtime)) { - $fh=$this->fopen($path,'a'); - fwrite($fh,''); + $fh=$this->fopen($path, 'a'); + fwrite($fh, ''); fclose($fh); }else{ return false;//not supported } } - public function getFile($path,$target) { - return copy($this->constructUrl($path),$target); + public function getFile($path, $target) { + return copy($this->constructUrl($path), $target); } - public function uploadFile($path,$target) { - return copy($path,$this->constructUrl($target)); + public function uploadFile($path, $target) { + return copy($path, $this->constructUrl($target)); } - public function rename($path1,$path2) { - return rename($this->constructUrl($path1),$this->constructUrl($path2)); + public function rename($path1, $path2) { + return rename($this->constructUrl($path1), $this->constructUrl($path2)); } public function stat($path) { diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php index 632c72c280f..2f0076706e4 100644 --- a/apps/files_external/lib/swift.php +++ b/apps/files_external/lib/swift.php @@ -39,8 +39,8 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ * @return string */ private function getContainerName($path) { - $path=trim(trim($this->root,'/')."/".$path,'/.'); - return str_replace('/','\\',$path); + $path=trim(trim($this->root, '/')."/".$path, '/.'); + return str_replace('/', '\\', $path); } /** @@ -189,7 +189,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ * @param string name * @return bool */ - private function addSubContainer($container,$name) { + private function addSubContainer($container, $name) { if(!$name) { return false; } @@ -201,16 +201,16 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ foreach($containers as &$sub) { $sub=trim($sub); } - if(array_search($name,$containers)!==false) { + if(array_search($name, $containers)!==false) { unlink($tmpFile); return false; }else{ - $fh=fopen($tmpFile,'a'); - fwrite($fh,$name."\n"); + $fh=fopen($tmpFile, 'a'); + fwrite($fh, $name."\n"); } }catch(Exception $e) { $containers=array(); - file_put_contents($tmpFile,$name."\n"); + file_put_contents($tmpFile, $name."\n"); } $obj->load_from_filename($tmpFile); @@ -224,7 +224,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ * @param string name * @return bool */ - private function removeSubContainer($container,$name) { + private function removeSubContainer($container, $name) { if(!$name) { return false; } @@ -239,13 +239,13 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ foreach($containers as &$sub) { $sub=trim($sub); } - $i=array_search($name,$containers); + $i=array_search($name, $containers); if($i===false) { unlink($tmpFile); return false; }else{ unset($containers[$i]); - file_put_contents($tmpFile, implode("\n",$containers)."\n"); + file_put_contents($tmpFile, implode("\n", $containers)."\n"); } $obj->load_from_filename($tmpFile); @@ -337,12 +337,12 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ public function opendir($path) { $container=$this->getContainer($path); $files=$this->getObjects($container); - $i=array_search(self::SUBCONTAINER_FILE,$files); + $i=array_search(self::SUBCONTAINER_FILE, $files); if($i!==false) { unset($files[$i]); } $subContainers=$this->getSubContainers($container); - $files=array_merge($files,$subContainers); + $files=array_merge($files, $subContainers); $id=$this->getContainerName($path); OC_FakeDirStream::$dirs[$id]=$files; return opendir('fakedir://'.$id); @@ -380,7 +380,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ return $obj->read(); } - public function file_put_contents($path,$content) { + public function file_put_contents($path, $content) { $obj=$this->getObject($path); if(is_null($obj)) { $container=$this->getContainer(dirname($path)); @@ -406,7 +406,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ } } - public function fopen($path,$mode) { + public function fopen($path, $mode) { switch($mode) { case 'r': case 'rb': @@ -432,9 +432,9 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ case 'c': case 'c+': $tmpFile=$this->getTmpFile($path); - OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack'); + OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack'); self::$tempFiles[$tmpFile]=$path; - return fopen('close://'.$tmpFile,$mode); + return fopen('close://'.$tmpFile, $mode); } } @@ -449,7 +449,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ return 1024*1024*1024*8; } - public function touch($path,$mtime=null) { + public function touch($path, $mtime=null) { $obj=$this->getObject($path); if(is_null($obj)) { return false; @@ -463,10 +463,10 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ $obj->sync_metadata(); } - public function rename($path1,$path2) { + public function rename($path1, $path2) { $sourceContainer=$this->getContainer(dirname($path1)); $targetContainer=$this->getContainer(dirname($path2)); - $result=$sourceContainer->move_object_to(basename($path1),$targetContainer, basename($path2)); + $result=$sourceContainer->move_object_to(basename($path1), $targetContainer, basename($path2)); unset($this->objects[$path1]); if($result) { $targetObj=$this->getObject($path2); @@ -475,10 +475,10 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ return $result; } - public function copy($path1,$path2) { + public function copy($path1, $path2) { $sourceContainer=$this->getContainer(dirname($path1)); $targetContainer=$this->getContainer(dirname($path2)); - $result=$sourceContainer->copy_object_to(basename($path1),$targetContainer, basename($path2)); + $result=$sourceContainer->copy_object_to(basename($path1), $targetContainer, basename($path2)); if($result) { $targetObj=$this->getObject($path2); $this->resetMTime($targetObj); @@ -525,7 +525,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{ } } - private function fromTmpFile($tmpFile,$path) { + private function fromTmpFile($tmpFile, $path) { $obj=$this->getObject($path); if(is_null($obj)) { $obj=$this->createObject($path); diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php index e29ec6cb8a2..2503fb80b1b 100644 --- a/apps/files_external/lib/webdav.php +++ b/apps/files_external/lib/webdav.php @@ -126,7 +126,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ return $this->simpleResponse('DELETE', $path, null, 204); } - public function fopen($path,$mode) { + public function fopen($path, $mode) { $path=$this->cleanPath($path); switch($mode) { case 'r': @@ -194,7 +194,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ } } - public function touch($path,$mtime=null) { + public function touch($path, $mtime=null) { if(is_null($mtime)) { $mtime=time(); } @@ -202,12 +202,12 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ $this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime)); } - public function getFile($path,$target) { + public function getFile($path, $target) { $source=$this->fopen($path, 'r'); file_put_contents($target, $source); } - public function uploadFile($path,$target) { + public function uploadFile($path, $target) { $source=fopen($path, 'r'); $curl = curl_init(); @@ -221,7 +221,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ curl_close ($curl); } - public function rename($path1,$path2) { + public function rename($path1, $path2) { $path1=$this->cleanPath($path1); $path2=$this->root.$this->cleanPath($path2); try{ @@ -235,7 +235,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ } } - public function copy($path1,$path2) { + public function copy($path1, $path2) { $path1=$this->cleanPath($path1); $path2=$this->root.$this->cleanPath($path2); try{ @@ -252,7 +252,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ public function stat($path) { $path=$this->cleanPath($path); try{ - $response=$this->client->propfind($path, array('{DAV:}getlastmodified','{DAV:}getcontentlength')); + $response=$this->client->propfind($path, array('{DAV:}getlastmodified', '{DAV:}getcontentlength')); return array( 'mtime'=>strtotime($response['{DAV:}getlastmodified']), 'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0, @@ -266,7 +266,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ public function getMimeType($path) { $path=$this->cleanPath($path); try{ - $response=$this->client->propfind($path, array('{DAV:}getcontenttype','{DAV:}resourcetype')); + $response=$this->client->propfind($path, array('{DAV:}getcontenttype', '{DAV:}resourcetype')); $responseType=$response["{DAV:}resourcetype"]->resourceType; $type=(count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file'; if($type=='dir') { @@ -289,7 +289,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{ } } - private function simpleResponse($method,$path,$body,$expected) { + private function simpleResponse($method, $path, $body, $expected) { $path=$this->cleanPath($path); try{ $response=$this->client->request($method, $path, $body); |