diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-02-09 17:35:47 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-02-14 08:36:26 +0100 |
commit | cd35d257bb3bef2e02ccf0cd99e59a74f1a753b9 (patch) | |
tree | 65d75158609697518a2023932b75c60c1a99ea42 /lib | |
parent | d3ef967993d1e685e3311b073a8312c9dafdf214 (diff) | |
download | nextcloud-server-cd35d257bb3bef2e02ccf0cd99e59a74f1a753b9.tar.gz nextcloud-server-cd35d257bb3bef2e02ccf0cd99e59a74f1a753b9.zip |
Fix NoSpaceAfterComma and SpaceBeforeComma
Diffstat (limited to 'lib')
-rw-r--r-- | lib/connector/sabre/file.php | 2 | ||||
-rw-r--r-- | lib/connector/sabre/node.php | 4 | ||||
-rw-r--r-- | lib/files/mapper.php | 2 | ||||
-rw-r--r-- | lib/files/storage/common.php | 54 | ||||
-rw-r--r-- | lib/files/storage/local.php | 6 | ||||
-rw-r--r-- | lib/files/storage/mappedlocal.php | 6 | ||||
-rw-r--r-- | lib/ocs.php | 2 | ||||
-rw-r--r-- | lib/ocs/cloud.php | 2 | ||||
-rw-r--r-- | lib/ocs/privatedata.php | 2 | ||||
-rw-r--r-- | lib/public/share.php | 2 | ||||
-rw-r--r-- | lib/user.php | 2 | ||||
-rwxr-xr-x | lib/util.php | 6 |
12 files changed, 45 insertions, 45 deletions
diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php index 61165d9956d..c7375541e86 100644 --- a/lib/connector/sabre/file.php +++ b/lib/connector/sabre/file.php @@ -84,7 +84,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D */ public function get() { - return \OC\Files\Filesystem::fopen($this->path,'rb'); + return \OC\Files\Filesystem::fopen($this->path, 'rb'); } diff --git a/lib/connector/sabre/node.php b/lib/connector/sabre/node.php index 52995630211..57ce3710db8 100644 --- a/lib/connector/sabre/node.php +++ b/lib/connector/sabre/node.php @@ -84,12 +84,12 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr $newPath = $parentPath . '/' . $newName; $oldPath = $this->path; - \OC\Files\Filesystem::rename($this->path,$newPath); + \OC\Files\Filesystem::rename($this->path, $newPath); $this->path = $newPath; $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ? WHERE `userid` = ? AND `propertypath` = ?' ); - $query->execute( array( $newPath,OC_User::getUser(), $oldPath )); + $query->execute( array( $newPath, OC_User::getUser(), $oldPath )); } diff --git a/lib/files/mapper.php b/lib/files/mapper.php index 2d29a8532b6..cd163dcbfcd 100644 --- a/lib/files/mapper.php +++ b/lib/files/mapper.php @@ -107,7 +107,7 @@ class Mapper private function stripLast($path) { if (substr($path, -1) == '/') { - $path = substr_replace($path ,'',-1); + $path = substr_replace($path, '', -1); } return $path; } diff --git a/lib/files/storage/common.php b/lib/files/storage/common.php index bff5c5d57d9..b4c33c69f6b 100644 --- a/lib/files/storage/common.php +++ b/lib/files/storage/common.php @@ -83,21 +83,21 @@ abstract class Common implements \OC\Files\Storage\Storage { } return fread($handle, $size); } - public function file_put_contents($path,$data) { + public function file_put_contents($path, $data) { $handle = $this->fopen($path, "w"); return fwrite($handle, $data); } - public function rename($path1,$path2) { - if($this->copy($path1,$path2)) { + public function rename($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); + public function copy($path1, $path2) { + $source=$this->fopen($path1, 'r'); + $target=$this->fopen($path2, 'w'); + $count=\OC_Helper::streamCopy($source, $target); return $count>0; } @@ -111,7 +111,7 @@ abstract class Common implements \OC\Files\Storage\Storage { * deleted together with its contents. To avoid this set $empty to true */ public function deleteAll( $directory, $empty = false ) { - $directory = trim($directory,'/'); + $directory = trim($directory, '/'); if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) { return false; @@ -146,25 +146,25 @@ abstract class Common implements \OC\Files\Storage\Storage { 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) { + public function hash($type, $path, $raw = false) { $tmpFile=$this->getLocalFile($path); - $hash=hash($type,$tmpFile,$raw); + $hash=hash($type, $tmpFile, $raw); unlink($tmpFile); return $hash; } @@ -175,42 +175,42 @@ abstract class Common implements \OC\Files\Storage\Storage { return $this->toTmpFile($path); } private function toTmpFile($path) {//no longer in the storage api, still useful 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) { + private function addLocalFolder($path, $target) { if($dh=$this->opendir($path)) { while($file=readdir($dh)) { 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); } } } } } - protected function searchInDir($query,$dir='') { + protected function searchInDir($query, $dir='') { $files=array(); $dh=$this->opendir($dir); if($dh) { @@ -220,7 +220,7 @@ abstract class Common implements \OC\Files\Storage\Storage { $files[]=$dir.'/'.$item; } if($this->is_dir($dir.'/'.$item)) { - $files=array_merge($files,$this->searchInDir($query,$dir.'/'.$item)); + $files=array_merge($files, $this->searchInDir($query, $dir.'/'.$item)); } } } @@ -233,7 +233,7 @@ abstract class Common implements \OC\Files\Storage\Storage { * @param int $time * @return bool */ - public function hasUpdated($path,$time) { + public function hasUpdated($path, $time) { return $this->filemtime($path)>$time; } diff --git a/lib/files/storage/local.php b/lib/files/storage/local.php index aaa3c0fab49..4099f860d7b 100644 --- a/lib/files/storage/local.php +++ b/lib/files/storage/local.php @@ -40,7 +40,7 @@ class Local extends \OC\Files\Storage\Common{ return opendir($this->datadir.$path); } public function is_dir($path) { - if(substr($path,-1)=='/') { + if(substr($path, -1)=='/') { $path=substr($path, 0, -1); } return is_dir($this->datadir.$path); @@ -117,11 +117,11 @@ class Local extends \OC\Files\Storage\Common{ } public function rename($path1, $path2) { if (!$this->isUpdatable($path1)) { - \OC_Log::write('core','unable to rename, file is not writable : '.$path1,\OC_Log::ERROR); + \OC_Log::write('core', 'unable to rename, file is not writable : '.$path1, \OC_Log::ERROR); return false; } if(! $this->file_exists($path1)) { - \OC_Log::write('core','unable to rename, file does not exists : '.$path1,\OC_Log::ERROR); + \OC_Log::write('core', 'unable to rename, file does not exists : '.$path1, \OC_Log::ERROR); return false; } diff --git a/lib/files/storage/mappedlocal.php b/lib/files/storage/mappedlocal.php index 218465d8eef..f2af5bfe357 100644 --- a/lib/files/storage/mappedlocal.php +++ b/lib/files/storage/mappedlocal.php @@ -61,7 +61,7 @@ class MappedLocal extends \OC\Files\Storage\Common{ return opendir('fakedir://local-win32'.$path); } public function is_dir($path) { - if(substr($path,-1)=='/') { + if(substr($path, -1)=='/') { $path=substr($path, 0, -1); } return is_dir($this->buildPath($path)); @@ -138,11 +138,11 @@ class MappedLocal extends \OC\Files\Storage\Common{ } public function rename($path1, $path2) { if (!$this->isUpdatable($path1)) { - \OC_Log::write('core','unable to rename, file is not writable : '.$path1,\OC_Log::ERROR); + \OC_Log::write('core', 'unable to rename, file is not writable : '.$path1, \OC_Log::ERROR); return false; } if(! $this->file_exists($path1)) { - \OC_Log::write('core','unable to rename, file does not exists : '.$path1,\OC_Log::ERROR); + \OC_Log::write('core', 'unable to rename, file does not exists : '.$path1, \OC_Log::ERROR); return false; } diff --git a/lib/ocs.php b/lib/ocs.php index 1657f1f9d7b..e08f0846f81 100644 --- a/lib/ocs.php +++ b/lib/ocs.php @@ -89,7 +89,7 @@ class OC_OCS { $format = self::readData($method, 'format', 'text', ''); $txt='Invalid query, please check the syntax. API specifications are here: http://www.freedesktop.org/wiki/Specifications/open-collaboration-services. DEBUG OUTPUT:'."\n"; $txt.=OC_OCS::getDebugOutput(); - echo(OC_OCS::generateXml($format,'failed',999,$txt)); + echo(OC_OCS::generateXml($format, 'failed', 999, $txt)); } diff --git a/lib/ocs/cloud.php b/lib/ocs/cloud.php index 820d24a8e0c..5553ae38215 100644 --- a/lib/ocs/cloud.php +++ b/lib/ocs/cloud.php @@ -31,7 +31,7 @@ class OC_OCS_Cloud { foreach($apps as $app) { $info = OC_App::getAppInfo($app); if(isset($info['standalone'])) { - $newValue = array('name'=>$info['name'],'url'=>OC_Helper::linkToAbsolute($app,''),'icon'=>''); + $newValue = array('name'=>$info['name'], 'url'=>OC_Helper::linkToAbsolute($app, ''), 'icon'=>''); $values[] = $newValue; } } diff --git a/lib/ocs/privatedata.php b/lib/ocs/privatedata.php index 971a5c2ad31..4dfd0a6e66e 100644 --- a/lib/ocs/privatedata.php +++ b/lib/ocs/privatedata.php @@ -29,7 +29,7 @@ class OC_OCS_Privatedata { $user = OC_User::getUser(); $app = addslashes(strip_tags($parameters['app'])); $key = addslashes(strip_tags($parameters['key'])); - $result = OC_OCS::getData($user,$app,$key); + $result = OC_OCS::getData($user, $app, $key); $xml = array(); foreach($result as $i=>$log) { $xml[$i]['key']=$log['key']; diff --git a/lib/public/share.php b/lib/public/share.php index af2a538e252..6dc30f6ae42 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -142,7 +142,7 @@ class Share { * @return Item */ public static function getShareByToken($token) { - $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `token` = ?',1); + $query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `token` = ?', 1); $result = $query->execute(array($token)); if (\OC_DB::isError($result)) { \OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result) . ', token=' . $token, \OC_Log::ERROR); diff --git a/lib/user.php b/lib/user.php index 16680be4aa0..48f4e5c7006 100644 --- a/lib/user.php +++ b/lib/user.php @@ -541,7 +541,7 @@ class OC_User { */ public static function userExists($uid, $excludingBackend=null) { foreach(self::$_usedBackends as $backend) { - if (!is_null($excludingBackend) && !strcmp(get_class($backend),$excludingBackend)) { + if (!is_null($excludingBackend) && !strcmp(get_class($backend), $excludingBackend)) { OC_Log::write('OC_User', $excludingBackend . 'excluded from user existance check.', OC_Log::DEBUG); continue; } diff --git a/lib/util.php b/lib/util.php index 59e67f2a5f1..b9ac8ed75d8 100755 --- a/lib/util.php +++ b/lib/util.php @@ -691,10 +691,10 @@ class OC_Util { curl_setopt($curl, CURLOPT_MAXREDIRS, 10); curl_setopt($curl, CURLOPT_USERAGENT, "ownCloud Server Crawler"); - if(OC_Config::getValue('proxy','')<>'') { + if(OC_Config::getValue('proxy', '')<>'') { curl_setopt($curl, CURLOPT_PROXY, OC_Config::getValue('proxy')); } - if(OC_Config::getValue('proxyuserpwd','')<>'') { + if(OC_Config::getValue('proxyuserpwd', '')<>'') { curl_setopt($curl, CURLOPT_PROXYUSERPWD, OC_Config::getValue('proxyuserpwd')); } $data = curl_exec($curl); @@ -703,7 +703,7 @@ class OC_Util { } else { $contextArray = null; - if(OC_Config::getValue('proxy','')<>'') { + if(OC_Config::getValue('proxy', '')<>'') { $contextArray = array( 'http' => array( 'timeout' => 10, |