]> source.dussan.org Git - nextcloud-server.git/commitdiff
Checkstyle: many fixes
authorFelix Moeller <mail@felixmoeller.de>
Fri, 2 Nov 2012 18:53:02 +0000 (19:53 +0100)
committerFelix Moeller <mail@felixmoeller.de>
Fri, 2 Nov 2012 18:53:02 +0000 (19:53 +0100)
83 files changed:
apps/files/appinfo/filesync.php
apps/files/download.php
apps/files/index.php
apps/files_encryption/lib/crypt.php
apps/files_encryption/lib/cryptstream.php
apps/files_encryption/lib/proxy.php
apps/files_encryption/settings.php
apps/files_encryption/tests/encryption.php
apps/files_encryption/tests/proxy.php
apps/files_encryption/tests/stream.php
apps/files_external/lib/config.php
apps/files_external/lib/ftp.php
apps/files_external/lib/smb.php
apps/files_external/lib/streamwrapper.php
apps/files_external/lib/swift.php
apps/files_external/lib/webdav.php
apps/files_sharing/lib/sharedstorage.php
apps/files_versions/lib/hooks.php
apps/files_versions/lib/versions.php
apps/user_ldap/lib/connection.php
apps/user_webdavauth/user_webdavauth.php
lib/MDB2/Driver/Function/sqlite3.php
lib/MDB2/Driver/sqlite3.php
lib/app.php
lib/appconfig.php
lib/archive.php
lib/archive/tar.php
lib/archive/zip.php
lib/connector/sabre/file.php
lib/connector/sabre/locks.php
lib/connector/sabre/node.php
lib/connector/sabre/principal.php
lib/db.php
lib/eventsource.php
lib/filecache.php
lib/filecache/cached.php
lib/filecache/update.php
lib/fileproxy.php
lib/fileproxy/quota.php
lib/files.php
lib/filestorage.php
lib/filestorage/common.php
lib/filestorage/commontest.php
lib/filestorage/local.php
lib/filesystem.php
lib/filesystemview.php
lib/group.php
lib/group/dummy.php
lib/group/example.php
lib/helper.php
lib/installer.php
lib/json.php
lib/l10n.php
lib/mail.php
lib/migration/content.php
lib/minimizer.php
lib/ocsclient.php
lib/preferences.php
lib/public/db.php
lib/public/util.php
lib/search.php
lib/search/result.php
lib/setup.php
lib/streamwrappers.php
lib/template.php
lib/updater.php
lib/user.php
lib/user/database.php
lib/user/http.php
lib/util.php
lib/vcategories.php
lib/vobject.php
settings/admin.php
settings/ajax/getlog.php
settings/templates/apps.php
tests/lib/archive.php
tests/lib/cache.php
tests/lib/cache/file.php
tests/lib/geo.php
tests/lib/group.php
tests/lib/group/backend.php
tests/lib/streamwrappers.php
tests/lib/user/backend.php

index 47fc6fb4de659bf0b8bb03ab094145e646165ee0..dfafe3f95618e5c50ebefbf5ecfe3f58dfce7dc2 100644 (file)
@@ -36,7 +36,7 @@ if(!OC_User::isLoggedIn()) {
         }
 }
 
-list($type,$file) = explode('/', substr($path_info,1+strlen($service)+1), 2);
+list($type,$file) = explode('/', substr($path_info, 1+strlen($service)+1), 2);
 
 if ($type != 'oc_chunked') {
        OC_Response::setStatus(OC_Response::STATUS_NOT_FOUND);
index ff6aefbbe0fd029ba8143c0ba67dcd36246555d5..0d632c9b2c23a9c02c5cbfdd8b0ace18c2d75fb2 100644 (file)
@@ -32,7 +32,7 @@ $filename = $_GET["file"];
 if(!OC_Filesystem::file_exists($filename)) {
        header("HTTP/1.0 404 Not Found");
        $tmpl = new OCP\Template( '', '404', 'guest' );
-       $tmpl->assign('file',$filename);
+       $tmpl->assign('file', $filename);
        $tmpl->printPage();
        exit;
 }
index 8b8b0fd7610155127eb3279fe196b288f924afea..51fe6b0379c093f73395295fe230e9758863931a 100644 (file)
@@ -86,7 +86,7 @@ $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
 $maxUploadFilesize = min($upload_max_filesize, $post_max_size);
 
 $freeSpace=OC_Filesystem::free_space($dir);
-$freeSpace=max($freeSpace,0);
+$freeSpace=max($freeSpace, 0);
 $maxUploadFilesize = min($maxUploadFilesize, $freeSpace);
 
 $permissions = OCP\Share::PERMISSION_READ;
index 28bf3c5c93ed79860d44e4a1b100194999ad6afa..d8e7e4d1dd92f6a5857739c03cc7d00819083177 100644 (file)
@@ -43,7 +43,7 @@ class OC_Crypt {
                self::init($params['uid'], $params['password']);
        }
 
-       public static function init($login,$password) {
+       public static function init($login, $password) {
                $view=new OC_FilesystemView('/');
                if(!$view->file_exists('/'.$login)) {
                        $view->mkdir('/'.$login);
@@ -195,7 +195,7 @@ class OC_Crypt {
        public static function blockEncrypt($data, $key='') {
                $result='';
                while(strlen($data)) {
-                       $result.=self::encrypt(substr($data, 0, 8192),$key);
+                       $result.=self::encrypt(substr($data, 0, 8192), $key);
                        $data=substr($data, 8192);
                }
                return $result;
@@ -204,10 +204,10 @@ class OC_Crypt {
        /**
         * decrypt data in 8192b sized blocks
         */
-       public static function blockDecrypt($data, $key='',$maxLength=0) {
+       public static function blockDecrypt($data, $key='', $maxLength=0) {
                $result='';
                while(strlen($data)) {
-                       $result.=self::decrypt(substr($data, 0, 8192),$key);
+                       $result.=self::decrypt(substr($data, 0, 8192), $key);
                        $data=substr($data, 8192);
                }
                if($maxLength>0) {
index 0dd2d4b7b1e0ffea8adf248265bc3a5b616c654b..3170cff366c6eb255b1557f0498e1fd4710124b9 100644 (file)
@@ -106,7 +106,7 @@ class OC_CryptStream{
                if($currentPos%8192!=0) {
                        //make sure we always start on a block start
                        fseek($this->source, -($currentPos%8192), SEEK_CUR);
-                       $encryptedBlock=fread($this->source,8192);
+                       $encryptedBlock=fread($this->source, 8192);
                        fseek($this->source, -($currentPos%8192), SEEK_CUR);
                        $block=OC_Crypt::decrypt($encryptedBlock);
                        $data=substr($block, 0, $currentPos%8192).$data;
index 61b87ab5463509159464a2797cb1d5efb73f71e9..fed6acaf91b58097e77c9aa0ce805e27be4b4eb9 100644 (file)
@@ -76,7 +76,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
        public function postFile_get_contents($path,$data) {
                if(self::isEncrypted($path)) {
                        $cached=OC_FileCache_Cached::get($path,'');
-                       $data=OC_Crypt::blockDecrypt($data,'',$cached['size']);
+                       $data=OC_Crypt::blockDecrypt($data, '', $cached['size']);
                }
                return $data;
        }
@@ -88,30 +88,30 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
                $meta=stream_get_meta_data($result);
                if(self::isEncrypted($path)) {
                        fclose($result);
-                       $result=fopen('crypt://'.$path,$meta['mode']);
+                       $result=fopen('crypt://'.$path, $meta['mode']);
                }elseif(self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb') {
                        if(OC_Filesystem::file_exists($path) and OC_Filesystem::filesize($path)>0) {
                                //first encrypt the target file so we don't end up with a half encrypted file
                                OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG);
                                $tmp=fopen('php://temp');
-                               OCP\Files::streamCopy($result,$tmp);
+                               OCP\Files::streamCopy($result, $tmp);
                                fclose($result);
-                               OC_Filesystem::file_put_contents($path,$tmp);
+                               OC_Filesystem::file_put_contents($path, $tmp);
                                fclose($tmp);
                        }
-                       $result=fopen('crypt://'.$path,$meta['mode']);
+                       $result=fopen('crypt://'.$path, $meta['mode']);
                }
                return $result;
        }
 
-       public function postGetMimeType($path,$mime) {
+       public function postGetMimeType($path, $mime) {
                if(self::isEncrypted($path)) {
                        $mime=OCP\Files::getMimeType('crypt://'.$path,'w');
                }
                return $mime;
        }
 
-       public function postStat($path,$data) {
+       public function postStat($path, $data) {
                if(self::isEncrypted($path)) {
                        $cached=OC_FileCache_Cached::get($path,'');
                        $data['size']=$cached['size'];
@@ -119,7 +119,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
                return $data;
        }
 
-       public function postFileSize($path,$size) {
+       public function postFileSize($path, $size) {
                if(self::isEncrypted($path)) {
                        $cached=OC_FileCache_Cached::get($path,'');
                        return  $cached['size'];
index 168124a8d22e3ed829288885f9e304717f3e4349..ab9324dee44dec614dbe843db127b14008d77d75 100644 (file)
@@ -9,8 +9,8 @@
 $tmpl = new OCP\Template( 'files_encryption', 'settings');
 $blackList=explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
 $enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');
-$tmpl->assign('blacklist',$blackList);
-$tmpl->assign('encryption_enabled',$enabled);
+$tmpl->assign('blacklist', $blackList);
+$tmpl->assign('encryption_enabled', $enabled);
 
 OCP\Util::addscript('files_encryption','settings');
 OCP\Util::addscript('core','multiselect');
index a7bc2df0e12c30938bfc2eec2de96ee6e88a9068..b714b00b8f280ac45b595181c469a2a19e44e320 100644 (file)
@@ -11,46 +11,46 @@ class Test_Encryption extends UnitTestCase {
                $key=uniqid();
                $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
                $source=file_get_contents($file); //nice large text file
-               $encrypted=OC_Crypt::encrypt($source,$key);
-               $decrypted=OC_Crypt::decrypt($encrypted,$key);
+               $encrypted=OC_Crypt::encrypt($source, $key);
+               $decrypted=OC_Crypt::decrypt($encrypted, $key);
                $decrypted=rtrim($decrypted, "\0");
-               $this->assertNotEqual($encrypted,$source);
-               $this->assertEqual($decrypted,$source);
+               $this->assertNotEqual($encrypted, $source);
+               $this->assertEqual($decrypted, $source);
 
-               $chunk=substr($source,0,8192);
-               $encrypted=OC_Crypt::encrypt($chunk,$key);
+               $chunk=substr($source,0, 8192);
+               $encrypted=OC_Crypt::encrypt($chunk, $key);
                $this->assertEqual(strlen($chunk), strlen($encrypted));
-               $decrypted=OC_Crypt::decrypt($encrypted,$key);
+               $decrypted=OC_Crypt::decrypt($encrypted, $key);
                $decrypted=rtrim($decrypted, "\0");
-               $this->assertEqual($decrypted,$chunk);
+               $this->assertEqual($decrypted, $chunk);
 
-               $encrypted=OC_Crypt::blockEncrypt($source,$key);
-               $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
-               $this->assertNotEqual($encrypted,$source);
-               $this->assertEqual($decrypted,$source);
+               $encrypted=OC_Crypt::blockEncrypt($source, $key);
+               $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+               $this->assertNotEqual($encrypted, $source);
+               $this->assertEqual($decrypted, $source);
 
                $tmpFileEncrypted=OCP\Files::tmpFile();
-               OC_Crypt::encryptfile($file,$tmpFileEncrypted,$key);
+               OC_Crypt::encryptfile($file,$tmpFileEncrypted, $key);
                $encrypted=file_get_contents($tmpFileEncrypted);
-               $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
-               $this->assertNotEqual($encrypted,$source);
-               $this->assertEqual($decrypted,$source);
+               $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+               $this->assertNotEqual($encrypted, $source);
+               $this->assertEqual($decrypted, $source);
 
                $tmpFileDecrypted=OCP\Files::tmpFile();
-               OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted,$key);
+               OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted, $key);
                $decrypted=file_get_contents($tmpFileDecrypted);
-               $this->assertEqual($decrypted,$source);
+               $this->assertEqual($decrypted, $source);
 
                $file=OC::$SERVERROOT.'/core/img/weather-clear.png';
                $source=file_get_contents($file); //binary file
-               $encrypted=OC_Crypt::encrypt($source,$key);
-               $decrypted=OC_Crypt::decrypt($encrypted,$key);
+               $encrypted=OC_Crypt::encrypt($source, $key);
+               $decrypted=OC_Crypt::decrypt($encrypted, $key);
                $decrypted=rtrim($decrypted, "\0");
-               $this->assertEqual($decrypted,$source);
+               $this->assertEqual($decrypted, $source);
 
-               $encrypted=OC_Crypt::blockEncrypt($source,$key);
-               $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
-               $this->assertEqual($decrypted,$source);
+               $encrypted=OC_Crypt::blockEncrypt($source, $key);
+               $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+               $this->assertEqual($decrypted, $source);
 
        }
 
@@ -59,14 +59,14 @@ class Test_Encryption extends UnitTestCase {
 
                $file=__DIR__.'/binary';
                $source=file_get_contents($file); //binary file
-               $encrypted=OC_Crypt::encrypt($source,$key);
-               $decrypted=OC_Crypt::decrypt($encrypted,$key);
+               $encrypted=OC_Crypt::encrypt($source, $key);
+               $decrypted=OC_Crypt::decrypt($encrypted, $key);
 
                $decrypted=rtrim($decrypted, "\0");
-               $this->assertEqual($decrypted,$source);
+               $this->assertEqual($decrypted, $source);
 
-               $encrypted=OC_Crypt::blockEncrypt($source,$key);
-               $decrypted=OC_Crypt::blockDecrypt($encrypted,$key, strlen($source));
-               $this->assertEqual($decrypted,$source);
+               $encrypted=OC_Crypt::blockEncrypt($source, $key);
+               $decrypted=OC_Crypt::blockDecrypt($encrypted, $key, strlen($source));
+               $this->assertEqual($decrypted, $source);
        }
 }
index c3c8f4a2db0ef754e860d596a1fb028493367dbb..25427ff4b97e104eb30d59588d471deed6b79314 100644 (file)
@@ -41,7 +41,7 @@ class Test_CryptProxy extends UnitTestCase {
        }
 
        public function tearDown() {
-               OCP\Config::setAppValue('files_encryption','enable_encryption',$this->oldConfig);
+               OCP\Config::setAppValue('files_encryption', 'enable_encryption', $this->oldConfig);
                if(!is_null($this->oldKey)) {
                        $_SESSION['enckey']=$this->oldKey;
                }
@@ -51,16 +51,16 @@ class Test_CryptProxy extends UnitTestCase {
                $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
                $original=file_get_contents($file);
 
-               OC_Filesystem::file_put_contents('/file',$original);
+               OC_Filesystem::file_put_contents('/file', $original);
 
                OC_FileProxy::$enabled=false;
                $stored=OC_Filesystem::file_get_contents('/file');
                OC_FileProxy::$enabled=true;
 
                $fromFile=OC_Filesystem::file_get_contents('/file');
-               $this->assertNotEqual($original,$stored);
+               $this->assertNotEqual($original, $stored);
                $this->assertEqual(strlen($original), strlen($fromFile));
-               $this->assertEqual($original,$fromFile);
+               $this->assertEqual($original, $fromFile);
 
        }
 
@@ -72,46 +72,46 @@ class Test_CryptProxy extends UnitTestCase {
                $view=new OC_FilesystemView('/'.OC_User::getUser());
                $userDir='/'.OC_User::getUser().'/files';
 
-               $rootView->file_put_contents($userDir.'/file',$original);
+               $rootView->file_put_contents($userDir.'/file', $original);
 
                OC_FileProxy::$enabled=false;
                $stored=$rootView->file_get_contents($userDir.'/file');
                OC_FileProxy::$enabled=true;
 
-               $this->assertNotEqual($original,$stored);
+               $this->assertNotEqual($original, $stored);
                $fromFile=$rootView->file_get_contents($userDir.'/file');
-               $this->assertEqual($original,$fromFile);
+               $this->assertEqual($original, $fromFile);
 
                $fromFile=$view->file_get_contents('files/file');
-               $this->assertEqual($original,$fromFile);
+               $this->assertEqual($original, $fromFile);
        }
 
        public function testBinary() {
                $file=__DIR__.'/binary';
                $original=file_get_contents($file);
 
-               OC_Filesystem::file_put_contents('/file',$original);
+               OC_Filesystem::file_put_contents('/file', $original);
 
                OC_FileProxy::$enabled=false;
                $stored=OC_Filesystem::file_get_contents('/file');
                OC_FileProxy::$enabled=true;
 
                $fromFile=OC_Filesystem::file_get_contents('/file');
-               $this->assertNotEqual($original,$stored);
+               $this->assertNotEqual($original, $stored);
                $this->assertEqual(strlen($original), strlen($fromFile));
-               $this->assertEqual($original,$fromFile);
+               $this->assertEqual($original, $fromFile);
 
                $file=__DIR__.'/zeros';
                $original=file_get_contents($file);
 
-               OC_Filesystem::file_put_contents('/file',$original);
+               OC_Filesystem::file_put_contents('/file', $original);
 
                OC_FileProxy::$enabled=false;
                $stored=OC_Filesystem::file_get_contents('/file');
                OC_FileProxy::$enabled=true;
 
                $fromFile=OC_Filesystem::file_get_contents('/file');
-               $this->assertNotEqual($original,$stored);
+               $this->assertNotEqual($original, $stored);
                $this->assertEqual(strlen($original), strlen($fromFile));
        }
 }
index 5ea0da480171651a076ad13ef3c9dbb0f9bb5609..2caebf912ed64c9b9db21203b8001f30456395c1 100644 (file)
@@ -15,14 +15,14 @@ class Test_CryptStream extends UnitTestCase {
                fclose($stream);
 
                $stream=$this->getStream('test1','r', strlen('foobar'));
-               $data=fread($stream,6);
+               $data=fread($stream, 6);
                fclose($stream);
-               $this->assertEqual('foobar',$data);
+               $this->assertEqual('foobar', $data);
 
                $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
                $source=fopen($file,'r');
-               $target=$this->getStream('test2','w',0);
-               OCP\Files::streamCopy($source,$target);
+               $target=$this->getStream('test2', 'w', 0);
+               OCP\Files::streamCopy($source, $target);
                fclose($target);
                fclose($source);
 
@@ -30,7 +30,7 @@ class Test_CryptStream extends UnitTestCase {
                $data=stream_get_contents($stream);
                $original=file_get_contents($file);
                $this->assertEqual(strlen($original), strlen($data));
-               $this->assertEqual($original,$data);
+               $this->assertEqual($original, $data);
        }
 
        /**
@@ -40,7 +40,7 @@ class Test_CryptStream extends UnitTestCase {
         * @param int size
         * @return resource
         */
-       function getStream($id,$mode,$size) {
+       function getStream($id, $mode, $size) {
                if($id==='') {
                        $id=uniqid();
                }
@@ -50,9 +50,9 @@ class Test_CryptStream extends UnitTestCase {
                }else{
                        $file=$this->tmpFiles[$id];
                }
-               $stream=fopen($file,$mode);
+               $stream=fopen($file, $mode);
                OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size);
-               return fopen('crypt://streams/'.$id,$mode);
+               return fopen('crypt://streams/'.$id, $mode);
        }
 
        function testBinary() {
@@ -60,26 +60,26 @@ class Test_CryptStream extends UnitTestCase {
                $source=file_get_contents($file);
 
                $stream=$this->getStream('test','w', strlen($source));
-               fwrite($stream,$source);
+               fwrite($stream, $source);
                fclose($stream);
 
                $stream=$this->getStream('test','r', strlen($source));
                $data=stream_get_contents($stream);
                fclose($stream);
                $this->assertEqual(strlen($data), strlen($source));
-               $this->assertEqual($source,$data);
+               $this->assertEqual($source, $data);
 
                $file=__DIR__.'/zeros';
                $source=file_get_contents($file);
 
                $stream=$this->getStream('test2','w', strlen($source));
-               fwrite($stream,$source);
+               fwrite($stream, $source);
                fclose($stream);
 
                $stream=$this->getStream('test2','r', strlen($source));
                $data=stream_get_contents($stream);
                fclose($stream);
                $this->assertEqual(strlen($data), strlen($source));
-               $this->assertEqual($source,$data);
+               $this->assertEqual($source, $data);
        }
 }
index 9dc3cdd71479aa361c4fe0dc828c1a0b3fc905f3..57a6438ff10dedeac4312a73fad55c9a218dbcd5 100755 (executable)
@@ -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";
index 13d1387f287ac6579fddaf78a4c41683ce6c705f..8a67b31b20b2dc42c06eb65d30794e0c98eca76e 100644 (file)
@@ -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+':
@@ -71,10 +71,10 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
                                $tmpFile=OCP\Files::tmpFile($ext);
                                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);
                }
        }
 
index eed2582dc99bae46761a9ad9541a635d5f7c1358..d7636894347fcf6017bd1ec2e4a6f9516236e36e 100644 (file)
@@ -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;
index 7263ef2325395ea882c6f2f8b5795884c5f05b37..7961ecbe1b7788451371776e84f4c91175c7237d 100644 (file)
@@ -50,15 +50,15 @@ 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,'');
@@ -68,16 +68,16 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{
                }
        }
 
-       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) {
index 632c72c280fa88400d817ab62db678444d9f61f4..c04de45d404cdea96a5eee7f488baf24da8d2401 100644 (file)
@@ -40,7 +40,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
         */
        private function getContainerName($path) {
                $path=trim(trim($this->root,'/')."/".$path,'/.');
-               return str_replace('/','\\',$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");
+                               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':
@@ -434,7 +434,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
                                $tmpFile=$this->getTmpFile($path);
                                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);
index e29ec6cb8a2818485e83d97d9747ee45181eefa7..3d2ea7fa2a289daab89a257ffd15021439b77bab 100644 (file)
@@ -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{
@@ -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);
index 7271dcc930b1550975bc64fc460f6b4d4def5d3f..ac6fb1f683e6f1d4fd3b5c145b8bbc2f74bade5e 100644 (file)
@@ -451,7 +451,7 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
         * @param int $time
         * @return bool
         */
-       public function hasUpdated($path,$time) {
+       public function hasUpdated($path, $time) {
                //TODO
                return false;
        }
index 822103ebc32926076a19d1421cfaa5da408e3101..e897a81f7af4588de258115ca8f17003b46bdef5 100644 (file)
@@ -64,7 +64,7 @@ class Hooks {
                $abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$params['newpath'].'.v';
                if(Storage::isversioned($rel_oldpath)) {
                        $info=pathinfo($abs_newpath);
-                       if(!file_exists($info['dirname'])) mkdir($info['dirname'],0750, true);
+                       if(!file_exists($info['dirname'])) mkdir($info['dirname'], 0750, true);
                        $versions = Storage::getVersions($rel_oldpath);
                        foreach ($versions as $v) {
                                rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
index 2f27cd0e667ae5f061a0c89a9c1741ab33864f33..8ee147d085420b0dae1e4e0b5fb0d173c17bc6cf 100644 (file)
@@ -73,7 +73,7 @@ class Storage {
                        }\r
 \r
                        // check filetype blacklist\r
-                       $blacklist=explode(' ',\OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));\r
+                       $blacklist=explode(' ', \OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));\r
                        foreach($blacklist as $bl) {\r
                                $parts=explode('.', $filename);\r
                                $ext=end($parts);\r
@@ -99,7 +99,7 @@ class Storage {
                                $versionsFolderName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('');\r
                                $matches=glob($versionsName.'.v*');\r
                                sort($matches);\r
-                               $parts=explode('.v',end($matches));\r
+                               $parts=explode('.v', end($matches));\r
                                if((end($parts)+Storage::DEFAULTMININTERVAL)>time()) {\r
                                        return false;\r
                                }\r
@@ -109,7 +109,7 @@ class Storage {
                        // create all parent folders\r
                        $info=pathinfo($filename);\r
                        if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {\r
-                               mkdir($versionsFolderName.'/'.$info['dirname'],0750,true);\r
+                               mkdir($versionsFolderName.'/'.$info['dirname'],0750, true);\r
                        }\r
 \r
                        // store a new version of a file\r
@@ -124,7 +124,7 @@ class Storage {
        /**\r
         * rollback to an old version of a file.\r
         */\r
-       public static function rollback($filename,$revision) {\r
+       public static function rollback($filename, $revision) {\r
 \r
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {\r
                        list($uid, $filename) = self::getUidAndFilename($filename);\r
index a570b29b79312a3a5f40d2a7a4ae95787aacbf12..74ff55355b21ec0d9499a9b20384b97eaa7ae62d 100644 (file)
@@ -188,9 +188,9 @@ class Connection {
                        $this->config['ldapAgentName']         = \OCP\Config::getAppValue($this->configID, 'ldap_dn','');
                        $this->config['ldapAgentPassword']     = base64_decode(\OCP\Config::getAppValue($this->configID, 'ldap_agent_password',''));
                        $this->config['ldapBase']              = \OCP\Config::getAppValue($this->configID, 'ldap_base', '');
-                       $this->config['ldapBaseUsers']         = \OCP\Config::getAppValue($this->configID, 'ldap_base_users',$this->config['ldapBase']);
+                       $this->config['ldapBaseUsers']         = \OCP\Config::getAppValue($this->configID, 'ldap_base_users', $this->config['ldapBase']);
                        $this->config['ldapBaseGroups']        = \OCP\Config::getAppValue($this->configID, 'ldap_base_groups', $this->config['ldapBase']);
-                       $this->config['ldapTLS']               = \OCP\Config::getAppValue($this->configID, 'ldap_tls',0);
+                       $this->config['ldapTLS']               = \OCP\Config::getAppValue($this->configID, 'ldap_tls', 0);
                        $this->config['ldapNoCase']            = \OCP\Config::getAppValue($this->configID, 'ldap_nocase', 0);
                        $this->config['turnOffCertCheck']      = \OCP\Config::getAppValue($this->configID, 'ldap_turn_off_cert_check', 0);
                        $this->config['ldapUserDisplayName']   = mb_strtolower(\OCP\Config::getAppValue($this->configID, 'ldap_display_name', 'uid'), 'UTF-8');
index bd9f45d357b98c1f053ae15655dbbfbf6caee157..5a16a4c992a3cc82d62bd5f417a50771661ac4db 100755 (executable)
@@ -30,19 +30,19 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
 
        public function createUser() {
                // Can't create user
-               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend',3);
+               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend', 3);
                return false;
        }
 
        public function deleteUser() {
                // Can't delete user
-               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend',3);
+               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend', 3);
                return false;
        }
 
        public function setPassword ( $uid, $password ) {
                // We can't change user password
-               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend',3);
+               OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend', 3);
                return false;
        }
 
index 0bddde5bf3f25c0ca95606bec6f92a12279f5470..4147a48199f54e1bdb1e1f2cc939c3f83790d75e 100644 (file)
@@ -92,7 +92,7 @@ class MDB2_Driver_Function_sqlite3 extends MDB2_Driver_Function_Common
     function substring($value, $position = 1, $length = null)
     {
         if (!is_null($length)) {
-            return "substr($value,$position,$length)";
+            return "substr($value, $position, $length)";
         }
         return "substr($value, $position, length($value))";
     }
index 9757e4faf941f4dda1737f58bccf6efdc0b3ace2..c9e7170ac690478dfc897a5a6fd196d43aa4a415 100644 (file)
@@ -153,7 +153,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
                if($this->connection) {
                        return $this->connection->escapeString($text);
                }else{
-                       return str_replace("'","''",$text);//TODO; more
+                       return str_replace("'", "''", $text);//TODO; more
                }
     }
 
@@ -276,7 +276,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
      * @access  public
      * @since   2.1.1
      */
-    function setTransactionIsolation($isolation,$options=array())
+    function setTransactionIsolation($isolation, $options=array())
     {
         $this->debug('Setting transaction isolation level', __FUNCTION__, array('is_manip' => true));
         switch ($isolation) {
@@ -1142,9 +1142,9 @@ class MDB2_Statement_sqlite3 extends MDB2_Statement_Common
     function bindValue($parameter, $value, $type = null) {
                if($type) {
                        $type=$this->getParamType($type);
-                       $this->statement->bindValue($parameter,$value,$type);
+                       $this->statement->bindValue($parameter, $value, $type);
                }else{
-                       $this->statement->bindValue($parameter,$value);
+                       $this->statement->bindValue($parameter, $value);
                }
                return MDB2_OK;
     }
@@ -1165,9 +1165,9 @@ class MDB2_Statement_sqlite3 extends MDB2_Statement_Common
     function bindParam($parameter, &$value, $type = null) {
         if($type) {
                        $type=$this->getParamType($type);
-                       $this->statement->bindParam($parameter,$value,$type);
+                       $this->statement->bindParam($parameter, $value, $type);
                }else{
-                       $this->statement->bindParam($parameter,$value);
+                       $this->statement->bindParam($parameter, $value);
                }
         return MDB2_OK;
     }
@@ -1318,7 +1318,7 @@ class MDB2_Statement_sqlite3 extends MDB2_Statement_Common
                        }else{
                                $types=null;
                        }
-            $err = $this->bindValueArray($values,$types);
+            $err = $this->bindValueArray($values, $types);
             if (PEAR::isError($err)) {
                 return $this->db->raiseError(MDB2_ERROR, null, null,
                                             'Binding Values failed with message: ' . $err->getMessage(), __FUNCTION__);
index 231037cbd3bd6bab55d75be93ea22a43429fa9ad..f82961ca3a8a2f5561711715ae0ef3872282d07e 100755 (executable)
@@ -92,7 +92,7 @@ class OC_App{
         * @param string/array $types
         * @return bool
         */
-       public static function isType($app,$types) {
+       public static function isType($app, $types) {
                if(is_string($types)) {
                        $types=array($types);
                }
@@ -404,7 +404,7 @@ class OC_App{
         * @return array
         * @note all data is read from info.xml, not just pre-defined fields
        */
-       public static function getAppInfo($appid,$path=false) {
+       public static function getAppInfo($appid, $path=false) {
                if($path) {
                        $file=$appid;
                }else{
@@ -523,21 +523,21 @@ class OC_App{
        /**
         * register a settings form to be shown
         */
-       public static function registerSettings($app,$page) {
+       public static function registerSettings($app, $page) {
                self::$settingsForms[]= $app.'/'.$page.'.php';
        }
 
        /**
         * register an admin form to be shown
         */
-       public static function registerAdmin($app,$page) {
+       public static function registerAdmin($app, $page) {
                self::$adminForms[]= $app.'/'.$page.'.php';
        }
 
        /**
         * register a personal form to be shown
         */
-       public static function registerPersonal($app,$page) {
+       public static function registerPersonal($app, $page) {
                self::$personalForms[]= $app.'/'.$page.'.php';
        }
 
index ed0e8f1d0bd17aa1e6023e9c9cdfcef1f9ccf31f..1f2d576af877c0c2cbea553d258077568a3f6d2e 100644 (file)
@@ -107,7 +107,7 @@ class OC_Appconfig{
         * @param string $key
         * @return bool
         */
-       public static function hasKey($app,$key) {
+       public static function hasKey($app, $key) {
                $exists = self::getKeys( $app );
                return in_array( $key, $exists );
        }
@@ -170,7 +170,7 @@ class OC_Appconfig{
         * @param key
         * @return array
         */
-       public static function getValues($app,$key) {
+       public static function getValues($app, $key) {
                if($app!==false and $key!==false) {
                        return false;
                }
index a9c245eaf433d0db1d9cc8e806d057b61f1b2d57..61239c82076bb3394b6466aa80363e5807e31ef1 100644 (file)
@@ -42,14 +42,14 @@ abstract class OC_Archive{
         * @param string source either a local file or string data
         * @return bool
         */
-       abstract function addFile($path,$source='');
+       abstract function addFile($path, $source='');
        /**
         * rename a file or folder in the archive
         * @param string source
         * @param string dest
         * @return bool
         */
-       abstract function rename($source,$dest);
+       abstract function rename($source, $dest);
        /**
         * get the uncompressed size of a file in the archive
         * @param string path
@@ -85,7 +85,7 @@ abstract class OC_Archive{
         * @param string dest
         * @return bool
         */
-       abstract function extractFile($path,$dest);
+       abstract function extractFile($path, $dest);
        /**
         * extract the archive
         * @param string path
@@ -111,14 +111,14 @@ abstract class OC_Archive{
         * @param string mode
         * @return resource
         */
-       abstract function getStream($path,$mode);
+       abstract function getStream($path, $mode);
        /**
         * add a folder and all it's content
         * @param string $path
         * @param string source
         * @return bool
         */
-       function addRecursive($path,$source) {
+       function addRecursive($path, $source) {
                if($dh=opendir($source)) {
                        $this->addFolder($path);
                        while($file=readdir($dh)) {
index 7a47802bc347833bfcce039f1dd8cf549044a78b..6e0629a0e18b9a791fe3110f590a1ae8bf1766e7 100644 (file)
@@ -84,7 +84,7 @@ class OC_Archive_TAR extends OC_Archive{
         * @param string source either a local file or string data
         * @return bool
         */
-       function addFile($path,$source='') {
+       function addFile($path, $source='') {
                if($this->fileExists($path)) {
                        $this->remove($path);
                }
@@ -107,7 +107,7 @@ class OC_Archive_TAR extends OC_Archive{
         * @param string dest
         * @return bool
         */
-       function rename($source,$dest) {
+       function rename($source, $dest) {
                //no proper way to delete, rename entire archive, rename file and remake archive
                $tmp=OCP\Files::tmpFolder();
                $this->tar->extract($tmp);
@@ -214,7 +214,7 @@ class OC_Archive_TAR extends OC_Archive{
         * @param string dest
         * @return bool
         */
-       function extractFile($path,$dest) {
+       function extractFile($path, $dest) {
                $tmp=OCP\Files::tmpFolder();
                if(!$this->fileExists($path)) {
                        return false;
@@ -294,7 +294,7 @@ class OC_Archive_TAR extends OC_Archive{
         * @param string mode
         * @return resource
         */
-       function getStream($path,$mode) {
+       function getStream($path, $mode) {
                if(strrpos($path, '.')!==false) {
                        $ext=substr($path, strrpos($path, '.'));
                }else{
index d016c692e357d6e9721f5c0ec62333a1860430a1..5a6fc578be74688e6e505732cd4e28de8427728a 100644 (file)
@@ -35,7 +35,7 @@ class OC_Archive_ZIP extends OC_Archive{
         * @param string source either a local file or string data
         * @return bool
         */
-       function addFile($path,$source='') {
+       function addFile($path, $source='') {
                if($source and $source[0]=='/' and file_exists($source)) {
                        $result=$this->zip->addFile($source, $path);
                }else{
@@ -53,7 +53,7 @@ class OC_Archive_ZIP extends OC_Archive{
         * @param string dest
         * @return bool
         */
-       function rename($source,$dest) {
+       function rename($source, $dest) {
                $source=$this->stripPath($source);
                $dest=$this->stripPath($dest);
                $this->zip->renameName($source, $dest);
@@ -119,7 +119,7 @@ class OC_Archive_ZIP extends OC_Archive{
         * @param string dest
         * @return bool
         */
-       function extractFile($path,$dest) {
+       function extractFile($path, $dest) {
                $fp = $this->zip->getStream($path);
                file_put_contents($dest, $fp);
        }
@@ -158,7 +158,7 @@ class OC_Archive_ZIP extends OC_Archive{
         * @param string mode
         * @return resource
         */
-       function getStream($path,$mode) {
+       function getStream($path, $mode) {
                if($mode=='r' or $mode=='rb') {
                        return $this->zip->getStream($path);
                } else {
index 5bd38240d4471ff9524e6e4d36485f793b5df814..ed02840195dc2a05bf4b5a1e88174aa005acc7f3 100644 (file)
@@ -45,7 +45,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
         */
        public function put($data) {
 
-               OC_Filesystem::file_put_contents($this->path,$data);
+               OC_Filesystem::file_put_contents($this->path, $data);
 
                return OC_Connector_Sabre_Node::getETagPropertyForPath($this->path);
        }
index 8ebe324602c07b9549d78b3886c1a99f2ef3d59d..55a8d5eaa6dc63dd150f69611dde657be3bb9ab3 100644 (file)
@@ -45,10 +45,10 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
                // but otherwise reading locks from SQLite Databases will return
                // nothing
                $query = 'SELECT * FROM `*PREFIX*locks` WHERE `userid` = ? AND (`created` + `timeout`) > '.time().' AND (( `uri` = ?)';
-               $params = array(OC_User::getUser(),$uri);
+               $params = array(OC_User::getUser(), $uri);
 
                // We need to check locks for every part in the uri.
-               $uriParts = explode('/',$uri);
+               $uriParts = explode('/', $uri);
 
                // We already covered the last part of the uri
                array_pop($uriParts);
@@ -137,7 +137,7 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
        public function unlock($uri,Sabre_DAV_Locks_LockInfo $lockInfo) {
 
                $query = OC_DB::prepare( 'DELETE FROM `*PREFIX*locks` WHERE `userid` = ? AND `uri` = ? AND `token` = ?' );
-               $result = $query->execute( array(OC_User::getUser(),$uri,$lockInfo->token));
+               $result = $query->execute( array(OC_User::getUser(), $uri, $lockInfo->token));
 
                return $result->numRows() === 1;
 
index 72de972377499da25b1c51aef7bd3c2537aad31b..291b87257f167a6ac3f99a397b416457c81ee9ce 100644 (file)
@@ -80,7 +80,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                $newPath = $parentPath . '/' . $newName;
                $oldPath = $this->path;
 
-               OC_Filesystem::rename($this->path,$newPath);
+               OC_Filesystem::rename($this->path, $newPath);
 
                $this->path = $newPath;
 
@@ -156,7 +156,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                                } else {
                                        if(!array_key_exists( $propertyName, $existing )) {
                                                $query = OC_DB::prepare( 'INSERT INTO `*PREFIX*properties` (`userid`,`propertypath`,`propertyname`,`propertyvalue`) VALUES(?,?,?,?)' );
-                                               $query->execute( array( OC_User::getUser(), $this->path, $propertyName,$propertyValue ));
+                                               $query->execute( array( OC_User::getUser(), $this->path, $propertyName, $propertyValue ));
                                        } else {
                                                $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyvalue` = ? WHERE `userid` = ? AND `propertypath` = ? AND `propertyname` = ?' );
                                                $query->execute( array( $propertyValue,OC_User::getUser(), $this->path, $propertyName ));
index 763503721f8225db4abe149ec1e04caec2a7a0a4..04be410ac85ea44875ea9ad87226d96853a95d4d 100644 (file)
@@ -46,7 +46,7 @@ class OC_Connector_Sabre_Principal implements Sabre_DAVACL_IPrincipalBackend {
         * @return array
         */
        public function getPrincipalByPath($path) {
-               list($prefix,$name) = explode('/', $path);
+               list($prefix, $name) = explode('/', $path);
 
                if ($prefix == 'principals' && OC_User::userExists($name)) {
                        return array(
@@ -83,7 +83,7 @@ class OC_Connector_Sabre_Principal implements Sabre_DAVACL_IPrincipalBackend {
         * @return array
         */
        public function getGroupMembership($principal) {
-               list($prefix,$name) = Sabre_DAV_URLUtil::splitPath($principal);
+               list($prefix, $name) = Sabre_DAV_URLUtil::splitPath($principal);
 
                $group_membership = array();
                if ($prefix == 'principals') {
index a43f2ad20b2fddef4b673f46794115b45ab212b0..ba59985b7564ca0d3328ac014ff5e3c55aca78ee 100644 (file)
@@ -115,7 +115,7 @@ class OC_DB {
                $pass = OC_Config::getValue( "dbpassword", "" );
                $type = OC_Config::getValue( "dbtype", "sqlite" );
                if(strpos($host, ':')) {
-                       list($host, $port)=explode(':', $host,2);
+                       list($host, $port)=explode(':', $host, 2);
                }else{
                        $port=false;
                }
@@ -767,8 +767,8 @@ class PDOStatementWrapper{
        /**
         * pass all other function directly to the PDOStatement
         */
-       public function __call($name,$arguments) {
-               return call_user_func_array(array($this->statement,$name), $arguments);
+       public function __call($name, $arguments) {
+               return call_user_func_array(array($this->statement, $name), $arguments);
        }
 
        /**
index 3bada131bdda30a8bd277182b46c806b449d7b36..578441ee707b7703d244b702dd6819cf609846e9 100644 (file)
@@ -56,7 +56,7 @@ class OC_EventSource{
         *
         * if only one paramater is given, a typeless message will be send with that paramater as data
         */
-       public function send($type,$data=null) {
+       public function send($type, $data=null) {
                if(is_null($data)) {
                        $data=$type;
                        $type=null;
index fee3b3982516fa32f089986c316be7115f490de0..d5f90d30233c949e4594989941c4d9b5a7e04619 100644 (file)
@@ -42,7 +42,7 @@ class OC_FileCache{
         * - encrypted
         * - versioned
         */
-       public static function get($path,$root=false) {
+       public static function get($path, $root=false) {
                if(OC_FileCache_Update::hasUpdated($path, $root)) {
                        if($root===false) {//filesystem hooks are only valid for the default root
                                OC_Hook::emit('OC_Filesystem', 'post_write', array('path'=>$path));
@@ -61,7 +61,7 @@ class OC_FileCache{
         *
         * $data is an assiciative array in the same format as returned by get
         */
-       public static function put($path,$data,$root=false) {
+       public static function put($path,$data, $root=false) {
                if($root===false) {
                        $root=OC_Filesystem::getRoot();
                }
@@ -117,7 +117,7 @@ class OC_FileCache{
         * @param int $id
         * @param array $data
         */
-       private static function update($id,$data) {
+       private static function update($id, $data) {
                $arguments=array();
                $queryParts=array();
                foreach(array('size','mtime','ctime','mimetype','encrypted','versioned','writable') as $attribute) {
@@ -151,7 +151,7 @@ class OC_FileCache{
         * @param string newPath
         * @param string root (optional)
         */
-       public static function move($oldPath,$newPath,$root=false) {
+       public static function move($oldPath, $newPath, $root=false) {
                if($root===false) {
                        $root=OC_Filesystem::getRoot();
                }
@@ -190,7 +190,7 @@ class OC_FileCache{
         * @param string path
         * @param string root (optional)
         */
-       public static function delete($path,$root=false) {
+       public static function delete($path, $root=false) {
                if($root===false) {
                        $root=OC_Filesystem::getRoot();
                }
@@ -211,7 +211,7 @@ class OC_FileCache{
         * @param string root (optional)
         * @return array of filepaths
         */
-       public static function search($search,$returnData=false,$root=false) {
+       public static function search($search, $returnData=false, $root=false) {
                if($root===false) {
                        $root=OC_Filesystem::getRoot();
                }
@@ -255,7 +255,7 @@ class OC_FileCache{
         * - encrypted
         * - versioned
         */
-       public static function getFolderContent($path,$root=false,$mimetype_filter='') {
+       public static function getFolderContent($path, $root=false, $mimetype_filter='') {
                if(OC_FileCache_Update::hasUpdated($path, $root, true)) {
                        OC_FileCache_Update::updateFolder($path, $root);
                }
@@ -268,7 +268,7 @@ class OC_FileCache{
         * @param string root (optional)
         * @return bool
         */
-       public static function inCache($path,$root=false) {
+       public static function inCache($path, $root=false) {
                return self::getId($path, $root)!=-1;
        }
 
@@ -278,7 +278,7 @@ class OC_FileCache{
         * @param string root (optional)
         * @return int
         */
-       public static function getId($path,$root=false) {
+       public static function getId($path, $root=false) {
                if($root===false) {
                        $root=OC_Filesystem::getRoot();
                }
@@ -314,7 +314,7 @@ class OC_FileCache{
         * @param string user (optional)
         * @return string
         */
-       public static function getPath($id,$user='') {
+       public static function getPath($id, $user='') {
                if(!$user) {
                        $user=OC_User::getUser();
                }
@@ -348,12 +348,12 @@ class OC_FileCache{
         * @param int $sizeDiff
         * @param string root (optinal)
         */
-       public static function increaseSize($path,$sizeDiff, $root=false) {
+       public static function increaseSize($path, $sizeDiff, $root=false) {
                if($sizeDiff==0) return;
                $id=self::getId($path, $root);
                while($id!=-1) {//walk up the filetree increasing the size of all parent folders
                        $query=OC_DB::prepare('UPDATE `*PREFIX*fscache` SET `size`=`size`+? WHERE `id`=?');
-                       $query->execute(array($sizeDiff,$id));
+                       $query->execute(array($sizeDiff, $id));
                        $id=self::getParentId($path);
                        $path=dirname($path);
                }
@@ -366,7 +366,7 @@ class OC_FileCache{
         * @param int count (optional)
         * @param string root (optional)
         */
-       public static function scan($path,$eventSource=false,&$count=0,$root=false) {
+       public static function scan($path,$eventSource=false,&$count=0, $root=false) {
                if($eventSource) {
                        $eventSource->send('scanning', array('file'=>$path, 'count'=>$count));
                }
@@ -401,8 +401,8 @@ class OC_FileCache{
                        }
                }
 
-               OC_FileCache_Update::cleanFolder($path,$root);
-               self::increaseSize($path,$totalSize,$root);
+               OC_FileCache_Update::cleanFolder($path, $root);
+               self::increaseSize($path,$totalSize, $root);
        }
 
        /**
@@ -411,7 +411,7 @@ class OC_FileCache{
         * @param string root (optional)
         * @return int size of the scanned file
         */
-       public static function scanFile($path,$root=false) {
+       public static function scanFile($path, $root=false) {
                // NOTE: Ugly hack to prevent shared files from going into the cache (the source already exists somewhere in the cache)
                if (substr($path, 0, 7) == '/Shared') {
                        return;
@@ -453,7 +453,7 @@ class OC_FileCache{
         * seccond mimetype part can be ommited
         * e.g. searchByMime('audio')
         */
-       public static function searchByMime($part1,$part2=null,$root=false) {
+       public static function searchByMime($part1, $part2=null, $root=false) {
                if($root===false) {
                        $root=OC_Filesystem::getRoot();
                }
index 9b1eb4f7803b3467b6798f5badfcd8cde02cfea2..7458322fb14ab1817b25653bf2aef75e0e790122 100644 (file)
@@ -13,7 +13,7 @@
 class OC_FileCache_Cached{
        public static $savedData=array();
 
-       public static function get($path,$root=false) {
+       public static function get($path, $root=false) {
                if($root===false) {
                        $root=OC_Filesystem::getRoot();
                }
@@ -61,7 +61,7 @@ class OC_FileCache_Cached{
         * - encrypted
         * - versioned
         */
-       public static function getFolderContent($path,$root=false,$mimetype_filter='') {
+       public static function getFolderContent($path, $root=false, $mimetype_filter='') {
                if($root===false) {
                        $root=OC_Filesystem::getRoot();
                }
index f9d64d0ae99d5fd705d6cc1f64a1cbdccbf24707..ecfa89274414e08c9c562cbca919c0a15b565d75 100644 (file)
@@ -18,7 +18,7 @@ class OC_FileCache_Update{
         * @param boolean folder
         * @return bool
         */
-       public static function hasUpdated($path,$root=false,$folder=false) {
+       public static function hasUpdated($path, $root=false, $folder=false) {
                if($root===false) {
                        $view=OC_Filesystem::getView();
                }else{
@@ -46,14 +46,14 @@ class OC_FileCache_Update{
        /**
         * delete non existing files from the cache
         */
-       public static function cleanFolder($path,$root=false) {
+       public static function cleanFolder($path, $root=false) {
                if($root===false) {
                        $view=OC_Filesystem::getView();
                }else{
                        $view=new OC_FilesystemView($root);
                }
 
-               $cachedContent=OC_FileCache_Cached::getFolderContent($path,$root);
+               $cachedContent=OC_FileCache_Cached::getFolderContent($path, $root);
                foreach($cachedContent as $fileData) {
                        $path=$fileData['path'];
                        $file=$view->getRelativePath($path);
@@ -72,7 +72,7 @@ class OC_FileCache_Update{
         * @param string path
         * @param string root (optional)
         */
-       public static function updateFolder($path,$root=false) {
+       public static function updateFolder($path, $root=false) {
                if($root===false) {
                        $view=OC_Filesystem::getView();
                }else{
@@ -143,7 +143,7 @@ class OC_FileCache_Update{
         * @param string path
         * @param string root (optional)
         */
-       public static function update($path,$root=false) {
+       public static function update($path, $root=false) {
                if($root===false) {
                        $view=OC_Filesystem::getView();
                }else{
@@ -153,7 +153,7 @@ class OC_FileCache_Update{
                $mimetype=$view->getMimeType($path);
 
                $size=0;
-               $cached=OC_FileCache_Cached::get($path,$root);
+               $cached=OC_FileCache_Cached::get($path, $root);
                $cachedSize=isset($cached['size'])?$cached['size']:0;
 
                if($view->is_dir($path.'/')) {
@@ -184,7 +184,7 @@ class OC_FileCache_Update{
         * @param string path
         * @param string root (optional)
         */
-       public static function delete($path,$root=false) {
+       public static function delete($path, $root=false) {
                $cached=OC_FileCache_Cached::get($path, $root);
                if(!isset($cached['size'])) {
                        return;
@@ -200,7 +200,7 @@ class OC_FileCache_Update{
         * @param string newPath
         * @param string root (optional)
         */
-       public static function rename($oldPath,$newPath,$root=false) {
+       public static function rename($oldPath,$newPath, $root=false) {
                if(!OC_FileCache::inCache($oldPath, $root)) {
                        return;
                }
index 3e7f1aa1c413b074b1219957914f873030d49369..1ca799fb74f84058e1cd695ec458f643b5994906 100644 (file)
@@ -51,7 +51,7 @@ class OC_FileProxy{
         *
         * this implements a dummy proxy for all operations
         */
-       public function __call($function,$arguments) {
+       public function __call($function, $arguments) {
                if(substr($function, 0, 3)=='pre') {
                        return true;
                }else{
@@ -85,7 +85,7 @@ class OC_FileProxy{
                $proxies=self::getProxies($operation);
                foreach($proxies as $proxy) {
                        if(!is_null($filepath2)) {
-                               if($proxy->$operation($filepath,$filepath2)===false) {
+                               if($proxy->$operation($filepath, $filepath2)===false) {
                                        return false;
                                }
                        }else{
@@ -97,14 +97,14 @@ class OC_FileProxy{
                return true;
        }
 
-       public static function runPostProxies($operation,$path,$result) {
+       public static function runPostProxies($operation,$path, $result) {
                if(!self::$enabled) {
                        return $result;
                }
                $operation='post'.$operation;
                $proxies=self::getProxies($operation);
                foreach($proxies as $proxy) {
-                       $result=$proxy->$operation($path,$result);
+                       $result=$proxy->$operation($path, $result);
                }
                return $result;
        }
index 012be582a5122bc0b551648f7d4eb2979252e62d..54bda5d864e5e446f9c269430f52cef0ca32e7fd 100644 (file)
@@ -77,33 +77,33 @@ class OC_FileProxy_Quota extends OC_FileProxy{
                return $totalSpace-$usedSpace;
        }
        
-       public function postFree_space($path,$space) {
+       public function postFree_space($path, $space) {
                $free=$this->getFreeSpace($path);
                if($free==0) {
                        return $space;
                }
-               return min($free,$space);
+               return min($free, $space);
        }
 
-       public function preFile_put_contents($path,$data) {
+       public function preFile_put_contents($path, $data) {
                if (is_resource($data)) {
                        $data = '';//TODO: find a way to get the length of the stream without emptying it
                }
                return (strlen($data)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0);
        }
 
-       public function preCopy($path1,$path2) {
+       public function preCopy($path1, $path2) {
                if(!self::$rootView){
                        self::$rootView = new OC_FilesystemView('');
                }
                return (self::$rootView->filesize($path1)<$this->getFreeSpace($path2) or $this->getFreeSpace($path2)==0);
        }
 
-       public function preFromTmpFile($tmpfile,$path) {
+       public function preFromTmpFile($tmpfile, $path) {
                return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0);
        }
 
-       public function preFromUploadedFile($tmpfile,$path) {
+       public function preFromUploadedFile($tmpfile, $path) {
                return (filesize($tmpfile)<$this->getFreeSpace($path) or $this->getFreeSpace($path)==0);
        }
 }
index b4d4de1c99551176160019e8780f76da119a6382..13bb127e863857d96dd90610c5f364fc67694a57 100644 (file)
@@ -135,7 +135,7 @@ class OC_Files {
        * @param file $file ; seperated list of files to download
        * @param boolean $only_header ; boolean to only send header of the request
        */
-       public static function get($dir,$files, $only_header = false) {
+       public static function get($dir, $files, $only_header = false) {
                if(strpos($files, ';')) {
                        $files=explode(';', $files);
                }
@@ -224,7 +224,7 @@ class OC_Files {
                }
        }
 
-       public static function zipAddDir($dir,$zip,$internalDir='') {
+       public static function zipAddDir($dir, $zip, $internalDir='') {
                $dirname=basename($dir);
                $zip->addEmptyDir($internalDir.$dirname);
                $internalDir.=$dirname.='/';
@@ -249,7 +249,7 @@ class OC_Files {
        * @param dir  $targetDir
        * @param file $target
        */
-       public static function move($sourceDir,$source,$targetDir,$target) {
+       public static function move($sourceDir, $source, $targetDir, $target) {
                if(OC_User::isLoggedIn() && ($sourceDir != '' || $source != 'Shared')) {
                        $targetFile=self::normalizePath($targetDir.'/'.$target);
                        $sourceFile=self::normalizePath($sourceDir.'/'.$source);
@@ -267,7 +267,7 @@ class OC_Files {
        * @param dir  $targetDir
        * @param file $target
        */
-       public static function copy($sourceDir,$source,$targetDir,$target) {
+       public static function copy($sourceDir, $source, $targetDir, $target) {
                if(OC_User::isLoggedIn()) {
                        $targetFile=$targetDir.'/'.$target;
                        $sourceFile=$sourceDir.'/'.$source;
@@ -282,7 +282,7 @@ class OC_Files {
        * @param file $name
        * @param type $type
        */
-       public static function newFile($dir,$name,$type) {
+       public static function newFile($dir, $name, $type) {
                if(OC_User::isLoggedIn()) {
                        $file=$dir.'/'.$name;
                        if($type=='dir') {
@@ -305,7 +305,7 @@ class OC_Files {
        * @param dir  $dir
        * @param file $name
        */
-       public static function delete($dir,$file) {
+       public static function delete($dir, $file) {
                if(OC_User::isLoggedIn() && ($dir!= '' || $file != 'Shared')) {
                        $file=$dir.'/'.$file;
                        return OC_Filesystem::unlink($file);
@@ -389,7 +389,7 @@ class OC_Files {
        * @param  string  file
        * @return string  guessed mime type
        */
-       static function pull($source,$token,$dir,$file) {
+       static function pull($source, $token, $dir, $file) {
                $tmpfile=tempnam(get_temp_dir(), 'remoteCloudFile');
                $fp=fopen($tmpfile,'w+');
                $url=$source.="/files/pull.php?token=$token";
@@ -480,7 +480,7 @@ class OC_Files {
        }
 }
 
-function fileCmp($a,$b) {
+function fileCmp($a, $b) {
        if($a['type']=='dir' and $b['type']!='dir') {
                return -1;
        }elseif($a['type']!='dir' and $b['type']=='dir') {
index 146cecf4efac59ecc3b3961f88d43a733c8a1502..7b3a15dd8c6b93e3ac0566e4c88b9e5c7329f3b4 100644 (file)
@@ -42,13 +42,13 @@ abstract class OC_Filestorage{
        abstract public function filectime($path);
        abstract public function filemtime($path);
        abstract public function file_get_contents($path);
-       abstract public function file_put_contents($path,$data);
+       abstract public function file_put_contents($path, $data);
        abstract public function unlink($path);
-       abstract public function rename($path1,$path2);
-       abstract public function copy($path1,$path2);
-       abstract public function fopen($path,$mode);
+       abstract public function rename($path1, $path2);
+       abstract public function copy($path1, $path2);
+       abstract public function fopen($path, $mode);
        abstract public function getMimeType($path);
-       abstract public function hash($type,$path,$raw = false);
+       abstract public function hash($type,$path, $raw = false);
        abstract public function free_space($path);
        abstract public function search($query);
        abstract public function touch($path, $mtime=null);
@@ -62,6 +62,6 @@ abstract class OC_Filestorage{
         * hasUpdated for folders should return at least true if a file inside the folder is add, removed or renamed.
         * returning true for other changes in the folder is optional
         */
-       abstract public function hasUpdated($path,$time);
+       abstract public function hasUpdated($path, $time);
        abstract public function getOwner($path);
 }
index cf09ea71e8cec4799c57ac706010d2826179393e..3c06570d89056670e0a89bc811431e32f90ce308 100644 (file)
@@ -89,25 +89,25 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
                }
                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);
        }
 //     abstract public function unlink($path);
-       public function rename($path1,$path2) {
+       public function rename($path1, $path2) {
                if($this->copy($path1, $path2)) {
                        return $this->unlink($path1);
                }else{
                        return false;
                }
        }
-       public function copy($path1,$path2) {
+       public function copy($path1, $path2) {
                $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);
+//     abstract public function fopen($path, $mode);
 
        /**
         * @brief Deletes all files and folders recursively within a directory
@@ -204,7 +204,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
                unlink($tmpFile);
                return $mime;
        }
-       public function hash($type,$path,$raw = false) {
+       public function hash($type,$path, $raw = false) {
                $tmpFile=$this->getLocalFile();
                $hash=hash($type, $tmpFile, $raw);
                unlink($tmpFile);
@@ -237,7 +237,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
                $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!=='..') {
@@ -254,7 +254,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
        }
 //     abstract public function touch($path, $mtime=null);
 
-       protected function searchInDir($query,$dir='') {
+       protected function searchInDir($query, $dir='') {
                $files=array();
                $dh=$this->opendir($dir);
                if($dh) {
@@ -264,7 +264,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
                                        $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));
                                }
                        }
                }
@@ -276,7 +276,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
         * @param int $time
         * @return bool
         */
-       public function hasUpdated($path,$time) {
+       public function hasUpdated($path, $time) {
                return $this->filemtime($path)>$time;
        }
 
index b88bb232c3647830fcc7e33f2593941c6b570932..3b038b3fda9e08206b467422c77051851c82e72d 100644 (file)
@@ -63,13 +63,13 @@ class OC_Filestorage_CommonTest extends OC_Filestorage_Common{
        public function unlink($path) {
                return $this->storage->unlink($path);
        }
-       public function fopen($path,$mode) {
-               return $this->storage->fopen($path,$mode);
+       public function fopen($path, $mode) {
+               return $this->storage->fopen($path, $mode);
        }
        public function free_space($path) {
                return $this->storage->free_space($path);
        }
        public function touch($path, $mtime=null) {
-               return $this->storage->touch($path,$mtime);
+               return $this->storage->touch($path, $mtime);
        }
 }
\ No newline at end of file
index 731ac4a3c727009b65ad59867f3bdb09f95696e5..89e994120ca012ad5f1afb548cf91a9fcadd1ddd 100644 (file)
@@ -21,7 +21,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
        }
        public function is_dir($path) {
                if(substr($path,-1)=='/') {
-                       $path=substr($path,0,-1);
+                       $path=substr($path, 0, -1);
                }
                return is_dir($this->datadir.$path);
        }
@@ -78,13 +78,13 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
        public function file_get_contents($path) {
                return file_get_contents($this->datadir.$path);
        }
-       public function file_put_contents($path,$data) {
-               return file_put_contents($this->datadir.$path,$data);
+       public function file_put_contents($path, $data) {
+               return file_put_contents($this->datadir.$path, $data);
        }
        public function unlink($path) {
                return $this->delTree($path);
        }
-       public function rename($path1,$path2) {
+       public function rename($path1, $path2) {
                if (!$this->isUpdatable($path1)) {
                        OC_Log::write('core','unable to rename, file is not writable : '.$path1,OC_Log::ERROR);
                        return false;
@@ -94,11 +94,11 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
                        return false;
                }
 
-               if($return=rename($this->datadir.$path1,$this->datadir.$path2)) {
+               if($return=rename($this->datadir.$path1, $this->datadir.$path2)) {
                }
                return $return;
        }
-       public function copy($path1,$path2) {
+       public function copy($path1, $path2) {
                if($this->is_dir($path2)) {
                        if(!$this->file_exists($path2)) {
                                $this->mkdir($path2);
@@ -106,10 +106,10 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
                        $source=substr($path1, strrpos($path1,'/')+1);
                        $path2.=$source;
                }
-               return copy($this->datadir.$path1,$this->datadir.$path2);
+               return copy($this->datadir.$path1, $this->datadir.$path2);
        }
-       public function fopen($path,$mode) {
-               if($return=fopen($this->datadir.$path,$mode)) {
+       public function fopen($path, $mode) {
+               if($return=fopen($this->datadir.$path, $mode)) {
                        switch($mode) {
                                case 'r':
                                        break;
@@ -156,8 +156,8 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
                return $return;
        }
 
-       public function hash($path,$type,$raw=false) {
-               return hash_file($type,$this->datadir.$path,$raw);
+       public function hash($path,$type, $raw=false) {
+               return hash_file($type,$this->datadir.$path, $raw);
        }
 
        public function free_space($path) {
@@ -174,7 +174,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
                return $this->datadir.$path;
        }
 
-       protected function searchInDir($query,$dir='') {
+       protected function searchInDir($query, $dir='') {
                $files=array();
                foreach (scandir($this->datadir.$dir) as $item) {
                        if ($item == '.' || $item == '..') continue;
@@ -182,7 +182,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
                                $files[]=$dir.'/'.$item;
                        }
                        if(is_dir($this->datadir.$dir.'/'.$item)) {
-                               $files=array_merge($files,$this->searchInDir($query,$dir.'/'.$item));
+                               $files=array_merge($files,$this->searchInDir($query, $dir.'/'.$item));
                        }
                }
                return $files;
@@ -193,7 +193,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
         * @param int $time
         * @return bool
         */
-       public function hasUpdated($path,$time) {
+       public function hasUpdated($path, $time) {
                return $this->filemtime($path)>$time;
        }
 }
index 3b6772c984903186e1658a0cd4fd7dc968481adf..f134f9b4dcd3b7f7293fb03de20b3215482e5f8c 100644 (file)
@@ -303,7 +303,7 @@ class OC_Filesystem{
        * @param  array  arguments
        * @return OC_Filestorage
        */
-       static private function createStorage($class,$arguments) {
+       static private function createStorage($class, $arguments) {
                if(class_exists($class)) {
                        try {
                                return new $class($arguments);
@@ -349,7 +349,7 @@ class OC_Filesystem{
        * @param OC_Filestorage storage
        * @param string mountpoint
        */
-       static public function mount($class,$arguments,$mountpoint) {
+       static public function mount($class, $arguments, $mountpoint) {
                if($mountpoint[0]!='/') {
                        $mountpoint='/'.$mountpoint;
                }
@@ -500,32 +500,32 @@ class OC_Filesystem{
        static public function file_get_contents($path) {
                return self::$defaultInstance->file_get_contents($path);
        }
-       static public function file_put_contents($path,$data) {
+       static public function file_put_contents($path, $data) {
                return self::$defaultInstance->file_put_contents($path, $data);
        }
        static public function unlink($path) {
                return self::$defaultInstance->unlink($path);
        }
-       static public function rename($path1,$path2) {
+       static public function rename($path1, $path2) {
                return self::$defaultInstance->rename($path1, $path2);
        }
-       static public function copy($path1,$path2) {
+       static public function copy($path1, $path2) {
                return self::$defaultInstance->copy($path1, $path2);
        }
-       static public function fopen($path,$mode) {
+       static public function fopen($path, $mode) {
                return self::$defaultInstance->fopen($path, $mode);
        }
        static public function toTmpFile($path) {
                return self::$defaultInstance->toTmpFile($path);
        }
-       static public function fromTmpFile($tmpFile,$path) {
+       static public function fromTmpFile($tmpFile, $path) {
                return self::$defaultInstance->fromTmpFile($tmpFile, $path);
        }
 
        static public function getMimeType($path) {
                return self::$defaultInstance->getMimeType($path);
        }
-       static public function hash($type,$path, $raw = false) {
+       static public function hash($type, $path, $raw = false) {
                return self::$defaultInstance->hash($type, $path, $raw);
        }
 
@@ -542,7 +542,7 @@ class OC_Filesystem{
         * @param int $time
         * @return bool
         */
-       static public function hasUpdated($path,$time) {
+       static public function hasUpdated($path, $time) {
                return self::$defaultInstance->hasUpdated($path, $time);
        }
 
@@ -569,7 +569,7 @@ class OC_Filesystem{
         * @param bool $stripTrailingSlash
         * @return string
         */
-       public static function normalizePath($path,$stripTrailingSlash=true) {
+       public static function normalizePath($path, $stripTrailingSlash=true) {
                if($path=='') {
                        return '/';
                }
index dbb6681656f489802471dcf828f56ff747e60f5e..9a38601acfa797c24064b6b3976eebf6be204a18 100644 (file)
@@ -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()) {
index a89c6c55e3667df77bde8fede9aac0f6a5a847e2..ed9482418bd4ba1a3421ac3dc89a08a29c8551f3 100644 (file)
@@ -139,7 +139,7 @@ class OC_Group {
         */
        public static function inGroup( $uid, $gid ) {
                foreach(self::$_usedBackends as $backend) {
-                       if($backend->inGroup($uid,$gid)) {
+                       if($backend->inGroup($uid, $gid)) {
                                return true;
                        }
                }
@@ -223,7 +223,7 @@ class OC_Group {
        public static function getUserGroups( $uid ) {
                $groups=array();
                foreach(self::$_usedBackends as $backend) {
-                       $groups=array_merge($backend->getUserGroups($uid),$groups);
+                       $groups=array_merge($backend->getUserGroups($uid), $groups);
                }
                asort($groups);
                return $groups;
index 8116dcbd6752f0e6282d135d827b4f7625181559..9516fd52ff8b765eaedf732d65a689290ce54040 100644 (file)
@@ -69,7 +69,7 @@ class OC_Group_Dummy extends OC_Group_Backend {
         */
        public function inGroup($uid, $gid) {
                if(isset($this->groups[$gid])) {
-                       return (array_search($uid,$this->groups[$gid])!==false);
+                       return (array_search($uid, $this->groups[$gid])!==false);
                }else{
                        return false;
                }
@@ -85,7 +85,7 @@ class OC_Group_Dummy extends OC_Group_Backend {
         */
        public function addToGroup($uid, $gid) {
                if(isset($this->groups[$gid])) {
-                       if(array_search($uid,$this->groups[$gid])===false) {
+                       if(array_search($uid, $this->groups[$gid])===false) {
                                $this->groups[$gid][]=$uid;
                                return true;
                        }else{
@@ -104,9 +104,9 @@ class OC_Group_Dummy extends OC_Group_Backend {
         *
         * removes the user from a group.
         */
-       public function removeFromGroup($uid,$gid) {
+       public function removeFromGroup($uid, $gid) {
                if(isset($this->groups[$gid])) {
-                       if(($index=array_search($uid,$this->groups[$gid]))!==false) {
+                       if(($index=array_search($uid, $this->groups[$gid]))!==false) {
                                unset($this->groups[$gid][$index]);
                        }else{
                                return false;
@@ -128,7 +128,7 @@ class OC_Group_Dummy extends OC_Group_Backend {
                $groups=array();
                $allGroups=array_keys($this->groups);
                foreach($allGroups as $group) {
-                       if($this->inGroup($uid,$group)) {
+                       if($this->inGroup($uid, $group)) {
                                $groups[]=$group;
                        }
                }
index 76d12629763a8b45011e49573fda5722982b4aa9..3519b9ed92f0d9681017e07edb032ee2f978ea17 100644 (file)
@@ -73,7 +73,7 @@ abstract class OC_Group_Example {
         *
         * removes the user from a group.
         */
-       abstract public static function removeFromGroup($uid,$gid);
+       abstract public static function removeFromGroup($uid, $gid);
 
        /**
         * @brief Get all groups a user belongs to
index 9843f5b1dc2973aaa467bd8384687a20c45d7653..27e312eeb2b10ef432623b53299379386bb64156 100644 (file)
@@ -377,7 +377,7 @@ class OC_Helper {
                if($mimeType=='application/octet-stream' and function_exists('finfo_open') and function_exists('finfo_file') and $finfo=finfo_open(FILEINFO_MIME)) {
                        $info = @strtolower(finfo_file($finfo, $path));
                        if($info) {
-                               $mimeType=substr($info,0, strpos($info, ';'));
+                               $mimeType=substr($info, 0, strpos($info, ';'));
                        }
                        finfo_close($finfo);
                }
@@ -498,7 +498,7 @@ class OC_Helper {
         * @param resource $target
         * @return int the number of bytes copied
         */
-       public static function streamCopy($source,$target) {
+       public static function streamCopy($source, $target) {
                if(!$source or !$target) {
                        return false;
                }
index 8c504fb6129ca8e0365654c16b867857d5b5e5a1..0c776d47d5af12382e355aee3935f63cd28a50fa 100644 (file)
@@ -68,7 +68,7 @@ class OC_Installer{
                                OC_Log::write('core','No href specified when installing app from http',OC_Log::ERROR);
                                return false;
                        }
-                       copy($data['href'],$path);
+                       copy($data['href'], $path);
                }else{
                        if(!isset($data['path'])) {
                                OC_Log::write('core','No path specified when installing app from local file',OC_Log::ERROR);
@@ -80,10 +80,10 @@ class OC_Installer{
                //detect the archive type
                $mime=OC_Helper::getMimeType($path);
                if($mime=='application/zip') {
-                       rename($path,$path.'.zip');
+                       rename($path, $path.'.zip');
                        $path.='.zip';
                }elseif($mime=='application/x-gzip') {
-                       rename($path,$path.'.tgz');
+                       rename($path, $path.'.tgz');
                        $path.='.tgz';
                }else{
                        OC_Log::write('core','Archives of type '.$mime.' are not supported',OC_Log::ERROR);
@@ -344,7 +344,7 @@ class OC_Installer{
         * @param string $folder the folder of the app to check
         * @returns true for app is o.k. and false for app is not o.k.
         */
-       public static function checkCode($appname,$folder) {
+       public static function checkCode($appname, $folder) {
 
                $blacklist=array(
                        'exec(',
index cc6cee6caff8af2d51a16d8a01011d587f7a1bd7..be37f94ca65ec9a9565491c16a6d61ab355938cc 100644 (file)
@@ -120,7 +120,7 @@ class OC_JSON{
        /**
        * Encode and print $data in json format
        */
-       public static function encodedPrint($data,$setContentType=true) {
+       public static function encodedPrint($data, $setContentType=true) {
                // Disable mimesniffing, don't move this to setContentTypeHeader!
                header( 'X-Content-Type-Options: nosniff' );
                if($setContentType) {
index f1a2523c3071541f076eabd13fb686f908ed771c..996ace2f57a87bc7dc75369c1eb2425b0fa503a9 100644 (file)
@@ -68,14 +68,14 @@ class OC_L10N{
         * get an L10N instance
         * @return OC_L10N
         */
-       public static function get($app,$lang=null) {
+       public static function get($app, $lang=null) {
                if(is_null($lang)) {
                        if(!isset(self::$instances[$app])) {
                                self::$instances[$app]=new OC_L10N($app);
                        }
                        return self::$instances[$app];
                }else{
-                       return new OC_L10N($app,$lang);
+                       return new OC_L10N($app, $lang);
                }
        }
 
index 8d30fff9f28248e827fc357edc3a876b0e6eb35b..a77ac5856992d01756424bf3f2f18cbd0c043b96 100644 (file)
@@ -56,13 +56,13 @@ class OC_Mail {
                $mailo->From =$fromaddress;
                $mailo->FromName = $fromname;;
                $mailo->Sender =$fromaddress;
-               $a=explode(' ',$toaddress);
+               $a=explode(' ', $toaddress);
                try {
                        foreach($a as $ad) {
-                               $mailo->AddAddress($ad,$toname);
+                               $mailo->AddAddress($ad, $toname);
                        }
 
-                       if($ccaddress<>'') $mailo->AddCC($ccaddress,$ccname);
+                       if($ccaddress<>'') $mailo->AddCC($ccaddress, $ccname);
                        if($bcc<>'') $mailo->AddBCC($bcc);
 
                        $mailo->AddReplyTo($fromaddress, $fromname);
index 87f8da68c9d6c376dcdf2945821f9291e5d83bb9..ca102b03d8f94fa954e6c8252787d2b9a1f96355 100644 (file)
@@ -152,7 +152,7 @@ class OC_Migration_Content{
                        $sql = "INSERT INTO `" . $options['table'] . '` ( `';
                        $fieldssql = implode( '`, `', $fields );
                        $sql .= $fieldssql . "` ) VALUES( ";
-                       $valuessql = substr( str_repeat( '?, ', count( $fields ) ),0,-2 );
+                       $valuessql = substr( str_repeat( '?, ', count( $fields ) ), 0, -2 );
                        $sql .= $valuessql . " )";
                        // Make the query
                        $query = $this->prepare( $sql );
index deffa8e65df0abd0322d6ecc621198d3e4f6bdb2..3310624596309cbba5c78878a62ffc02c8f4863b 100644 (file)
@@ -48,11 +48,11 @@ abstract class OC_Minimizer {
 }
 
 if (!function_exists('gzdecode')) {
-       function gzdecode($data,$maxlength=null,&$filename='',&$error='')
+       function gzdecode($data, $maxlength=null, &$filename='', &$error='')
        {
-               if (strcmp(substr($data,0,9),"\x1f\x8b\x8\0\0\0\0\0\0")) {
+               if (strcmp(substr($data, 0, 9),"\x1f\x8b\x8\0\0\0\0\0\0")) {
                        return null;  // Not the GZIP format we expect (See RFC 1952)
                }
-               return gzinflate(substr($data,10,-8));
+               return gzinflate(substr($data, 10, -8));
        }
 }
index 32c2cfe6e48340ea7a7ebb6b0fe1ae59a78399ba..2a36cbc12390c6ca8e4e02dcccf11dd164883500 100644 (file)
@@ -105,18 +105,18 @@ class OC_OCSClient{
         *
         * This function returns a list of all the applications on the OCS server
         */
-       public static function getApplications($categories,$page,$filter) {
+       public static function getApplications($categories, $page, $filter) {
                if(OC_Config::getValue('appstoreenabled', true)==false) {
                        return(array());
                }
 
                if(is_array($categories)) {
-                       $categoriesstring=implode('x',$categories);
+                       $categoriesstring=implode('x', $categories);
                }else{
                        $categoriesstring=$categories;
                }
 
-               $version='&version='.implode('x',\OC_Util::getVersion());
+               $version='&version='.implode('x', \OC_Util::getVersion());
                $filterurl='&filter='.urlencode($filter);
                $url=OC_OCSClient::getAppStoreURL().'/content/data?categories='.urlencode($categoriesstring).'&sortmode=new&page='.urlencode($page).'&pagesize=100'.$filterurl.$version;
                $apps=array();
@@ -192,7 +192,7 @@ class OC_OCSClient{
                *
                * This function returns an download url for an applications from the OCS server
                */
-       public static function getApplicationDownload($id,$item) {
+       public static function getApplicationDownload($id, $item) {
                if(OC_Config::getValue('appstoreenabled', true)==false) {
                        return null;
                }
@@ -222,7 +222,7 @@ class OC_OCSClient{
         *
         * This function returns a list of all the knowledgebase entries from the OCS server
         */
-       public static function getKnownledgebaseEntries($page,$pagesize,$search='') {
+       public static function getKnownledgebaseEntries($page, $pagesize, $search='') {
                if(OC_Config::getValue('knowledgebaseenabled', true)==false) {
                        $kbe=array();
                        $kbe['totalitems']=0;
index b198a18415cc17bd93447ed73517db250f4bedd9..6270457834dbebde0b2139b4aaa7c69217ed7f71 100644 (file)
@@ -139,7 +139,7 @@ class OC_Preferences{
        public static function setValue( $user, $app, $key, $value ) {
                // Check if the key does exist
                $query = OC_DB::prepare( 'SELECT `configvalue` FROM `*PREFIX*preferences` WHERE `userid` = ? AND `appid` = ? AND `configkey` = ?' );
-               $values=$query->execute(array($user,$app,$key))->fetchAll();
+               $values=$query->execute(array($user, $app, $key))->fetchAll();
                $exists=(count($values)>0);
 
                if( !$exists ) {
index 6ce62b27ca27d22ee87b0d5d9f86bc000d0acc99..d2484b6eb83032368b1382ed6a2344efcb9aee68 100644 (file)
@@ -42,7 +42,7 @@ class DB {
         * SQL query via MDB2 prepare(), needs to be execute()'d!
         */
        static public function prepare( $query, $limit=null, $offset=null ) {
-               return(\OC_DB::prepare($query,$limit,$offset));
+               return(\OC_DB::prepare($query, $limit, $offset));
        }
 
        /**
index 38da7e821717ee968d875bdf9576ee57d2e720fb..6ce79715b6fe7a6578edf92f115f035c89746488 100644 (file)
@@ -107,8 +107,8 @@ class Util {
         * @param int timestamp $timestamp
         * @param bool dateOnly option to ommit time from the result
         */
-       public static function formatDate( $timestamp,$dateOnly=false) {
-               return(\OC_Util::formatDate( $timestamp,$dateOnly ));
+       public static function formatDate( $timestamp, $dateOnly=false) {
+               return(\OC_Util::formatDate( $timestamp, $dateOnly ));
        }
 
        /**
index 0b6ad050024349649dc60184752a73edacfd5153..2629c5e2fbefaf4a651f8fdc1c989f6153369061 100644 (file)
@@ -40,7 +40,7 @@ class OC_Search{
         * register a new search provider to be used
         * @param string $provider class name of a OC_Search_Provider
         */
-       public static function registerProvider($class,$options=array()) {
+       public static function registerProvider($class, $options=array()) {
                self::$registeredProviders[]=array('class'=>$class,'options'=>$options);
        }
 
index 63b5cfabce6ef2bd428a237d48452102a9f73a2c..08beaea151ca77657521532e87db9c841df6c1d4 100644 (file)
@@ -15,7 +15,7 @@ class OC_Search_Result{
         * @param string $link link for the result
         * @param string $type the type of result as human readable string ('File', 'Music', etc)
         */
-       public function __construct($name,$text,$link,$type) {
+       public function __construct($name, $text, $link, $type) {
                $this->name=$name;
                $this->text=$text;
                $this->link=$link;
index 4e4a32e7362782eb52952de866382dbb92862497..d0620f814a086a2cacb157cedea56899a7015930 100644 (file)
@@ -251,7 +251,7 @@ class OC_Setup {
                mysql_close($connection);
        }
 
-       private static function createMySQLDatabase($name,$user,$connection) {
+       private static function createMySQLDatabase($name, $user, $connection) {
                //we cant use OC_BD functions here because we need to connect as the administrative user.
                $query = "CREATE DATABASE IF NOT EXISTS  `$name`";
                $result = mysql_query($query, $connection);
@@ -264,7 +264,7 @@ class OC_Setup {
                $result = mysql_query($query, $connection); //this query will fail if there aren't the right permissons, ignore the error
        }
 
-       private static function createDBUser($name,$password,$connection) {
+       private static function createDBUser($name, $password, $connection) {
                // we need to create 2 accounts, one for global use and one for local user. if we don't specify the local one,
                // the anonymous user would take precedence when there is one.
                $query = "CREATE USER '$name'@'localhost' IDENTIFIED BY '$password'";
@@ -339,7 +339,7 @@ class OC_Setup {
                }
        }
 
-       private static function pg_createDatabase($name,$user,$connection) {
+       private static function pg_createDatabase($name, $user, $connection) {
                //we cant use OC_BD functions here because we need to connect as the administrative user.
                $e_name = pg_escape_string($name);
                $e_user = pg_escape_string($user);
@@ -364,7 +364,7 @@ class OC_Setup {
                $result = pg_query($connection, $query);
        }
 
-       private static function pg_createDBUser($name,$password,$connection) {
+       private static function pg_createDBUser($name, $password, $connection) {
                $e_name = pg_escape_string($name);
                $e_password = pg_escape_string($password);
                $query = "select * from pg_roles where rolname='$e_name';";
index 63b795f4c4de236481b2fb67a83f37b977b629b5..b5ea0a2b2ebf2ab16e3063f27d16da526e5aacd9 100644 (file)
@@ -5,7 +5,7 @@ class OC_FakeDirStream{
        private $name;
        private $index;
 
-       public function dir_opendir($path,$options) {
+       public function dir_opendir($path, $options) {
                $this->name=substr($path, strlen('fakedir://'));
                $this->index=0;
                if(!isset(self::$dirs[$this->name])) {
@@ -225,7 +225,7 @@ class OC_CloseStreamWrapper{
        public function stream_open($path, $mode, $options, &$opened_path) {
                $path=substr($path, strlen('close://'));
                $this->path=$path;
-               $this->source=fopen($path,$mode);
+               $this->source=fopen($path, $mode);
                if(is_resource($this->source)) {
                        $this->meta=stream_get_meta_data($this->source);
                }
@@ -234,7 +234,7 @@ class OC_CloseStreamWrapper{
        }
 
        public function stream_seek($offset, $whence=SEEK_SET) {
-               fseek($this->source,$offset,$whence);
+               fseek($this->source,$offset, $whence);
        }
 
        public function stream_tell() {
@@ -242,23 +242,23 @@ class OC_CloseStreamWrapper{
        }
 
        public function stream_read($count) {
-               return fread($this->source,$count);
+               return fread($this->source, $count);
        }
 
        public function stream_write($data) {
-               return fwrite($this->source,$data);
+               return fwrite($this->source, $data);
        }
 
-       public function stream_set_option($option,$arg1,$arg2) {
+       public function stream_set_option($option,$arg1, $arg2) {
                switch($option) {
                        case STREAM_OPTION_BLOCKING:
-                               stream_set_blocking($this->source,$arg1);
+                               stream_set_blocking($this->source, $arg1);
                                break;
                        case STREAM_OPTION_READ_TIMEOUT:
-                               stream_set_timeout($this->source,$arg1,$arg2);
+                               stream_set_timeout($this->source,$arg1, $arg2);
                                break;
                        case STREAM_OPTION_WRITE_BUFFER:
-                               stream_set_write_buffer($this->source,$arg1,$arg2);
+                               stream_set_write_buffer($this->source,$arg1, $arg2);
                }
        }
 
@@ -267,7 +267,7 @@ class OC_CloseStreamWrapper{
        }
 
        public function stream_lock($mode) {
-               flock($this->source,$mode);
+               flock($this->source, $mode);
        }
 
        public function stream_flush() {
@@ -290,7 +290,7 @@ class OC_CloseStreamWrapper{
        public function stream_close() {
                fclose($this->source);
                if(isset(self::$callBacks[$this->path])) {
-                       call_user_func(self::$callBacks[$this->path],$this->path);
+                       call_user_func(self::$callBacks[$this->path], $this->path);
                }
        }
 
index 1ad47cbe52cdf9050e66d1e5b41193d8885f111a..ed2481afba2f25d7d0610f156a705e4829e02fa1 100644 (file)
@@ -85,7 +85,7 @@ function human_file_size( $bytes ) {
 }
 
 function simple_file_size($bytes) {
-       $mbytes = round($bytes/(1024*1024),1);
+       $mbytes = round($bytes/(1024*1024), 1);
        if($bytes == 0) { return '0'; }
        else if($mbytes < 0.1) { return '&lt; 0.1'; }
        else if($mbytes > 1000) { return '&gt; 1000'; }
@@ -102,12 +102,12 @@ function relative_modified_date($timestamp) {
 
        if($timediff < 60) { return $l->t('seconds ago'); }
        else if($timediff < 120) { return $l->t('1 minute ago'); }
-       else if($timediff < 3600) { return $l->t('%d minutes ago',$diffminutes); }
+       else if($timediff < 3600) { return $l->t('%d minutes ago', $diffminutes); }
        //else if($timediff < 7200) { return '1 hour ago'; }
        //else if($timediff < 86400) { return $diffhours.' hours ago'; }
        else if((date('G')-$diffhours) > 0) { return $l->t('today'); }
        else if((date('G')-$diffhours) > -24) { return $l->t('yesterday'); }
-       else if($timediff < 2678400) { return $l->t('%d days ago',$diffdays); }
+       else if($timediff < 2678400) { return $l->t('%d days ago', $diffdays); }
        else if($timediff < 5184000) { return $l->t('last month'); }
        else if((date('n')-$diffmonths) > 0) { return $l->t('months ago'); }
        else if($timediff < 63113852) { return $l->t('last year'); }
@@ -395,9 +395,9 @@ class OC_Template{
                        }
 
                        // Add custom headers
-                       $page->assign('headers',$this->headers, false);
+                       $page->assign('headers', $this->headers, false);
                        foreach(OC_Util::$headers as $header) {
-                               $page->append('headers',$header);
+                               $page->append('headers', $header);
                        }
 
                        $page->assign( "content", $data, false );
index f55e55985d9da3c881fb8b7e9b14933385fd9eff..7d5ec4ffe90cdf864b27514a3c4b7f10b013c802 100644 (file)
@@ -38,7 +38,7 @@ class OC_Updater{
                $version['updated']=OC_Appconfig::getValue('core', 'lastupdatedat');
                $version['updatechannel']='stable';
                $version['edition']=OC_Util::getEditionString();
-               $versionstring=implode('x',$version);
+               $versionstring=implode('x', $version);
 
                //fetch xml data from updater
                $url=$updaterurl.'?version='.$versionstring;
index 869984a16ebc1048e0dcd11f432ec84012ce2a41..126f2aa3da8c1d7c961e92035e3a1d74cf6c0ed7 100644 (file)
@@ -179,7 +179,7 @@ class OC_User {
                                if(!$backend->implementsActions(OC_USER_BACKEND_CREATE_USER))
                                        continue;
 
-                               $backend->createUser($uid,$password);
+                               $backend->createUser($uid, $password);
                                OC_Hook::emit( "OC_User", "post_createUser", array( "uid" => $uid, "password" => $password ));
 
                                return true;
@@ -329,7 +329,7 @@ class OC_User {
                        foreach(self::$_usedBackends as $backend) {
                                if($backend->implementsActions(OC_USER_BACKEND_SET_PASSWORD)) {
                                        if($backend->userExists($uid)) {
-                                               $success |= $backend->setPassword($uid,$password);
+                                               $success |= $backend->setPassword($uid, $password);
                                        }
                                }
                        }
index b8c90615067875e95913a983286df0714ec452d6..f39c19829e07fa9ece4f5d1650174af1f0ddfdf8 100644 (file)
@@ -48,7 +48,7 @@ class OC_User_Database extends OC_User_Backend {
                if(!self::$hasher) {
                        //we don't want to use DES based crypt(), since it doesn't return a has with a recognisable prefix
                        $forcePortable=(CRYPT_BLOWFISH!=1);
-                       self::$hasher=new PasswordHash(8,$forcePortable);
+                       self::$hasher=new PasswordHash(8, $forcePortable);
                }
                return self::$hasher;
 
@@ -137,7 +137,7 @@ class OC_User_Database extends OC_User_Backend {
                        }else{//old sha1 based hashing
                                if(sha1($password)==$storedHash) {
                                        //upgrade to new hashing
-                                       $this->setPassword($row['uid'],$password);
+                                       $this->setPassword($row['uid'], $password);
                                        return $row['uid'];
                                }else{
                                        return false;
@@ -155,7 +155,7 @@ class OC_User_Database extends OC_User_Backend {
         * Get a list of all users.
         */
        public function getUsers($search = '', $limit = null, $offset = null) {
-               $query = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*users` WHERE LOWER(`uid`) LIKE LOWER(?)',$limit,$offset);
+               $query = OC_DB::prepare('SELECT `uid` FROM `*PREFIX*users` WHERE LOWER(`uid`) LIKE LOWER(?)',$limit, $offset);
                $result = $query->execute(array($search.'%'));
                $users = array();
                while ($row = $result->fetchRow()) {
index 2668341408daaea973fdf47d33fb97a9ceaccfa5..ea055b6982530806888aecd73076dd4d5c354b51 100644 (file)
@@ -40,7 +40,7 @@ class OC_User_HTTP extends OC_User_Backend {
                if(isset($parts['query'])) {
                        $url.='?'.$parts['query'];
                }
-               return array($parts['user'],$url);
+               return array($parts['user'], $url);
 
        }
 
@@ -66,7 +66,7 @@ class OC_User_HTTP extends OC_User_Backend {
                if(!$this->matchUrl($uid)) {
                        return false;
                }
-               list($user,$url)=$this->parseUrl($uid);
+               list($user, $url)=$this->parseUrl($uid);
 
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $url);
index de89e339d99ef5d6c17fe9fa9ed70e322b19114e..a9bc5c061c84a07eff817fdc740308dee2d25da9 100755 (executable)
@@ -95,7 +95,7 @@ class OC_Util {
         */
        public static function getVersion() {
                // hint: We only can count up. So the internal version number of ownCloud 4.5 will be 4.90.0. This is not visible to the user
-               return array(4,91,00);
+               return array(4,91, 00);
        }
 
        /**
@@ -166,7 +166,7 @@ class OC_Util {
         * @param int timestamp $timestamp
         * @param bool dateOnly option to ommit time from the result
         */
-    public static function formatDate( $timestamp,$dateOnly=false) {
+    public static function formatDate( $timestamp, $dateOnly=false) {
                if(isset($_SESSION['timezone'])) {//adjust to clients timezone if we know it
                        $systemTimeZone = intval(date('O'));
                        $systemTimeZone=(round($systemTimeZone/100, 0)*60)+($systemTimeZone%100);
@@ -186,7 +186,7 @@ class OC_Util {
         * @param string $url
         * @return OC_Template
         */
-       public static function getPageNavi($pagecount,$page,$url) {
+       public static function getPageNavi($pagecount,$page, $url) {
 
                $pagelinkcount=8;
                if ($pagecount>1) {
index ba6569a244d8e94c0b76b1110a09d63eb0d0e407..ec4536673aadb77d1b103df496ff23518512c7c3 100644 (file)
@@ -222,7 +222,7 @@ class OC_VCategories {
                if(!is_array($haystack)) {
                        return false;
                }
-               return array_search(strtolower($needle), array_map('strtolower',$haystack));
+               return array_search(strtolower($needle), array_map('strtolower', $haystack));
        }
 
 }
index 44a5fbafdb3fd38e4c0dcc4e030152565c2dbbd0..267176ebc070f8590254ad6b38b8e5f6d9e3363e 100644 (file)
@@ -201,7 +201,7 @@ class OC_VObject{
                return $this->vobject->__isset($name);
        }
 
-       public function __call($function,$arguments) {
+       public function __call($function, $arguments) {
                return call_user_func_array(array($this->vobject, $function), $arguments);
        }
 }
index 9cb70353f9c8edafafa55468316cca9002be642d..7ce0ee0d6ffb7459a35c2bcaa3b1939ed1cebc01 100755 (executable)
@@ -20,22 +20,22 @@ $htaccessworking=OC_Util::ishtaccessworking();
 $entries=OC_Log_Owncloud::getEntries(3);
 $entriesremain=(count(OC_Log_Owncloud::getEntries(4)) > 3)?true:false;
 
-function compareEntries($a,$b) {
+function compareEntries($a, $b) {
        return $b->time - $a->time;
 }
 usort($entries, 'compareEntries');
 
 $tmpl->assign('loglevel',OC_Config::getValue( "loglevel", 2 ));
-$tmpl->assign('entries',$entries);
+$tmpl->assign('entries', $entries);
 $tmpl->assign('entriesremain', $entriesremain);
-$tmpl->assign('htaccessworking',$htaccessworking);
+$tmpl->assign('htaccessworking', $htaccessworking);
 $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
 $tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes'));
 $tmpl->assign('allowLinks', OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes'));
 $tmpl->assign('allowResharing', OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes'));
 $tmpl->assign('sharePolicy', OC_Appconfig::getValue('core', 'shareapi_share_policy', 'global'));
-$tmpl->assign('forms',array());
+$tmpl->assign('forms', array());
 foreach($forms as $form) {
-       $tmpl->append('forms',$form);
+       $tmpl->append('forms', $form);
 }
 $tmpl->printPage();
index 22128ef57b53278ae3fa1f0e9ab76badb74d10dd..273b02e38227a323f1f4e651322835d644f1366d 100644 (file)
@@ -10,7 +10,7 @@ OC_JSON::checkAdminUser();
 $count=(isset($_GET['count']))?$_GET['count']:50;
 $offset=(isset($_GET['offset']))?$_GET['offset']:0;
 
-$entries=OC_Log_Owncloud::getEntries($count,$offset);
+$entries=OC_Log_Owncloud::getEntries($count, $offset);
 OC_JSON::success(array(
        "data" => OC_Util::sanitizeHTML($entries), 
        "remain"=>(count(OC_Log_Owncloud::getEntries(1, $offset + $offset)) != 0) ? true : false));
index 1e9598de1e3541d2bed0012be441b1220f7733ca..38e2af8a51ae14638d19c3fa14018f208ec95e4e 100644 (file)
@@ -16,7 +16,7 @@
                data-type="<?php echo $app['internal'] ? 'internal' : 'external' ?>" data-installed="1">
                <a class="app<?php if(!$app['internal']) echo ' externalapp' ?>" href="?appid=<?php echo $app['id'] ?>"><?php echo htmlentities($app['name']) ?></a>
                <script type="application/javascript">
-                       appData_<?php echo $app['id'] ?>=<?php OC_JSON::encodedPrint($app,false) ?>;
+                       appData_<?php echo $app['id'] ?>=<?php OC_JSON::encodedPrint($app, false) ?>;
                </script>
                <?php  if(!$app['internal']) echo '<small class="externalapp list">3rd party</small>' ?>
        </li>
index 04ae722aea7bd5be00343cfc617ebbbd377e1979..408dc2bbae88eb76f507c4e0a99a3c8665c75d61 100644 (file)
@@ -27,7 +27,7 @@ abstract class Test_Archive extends UnitTestCase {
                $this->instance=$this->getExisting();
                $allFiles=$this->instance->getFiles();
                $expected=array('lorem.txt','logo-wide.png','dir/','dir/lorem.txt');
-               $this->assertEqual(4,count($allFiles),'only found '.count($allFiles).' out of 4 expected files');
+               $this->assertEqual(4, count($allFiles),'only found '.count($allFiles).' out of 4 expected files');
                foreach($expected as $file) {
                        $this->assertContains($file, $allFiles, 'cant find '.  $file . ' in archive');
                        $this->assertTrue($this->instance->fileExists($file),'file '.$file.' does not exist in archive');
@@ -36,14 +36,14 @@ abstract class Test_Archive extends UnitTestCase {
 
                $rootContent=$this->instance->getFolder('');
                $expected=array('lorem.txt','logo-wide.png','dir/');
-               $this->assertEqual(3,count($rootContent));
+               $this->assertEqual(3, count($rootContent));
                foreach($expected as $file) {
                        $this->assertContains($file, $rootContent, 'cant find '.  $file . ' in archive');
                }
 
                $dirContent=$this->instance->getFolder('dir/');
                $expected=array('lorem.txt');
-               $this->assertEqual(1,count($dirContent));
+               $this->assertEqual(1, count($dirContent));
                foreach($expected as $file) {
                        $this->assertContains($file, $dirContent, 'cant find '.  $file . ' in archive');
                }
@@ -53,26 +53,26 @@ abstract class Test_Archive extends UnitTestCase {
                $this->instance=$this->getExisting();
                $dir=OC::$SERVERROOT.'/tests/data';
                $textFile=$dir.'/lorem.txt';
-               $this->assertEqual(file_get_contents($textFile),$this->instance->getFile('lorem.txt'));
+               $this->assertEqual(file_get_contents($textFile), $this->instance->getFile('lorem.txt'));
 
                $tmpFile=OCP\Files::tmpFile('.txt');
-               $this->instance->extractFile('lorem.txt',$tmpFile);
-               $this->assertEqual(file_get_contents($textFile),file_get_contents($tmpFile));
+               $this->instance->extractFile('lorem.txt', $tmpFile);
+               $this->assertEqual(file_get_contents($textFile), file_get_contents($tmpFile));
        }
 
        public function testWrite() {
                $dir=OC::$SERVERROOT.'/tests/data';
                $textFile=$dir.'/lorem.txt';
                $this->instance=$this->getNew();
-               $this->assertEqual(0,count($this->instance->getFiles()));
-               $this->instance->addFile('lorem.txt',$textFile);
-               $this->assertEqual(1,count($this->instance->getFiles()));
+               $this->assertEqual(0, count($this->instance->getFiles()));
+               $this->instance->addFile('lorem.txt', $textFile);
+               $this->assertEqual(1, count($this->instance->getFiles()));
                $this->assertTrue($this->instance->fileExists('lorem.txt'));
                $this->assertFalse($this->instance->fileExists('lorem.txt/'));
 
-               $this->assertEqual(file_get_contents($textFile),$this->instance->getFile('lorem.txt'));
+               $this->assertEqual(file_get_contents($textFile), $this->instance->getFile('lorem.txt'));
                $this->instance->addFile('lorem.txt','foobar');
-               $this->assertEqual('foobar',$this->instance->getFile('lorem.txt'));
+               $this->assertEqual('foobar', $this->instance->getFile('lorem.txt'));
        }
 
        public function testReadStream() {
@@ -80,20 +80,20 @@ abstract class Test_Archive extends UnitTestCase {
                $this->instance=$this->getExisting();
                $fh=$this->instance->getStream('lorem.txt','r');
                $this->assertTrue($fh);
-               $content=fread($fh,$this->instance->filesize('lorem.txt'));
+               $content=fread($fh, $this->instance->filesize('lorem.txt'));
                fclose($fh);
-               $this->assertEqual(file_get_contents($dir.'/lorem.txt'),$content);
+               $this->assertEqual(file_get_contents($dir.'/lorem.txt'), $content);
        }
        public function testWriteStream() {
                $dir=OC::$SERVERROOT.'/tests/data';
                $this->instance=$this->getNew();
                $fh=$this->instance->getStream('lorem.txt','w');
                $source=fopen($dir.'/lorem.txt','r');
-               OCP\Files::streamCopy($source,$fh);
+               OCP\Files::streamCopy($source, $fh);
                fclose($source);
                fclose($fh);
                $this->assertTrue($this->instance->fileExists('lorem.txt'));
-               $this->assertEqual(file_get_contents($dir.'/lorem.txt'),$this->instance->getFile('lorem.txt'));
+               $this->assertEqual(file_get_contents($dir.'/lorem.txt'), $this->instance->getFile('lorem.txt'));
        }
        public function testFolder() {
                $this->instance=$this->getNew();
@@ -111,29 +111,29 @@ abstract class Test_Archive extends UnitTestCase {
                $this->instance=$this->getExisting();
                $tmpDir=OCP\Files::tmpFolder();
                $this->instance->extract($tmpDir);
-               $this->assertEqual(true,file_exists($tmpDir.'lorem.txt'));
-               $this->assertEqual(true,file_exists($tmpDir.'dir/lorem.txt'));
-               $this->assertEqual(true,file_exists($tmpDir.'logo-wide.png'));
-               $this->assertEqual(file_get_contents($dir.'/lorem.txt'),file_get_contents($tmpDir.'lorem.txt'));
+               $this->assertEqual(true, file_exists($tmpDir.'lorem.txt'));
+               $this->assertEqual(true, file_exists($tmpDir.'dir/lorem.txt'));
+               $this->assertEqual(true, file_exists($tmpDir.'logo-wide.png'));
+               $this->assertEqual(file_get_contents($dir.'/lorem.txt'), file_get_contents($tmpDir.'lorem.txt'));
                OCP\Files::rmdirr($tmpDir);
        }
        public function testMoveRemove() {
                $dir=OC::$SERVERROOT.'/tests/data';
                $textFile=$dir.'/lorem.txt';
                $this->instance=$this->getNew();
-               $this->instance->addFile('lorem.txt',$textFile);
+               $this->instance->addFile('lorem.txt', $textFile);
                $this->assertFalse($this->instance->fileExists('target.txt'));
                $this->instance->rename('lorem.txt','target.txt');
                $this->assertTrue($this->instance->fileExists('target.txt'));
                $this->assertFalse($this->instance->fileExists('lorem.txt'));
-               $this->assertEqual(file_get_contents($textFile),$this->instance->getFile('target.txt'));
+               $this->assertEqual(file_get_contents($textFile), $this->instance->getFile('target.txt'));
                $this->instance->remove('target.txt');
                $this->assertFalse($this->instance->fileExists('target.txt'));
        }
        public function testRecursive() {
                $dir=OC::$SERVERROOT.'/tests/data';
                $this->instance=$this->getNew();
-               $this->instance->addRecursive('/dir',$dir);
+               $this->instance->addRecursive('/dir', $dir);
                $this->assertTrue($this->instance->fileExists('/dir/lorem.txt'));
                $this->assertTrue($this->instance->fileExists('/dir/data.zip'));
                $this->assertTrue($this->instance->fileExists('/dir/data.tar.gz'));
index 08653d4a3108d8499de26be32f323a87f9ccd740..7f3eb3ee6fa0fa49fec97c12aac251a13fb443b1 100644 (file)
@@ -23,22 +23,22 @@ abstract class Test_Cache extends UnitTestCase {
                $this->assertFalse($this->instance->hasKey('value1'));
                
                $value='foobar';
-               $this->instance->set('value1',$value);
+               $this->instance->set('value1', $value);
                $this->assertTrue($this->instance->hasKey('value1'));
                $received=$this->instance->get('value1');
-               $this->assertEqual($value,$received,'Value recieved from cache not equal to the original');
+               $this->assertEqual($value, $received,'Value recieved from cache not equal to the original');
                $value='ipsum lorum';
-               $this->instance->set('value1',$value);
+               $this->instance->set('value1', $value);
                $received=$this->instance->get('value1');
-               $this->assertEqual($value,$received,'Value not overwritten by second set');
+               $this->assertEqual($value, $received,'Value not overwritten by second set');
 
                $value2='foobar';
-               $this->instance->set('value2',$value2);
+               $this->instance->set('value2', $value2);
                $received2=$this->instance->get('value2');
                $this->assertTrue($this->instance->hasKey('value1'));
                $this->assertTrue($this->instance->hasKey('value2'));
-               $this->assertEqual($value,$received,'Value changed while setting other variable');
-               $this->assertEqual($value2,$received2,'Second value not equal to original');
+               $this->assertEqual($value, $received,'Value changed while setting other variable');
+               $this->assertEqual($value2, $received2,'Second value not equal to original');
 
                $this->assertFalse($this->instance->hasKey('not_set'));
                $this->assertNull($this->instance->get('not_set'),'Unset value not equal to null');
@@ -49,10 +49,10 @@ abstract class Test_Cache extends UnitTestCase {
 
        function testClear() {
                $value='ipsum lorum';
-               $this->instance->set('1_value1',$value);
-               $this->instance->set('1_value2',$value);
-               $this->instance->set('2_value1',$value);
-               $this->instance->set('3_value1',$value);
+               $this->instance->set('1_value1', $value);
+               $this->instance->set('1_value2', $value);
+               $this->instance->set('2_value1', $value);
+               $this->instance->set('3_value1', $value);
 
                $this->assertTrue($this->instance->clear('1_'));
                $this->assertFalse($this->instance->hasKey('1_value1'));
index 00be005d08d307de576237123ab2857390996782..47b18e5b9f42f7186b82b896911aec5888328272 100644 (file)
@@ -39,7 +39,7 @@ class Test_Cache_File extends Test_Cache {
                
                //set up temporary storage
                OC_Filesystem::clearMounts();
-               OC_Filesystem::mount('OC_Filestorage_Temporary',array(),'/');
+               OC_Filesystem::mount('OC_Filestorage_Temporary', array(),'/');
 
                OC_User::clearBackends();
                OC_User::useBackend(new OC_User_Dummy());
index cae3d550b339dc47bdc066dde684acdf321fab55..d4951ee79e79bbe16862536019418cd1b1ec1d44 100644 (file)
@@ -8,7 +8,7 @@
 
 class Test_Geo extends UnitTestCase {
        function testTimezone() {
-               $result = OC_Geo::timezone(3,3);
+               $result = OC_Geo::timezone(3, 3);
                $expected = 'Africa/Porto-Novo';
                $this->assertEquals($expected, $result);
 
index 0bea9a008868f2123d7932d2d712f863121d8a2b..9ad397b94a6d8148d8089b38e8bc68568237179d 100644 (file)
@@ -36,19 +36,19 @@ class Test_Group extends UnitTestCase {
                $user1=uniqid();
                $user2=uniqid();
 
-               $this->assertFalse(OC_Group::inGroup($user1,$group1));
-               $this->assertFalse(OC_Group::inGroup($user2,$group1));
-               $this->assertFalse(OC_Group::inGroup($user1,$group2));
-               $this->assertFalse(OC_Group::inGroup($user2,$group2));
+               $this->assertFalse(OC_Group::inGroup($user1, $group1));
+               $this->assertFalse(OC_Group::inGroup($user2, $group1));
+               $this->assertFalse(OC_Group::inGroup($user1, $group2));
+               $this->assertFalse(OC_Group::inGroup($user2, $group2));
 
-               $this->assertTrue(OC_Group::addToGroup($user1,$group1));
+               $this->assertTrue(OC_Group::addToGroup($user1, $group1));
 
-               $this->assertTrue(OC_Group::inGroup($user1,$group1));
-               $this->assertFalse(OC_Group::inGroup($user2,$group1));
-               $this->assertFalse(OC_Group::inGroup($user1,$group2));
-               $this->assertFalse(OC_Group::inGroup($user2,$group2));
+               $this->assertTrue(OC_Group::inGroup($user1, $group1));
+               $this->assertFalse(OC_Group::inGroup($user2, $group1));
+               $this->assertFalse(OC_Group::inGroup($user1, $group2));
+               $this->assertFalse(OC_Group::inGroup($user2, $group2));
 
-               $this->assertFalse(OC_Group::addToGroup($user1,$group1));
+               $this->assertFalse(OC_Group::addToGroup($user1, $group1));
 
                $this->assertEqual(array($user1),OC_Group::usersInGroup($group1));
                $this->assertEqual(array(),OC_Group::usersInGroup($group2));
@@ -59,7 +59,7 @@ class Test_Group extends UnitTestCase {
                OC_Group::deleteGroup($group1);
                $this->assertEqual(array(),OC_Group::getUserGroups($user1));
                $this->assertEqual(array(),OC_Group::usersInGroup($group1));
-               $this->assertFalse(OC_Group::inGroup($user1,$group1));
+               $this->assertFalse(OC_Group::inGroup($user1, $group1));
        }
 
        function testMultiBackend() {
@@ -73,8 +73,8 @@ class Test_Group extends UnitTestCase {
                OC_Group::createGroup($group1);
 
                //groups should be added to the first registered backend
-               $this->assertEqual(array($group1),$backend1->getGroups());
-               $this->assertEqual(array(),$backend2->getGroups());
+               $this->assertEqual(array($group1), $backend1->getGroups());
+               $this->assertEqual(array(), $backend2->getGroups());
 
                $this->assertEqual(array($group1),OC_Group::getGroups());
                $this->assertTrue(OC_Group::groupExists($group1));
@@ -82,24 +82,24 @@ class Test_Group extends UnitTestCase {
 
                $backend1->createGroup($group2);
 
-               $this->assertEqual(array($group1,$group2),OC_Group::getGroups());
+               $this->assertEqual(array($group1, $group2),OC_Group::getGroups());
                $this->assertTrue(OC_Group::groupExists($group1));
                $this->assertTrue(OC_Group::groupExists($group2));
 
                $user1=uniqid();
                $user2=uniqid();
 
-               $this->assertFalse(OC_Group::inGroup($user1,$group1));
-               $this->assertFalse(OC_Group::inGroup($user2,$group1));
+               $this->assertFalse(OC_Group::inGroup($user1, $group1));
+               $this->assertFalse(OC_Group::inGroup($user2, $group1));
 
 
-               $this->assertTrue(OC_Group::addToGroup($user1,$group1));
+               $this->assertTrue(OC_Group::addToGroup($user1, $group1));
 
-               $this->assertTrue(OC_Group::inGroup($user1,$group1));
-               $this->assertFalse(OC_Group::inGroup($user2,$group1));
-               $this->assertFalse($backend2->inGroup($user1,$group1));
+               $this->assertTrue(OC_Group::inGroup($user1, $group1));
+               $this->assertFalse(OC_Group::inGroup($user2, $group1));
+               $this->assertFalse($backend2->inGroup($user1, $group1));
 
-               $this->assertFalse(OC_Group::addToGroup($user1,$group1));
+               $this->assertFalse(OC_Group::addToGroup($user1, $group1));
 
                $this->assertEqual(array($user1),OC_Group::usersInGroup($group1));
 
@@ -109,6 +109,6 @@ class Test_Group extends UnitTestCase {
                OC_Group::deleteGroup($group1);
                $this->assertEqual(array(),OC_Group::getUserGroups($user1));
                $this->assertEqual(array(),OC_Group::usersInGroup($group1));
-               $this->assertFalse(OC_Group::inGroup($user1,$group1));
+               $this->assertFalse(OC_Group::inGroup($user1, $group1));
        }
 }
index 61e008b6ca5e2ebddc9f03d094ba335cbf94e8fa..f61abed5f297fa1ee111319be94338e5ac9f9c02 100644 (file)
@@ -52,20 +52,20 @@ abstract class Test_Group_Backend extends UnitTestCase {
                $name2=$this->getGroupName();
                $this->backend->createGroup($name1);
                $count=count($this->backend->getGroups())-$startCount;
-               $this->assertEqual(1,$count);
-               $this->assertTrue((array_search($name1,$this->backend->getGroups())!==false));
-               $this->assertFalse((array_search($name2,$this->backend->getGroups())!==false));
+               $this->assertEqual(1, $count);
+               $this->assertTrue((array_search($name1, $this->backend->getGroups())!==false));
+               $this->assertFalse((array_search($name2, $this->backend->getGroups())!==false));
                $this->backend->createGroup($name2);
                $count=count($this->backend->getGroups())-$startCount;
-               $this->assertEqual(2,$count);
-               $this->assertTrue((array_search($name1,$this->backend->getGroups())!==false));
-               $this->assertTrue((array_search($name2,$this->backend->getGroups())!==false));
+               $this->assertEqual(2, $count);
+               $this->assertTrue((array_search($name1, $this->backend->getGroups())!==false));
+               $this->assertTrue((array_search($name2, $this->backend->getGroups())!==false));
 
                $this->backend->deleteGroup($name2);
                $count=count($this->backend->getGroups())-$startCount;
-               $this->assertEqual(1,$count);
-               $this->assertTrue((array_search($name1,$this->backend->getGroups())!==false));
-               $this->assertFalse((array_search($name2,$this->backend->getGroups())!==false));
+               $this->assertEqual(1, $count);
+               $this->assertTrue((array_search($name1, $this->backend->getGroups())!==false));
+               $this->assertFalse((array_search($name2, $this->backend->getGroups())!==false));
        }
 
        public function testUser() {
@@ -77,29 +77,29 @@ abstract class Test_Group_Backend extends UnitTestCase {
                $user1=$this->getUserName();
                $user2=$this->getUserName();
 
-               $this->assertFalse($this->backend->inGroup($user1,$group1));
-               $this->assertFalse($this->backend->inGroup($user2,$group1));
-               $this->assertFalse($this->backend->inGroup($user1,$group2));
-               $this->assertFalse($this->backend->inGroup($user2,$group2));
+               $this->assertFalse($this->backend->inGroup($user1, $group1));
+               $this->assertFalse($this->backend->inGroup($user2, $group1));
+               $this->assertFalse($this->backend->inGroup($user1, $group2));
+               $this->assertFalse($this->backend->inGroup($user2, $group2));
 
-               $this->assertTrue($this->backend->addToGroup($user1,$group1));
+               $this->assertTrue($this->backend->addToGroup($user1, $group1));
 
-               $this->assertTrue($this->backend->inGroup($user1,$group1));
-               $this->assertFalse($this->backend->inGroup($user2,$group1));
-               $this->assertFalse($this->backend->inGroup($user1,$group2));
-               $this->assertFalse($this->backend->inGroup($user2,$group2));
+               $this->assertTrue($this->backend->inGroup($user1, $group1));
+               $this->assertFalse($this->backend->inGroup($user2, $group1));
+               $this->assertFalse($this->backend->inGroup($user1, $group2));
+               $this->assertFalse($this->backend->inGroup($user2, $group2));
                
-               $this->assertFalse($this->backend->addToGroup($user1,$group1));
+               $this->assertFalse($this->backend->addToGroup($user1, $group1));
 
-               $this->assertEqual(array($user1),$this->backend->usersInGroup($group1));
-               $this->assertEqual(array(),$this->backend->usersInGroup($group2));
+               $this->assertEqual(array($user1), $this->backend->usersInGroup($group1));
+               $this->assertEqual(array(), $this->backend->usersInGroup($group2));
 
-               $this->assertEqual(array($group1),$this->backend->getUserGroups($user1));
-               $this->assertEqual(array(),$this->backend->getUserGroups($user2));
+               $this->assertEqual(array($group1), $this->backend->getUserGroups($user1));
+               $this->assertEqual(array(), $this->backend->getUserGroups($user2));
 
                $this->backend->deleteGroup($group1);
-               $this->assertEqual(array(),$this->backend->getUserGroups($user1));
-               $this->assertEqual(array(),$this->backend->usersInGroup($group1));
-               $this->assertFalse($this->backend->inGroup($user1,$group1));
+               $this->assertEqual(array(), $this->backend->getUserGroups($user1));
+               $this->assertEqual(array(), $this->backend->usersInGroup($group1));
+               $this->assertFalse($this->backend->inGroup($user1, $group1));
        }
 }
index 46838ff9754656bea65ad0547c48468135e7a848..f864a9e3611c51facb55b80e99a92cc398f42acc 100644 (file)
@@ -30,16 +30,16 @@ class Test_StreamWrappers extends UnitTestCase {
                        $result[]=$file;
                        $this->assertContains($file, $items);
                }
-               $this->assertEqual(count($items),count($result));
+               $this->assertEqual(count($items), count($result));
        }
 
        public function testStaticStream() {
                $sourceFile=OC::$SERVERROOT.'/tests/data/lorem.txt';
                $staticFile='static://test';
                $this->assertFalse(file_exists($staticFile));
-               file_put_contents($staticFile,file_get_contents($sourceFile));
+               file_put_contents($staticFile, file_get_contents($sourceFile));
                $this->assertTrue(file_exists($staticFile));
-               $this->assertEqual(file_get_contents($sourceFile),file_get_contents($staticFile));
+               $this->assertEqual(file_get_contents($sourceFile), file_get_contents($staticFile));
                unlink($staticFile);
                clearstatcache();
                $this->assertFalse(file_exists($staticFile));
@@ -51,8 +51,8 @@ class Test_StreamWrappers extends UnitTestCase {
                $tmpFile=OC_Helper::TmpFile('.txt');
                $file='close://'.$tmpFile;
                $this->assertTrue(file_exists($file));
-               file_put_contents($file,file_get_contents($sourceFile));
-               $this->assertEqual(file_get_contents($sourceFile),file_get_contents($file));
+               file_put_contents($file, file_get_contents($sourceFile));
+               $this->assertEqual(file_get_contents($sourceFile), file_get_contents($file));
                unlink($file);
                clearstatcache();
                $this->assertFalse(file_exists($file));
@@ -68,7 +68,7 @@ class Test_StreamWrappers extends UnitTestCase {
                        $this->fail('Expected exception');
                }catch(Exception $e) {
                        $path=$e->getMessage();
-                       $this->assertEqual($path,$tmpFile);
+                       $this->assertEqual($path, $tmpFile);
                }
        }
 
index c69c1bad51264a66ea21d2c499a874d90978c047..eb3aa91b683f4766e79d977b66becc8524c0b0b6 100644 (file)
@@ -53,20 +53,20 @@ abstract class Test_User_Backend extends UnitTestCase {
                $name2=$this->getUser();
                $this->backend->createUser($name1,'');
                $count=count($this->backend->getUsers())-$startCount;
-               $this->assertEqual(1,$count);
-               $this->assertTrue((array_search($name1,$this->backend->getUsers())!==false));
-               $this->assertFalse((array_search($name2,$this->backend->getUsers())!==false));
+               $this->assertEqual(1, $count);
+               $this->assertTrue((array_search($name1, $this->backend->getUsers())!==false));
+               $this->assertFalse((array_search($name2, $this->backend->getUsers())!==false));
                $this->backend->createUser($name2,'');
                $count=count($this->backend->getUsers())-$startCount;
-               $this->assertEqual(2,$count);
-               $this->assertTrue((array_search($name1,$this->backend->getUsers())!==false));
-               $this->assertTrue((array_search($name2,$this->backend->getUsers())!==false));
+               $this->assertEqual(2, $count);
+               $this->assertTrue((array_search($name1, $this->backend->getUsers())!==false));
+               $this->assertTrue((array_search($name2, $this->backend->getUsers())!==false));
 
                $this->backend->deleteUser($name2);
                $count=count($this->backend->getUsers())-$startCount;
-               $this->assertEqual(1,$count);
-               $this->assertTrue((array_search($name1,$this->backend->getUsers())!==false));
-               $this->assertFalse((array_search($name2,$this->backend->getUsers())!==false));
+               $this->assertEqual(1, $count);
+               $this->assertTrue((array_search($name1, $this->backend->getUsers())!==false));
+               $this->assertFalse((array_search($name2, $this->backend->getUsers())!==false));
        }
        
        public function testLogin() {