]> source.dussan.org Git - nextcloud-server.git/commitdiff
Checkstyle fixes: NoSpaceAfterComma
authorFelix Moeller <mail@felixmoeller.de>
Sun, 4 Nov 2012 10:10:46 +0000 (11:10 +0100)
committerFelix Moeller <mail@felixmoeller.de>
Sun, 4 Nov 2012 10:10:46 +0000 (11:10 +0100)
84 files changed:
apps/files/ajax/autocomplete.php
apps/files/ajax/upload.php
apps/files/appinfo/filesync.php
apps/files/appinfo/remote.php
apps/files/appinfo/update.php
apps/files/index.php
apps/files/templates/admin.php
apps/files/templates/index.php
apps/files/templates/part.breadcrumb.php
apps/files/templates/part.list.php
apps/files_encryption/appinfo/app.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/ftp.php
apps/files_external/lib/google.php
apps/files_external/lib/streamwrapper.php
apps/files_external/lib/swift.php
apps/files_external/lib/webdav.php
apps/files_versions/appinfo/app.php
apps/files_versions/history.php
apps/files_versions/lib/versions.php
apps/files_versions/settings-personal.php
apps/user_ldap/group_ldap.php
apps/user_ldap/lib/connection.php
apps/user_ldap/settings.php
apps/user_ldap/tests/group_ldap.php
apps/user_webdavauth/appinfo/app.php
core/templates/installation.php
lib/MDB2/Driver/sqlite3.php
lib/app.php
lib/archive/tar.php
lib/archive/zip.php
lib/base.php
lib/connector/sabre/file.php
lib/connector/sabre/locks.php
lib/connector/sabre/node.php
lib/db.php
lib/filecache.php
lib/filecache/update.php
lib/fileproxy.php
lib/fileproxy/quota.php
lib/files.php
lib/filestorage.php
lib/filestorage/common.php
lib/filestorage/local.php
lib/filesystem.php
lib/filesystemview.php
lib/image.php
lib/installer.php
lib/json.php
lib/l10n.php
lib/log/owncloud.php
lib/mail.php
lib/migrate.php
lib/migration/content.php
lib/ocsclient.php
lib/request.php
lib/route.php
lib/search.php
lib/setup.php
lib/streamwrappers.php
lib/template.php
lib/templatelayout.php
lib/updater.php
lib/user.php
lib/user/database.php
lib/user/http.php
lib/util.php
lib/vcategories.php
settings/admin.php
settings/ajax/setquota.php
settings/personal.php
settings/templates/admin.php
tests/lib/archive.php
tests/lib/cache.php
tests/lib/cache/file.php
tests/lib/group.php
tests/lib/streamwrappers.php
tests/lib/user/backend.php

index fae38368a85fc0705871090e49442fc9c8bc0e73..b32ba7c3d5bd620b87571e8b158176bebf283e3e 100644 (file)
@@ -44,7 +44,7 @@ if(OC_Filesystem::file_exists($base) and OC_Filesystem::is_dir($base)) {
                                if(substr(strtolower($file), 0, $queryLen)==$query) {
                                        $item=$base.$file;
                                        if((!$dirOnly or OC_Filesystem::is_dir($item))) {
-                                               $files[]=(object)array('id'=>$item,'label'=>$item,'name'=>$item);
+                                               $files[]=(object)array('id'=>$item, 'label'=>$item, 'name'=>$item);
                                        }
                                }
                        }
index 7a69154677fd77b75768ae379abebe11bb045d9e..4ed0bbc5b0f93f00e9c6e30b9eb80b86b06afc09 100644 (file)
@@ -51,7 +51,7 @@ if(strpos($dir, '..') === false) {
                if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) {
                        $meta = OC_FileCache::get($target);
                        $id = OC_FileCache::getId($target);
-                       $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target));
+                       $result[]=array( "status" => "success", 'mime'=>$meta['mimetype'], 'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target));
                }
        }
        OCP\JSON::encodedPrint($result);
index dfafe3f95618e5c50ebefbf5ecfe3f58dfce7dc2..0e368cb0f42dbe6faabda41cd6b49bbf5aff1b2e 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 // load needed apps
-$RUNTIME_APPTYPES=array('filesystem','authentication','logging');
+$RUNTIME_APPTYPES=array('filesystem', 'authentication', 'logging');
 OC_App::loadApps($RUNTIME_APPTYPES);
 if(!OC_User::isLoggedIn()) {
         if(!isset($_SERVER['PHP_AUTH_USER'])) {
@@ -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 f12430f24ddcf115850da375593dfec116543be3..400a978fb17620996c370951a8b758f9d0a1cfea 100644 (file)
@@ -23,7 +23,7 @@
  *
  */
 // load needed apps
-$RUNTIME_APPTYPES=array('filesystem','authentication','logging');
+$RUNTIME_APPTYPES=array('filesystem', 'authentication', 'logging');
 
 OC_App::loadApps($RUNTIME_APPTYPES);
 
index 3c63ad3c7cee6ec86870def60b41fa9c7b26cfe5..738864d7cff515cf5077f3e157b5b6366e7e6bcb 100644 (file)
@@ -39,7 +39,7 @@ foreach($filesToRemove as $file) {
     $success = OCP\Files::rmdirr($filepath);
     if($success === false) {
                //probably not sufficient privileges, give up and give a message.
-               OCP\Util::writeLog('files','Could not clean /files/ directory. Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR);
+               OCP\Util::writeLog('files', 'Could not clean /files/ directory. Please remove everything except webdav.php from ' . OC::$SERVERROOT . '/files/', OCP\Util::ERROR);
                break;
     }
 }
index 51fe6b0379c093f73395295fe230e9758863931a..c46ec59d03c22a84742360f5959e68a755c65fba 100644 (file)
@@ -67,7 +67,7 @@ $breadcrumb = array();
 $pathtohere = '';
 foreach( explode( '/', $dir ) as $i ) {
        if( $i != '' ) {
-               $pathtohere .= '/'.str_replace('+','%20', urlencode($i));
+               $pathtohere .= '/'.str_replace('+', '%20', urlencode($i));
                $breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $i );
        }
 }
index 5869ed21072f26a9604f470d21517b084be5cfcb..a60a1cebaf934e386e5176458422f45351b94826 100644 (file)
@@ -1,4 +1,4 @@
-<?php OCP\Util::addscript('files','admin'); ?>
+<?php OCP\Util::addscript('files', 'admin'); ?>
 
 <form name="filesForm" action='#' method='post'>
        <fieldset class="personalblock">
index 7cdff024ddf4b23e2c4f0309f118fd9efa834218..e2640c1113cf9d72f63661fff24a50e9b551bf73 100644 (file)
@@ -8,7 +8,7 @@
                                <ul class="popup popupTop">
                                        <li style="background-image:url('<?php echo OCP\mimetype_icon('text/plain') ?>')" data-type='file'><p><?php echo $l->t('Text file');?></p></li>
                                        <li style="background-image:url('<?php echo OCP\mimetype_icon('dir') ?>')" data-type='folder'><p><?php echo $l->t('Folder');?></p></li>
-                                       <li style="background-image:url('<?php echo OCP\image_path('core','actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From link');?></p></li>
+                                       <li style="background-image:url('<?php echo OCP\image_path('core', 'actions/public.png') ?>')" data-type='web'><p><?php echo $l->t('From link');?></p></li>
                                </ul>
                        </div>
                        <div class="file_upload_wrapper svg">
index 71b695f65f8198e57b2b15d8d486391ff3862b84..ead9ab1ed7d4c37aa4e335e4fbbebc5ffd899f23 100644 (file)
@@ -1,6 +1,6 @@
        <?php for($i=0; $i<count($_["breadcrumb"]); $i++):
         $crumb = $_["breadcrumb"][$i]; ?>
-               <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
+               <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core', 'breadcrumb.png');?>")'>
                <a href="<?php echo $_['baseURL'].urlencode($crumb["dir"]); ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
                </div>
        <?php endfor;?>
index aaf9c5f57eee5e25c1442c7c1fbe8de5de107d5c..4b5ac325672922ac585478d2f1ad4e07ef04fabc 100644 (file)
                        $relative_modified_date = OCP\relative_modified_date($file['mtime']);
                        $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
                        if($relative_date_color>200) $relative_date_color = 200;
-                       $name = str_replace('+','%20', urlencode($file['name']));
-                       $name = str_replace('%2F','/', $name);
-                       $directory = str_replace('+','%20', urlencode($file['directory']));
-                       $directory = str_replace('%2F','/', $directory); ?>
+                       $name = str_replace('+', '%20', urlencode($file['name']));
+                       $name = str_replace('%2F', '/', $name);
+                       $directory = str_replace('+', '%20', urlencode($file['directory']));
+                       $directory = str_replace('%2F', '/', $directory); ?>
                        <tr data-id="<?php echo $file['id']; ?>" data-file="<?php echo $name;?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mimetype']?>" data-size='<?php echo $file['size'];?>' data-permissions='<?php echo $file['permissions']; ?>'>
                                <td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo OCP\mimetype_icon('dir'); else echo OCP\mimetype_icon($file['mimetype']); ?>)">
                                        <?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
index bb130a366beb41e1976f57c1e66c2de042b121b8..3f76e910a52b4a927562b7a191da3813d59dbbd8 100644 (file)
@@ -6,9 +6,9 @@ OC::$CLASSPATH['OC_FileProxy_Encryption'] = 'apps/files_encryption/lib/proxy.php
 
 OC_FileProxy::register(new OC_FileProxy_Encryption());
 
-OCP\Util::connectHook('OC_User','post_login','OC_Crypt','loginListener');
+OCP\Util::connectHook('OC_User', 'post_login', 'OC_Crypt', 'loginListener');
 
-stream_wrapper_register('crypt','OC_CryptStream');
+stream_wrapper_register('crypt', 'OC_CryptStream');
 
 if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()) {//force the user to re-loggin if the encryption key isn't unlocked (happens when a user is logged in before the encryption app is enabled)
        OCP\User::logout();
index d8e7e4d1dd92f6a5857739c03cc7d00819083177..5ff3f578384e22138d6a51a9a24b22a8fc24af98 100644 (file)
@@ -80,7 +80,7 @@ class OC_Crypt {
                }
        }
 
-       public static function createkey($username,$passcode) {
+       public static function createkey($username, $passcode) {
                // generate a random key
                $key=mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999).mt_rand(10000, 99999);
 
index 3170cff366c6eb255b1557f0498e1fd4710124b9..8b05560050def1af403ef66eabe1d5aa498ae9ec 100644 (file)
@@ -23,7 +23,7 @@
 /**
  * transparently encrypted filestream
  *
- * you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path,'stream'=>$stream)
+ * you can use it as wrapper around an existing stream by setting OC_CryptStream::$sourceStreams['foo']=array('path'=>$path, 'stream'=>$stream)
  *   and then fopen('crypt://streams/foo');
  */
 
@@ -123,11 +123,11 @@ class OC_CryptStream{
                                $data=substr($data, 8192);
                        }
                }
-               $this->size=max($this->size,$currentPos+$length);
+               $this->size=max($this->size, $currentPos+$length);
                return $length;
        }
 
-       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);
index fed6acaf91b58097e77c9aa0ce805e27be4b4eb9..cacf7d7920aabf5814e79bbc8868c59bb2b248cc 100644 (file)
@@ -36,7 +36,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
         */
        private static function shouldEncrypt($path) {
                if(is_null(self::$enableEncryption)) {
-                       self::$enableEncryption=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');
+                       self::$enableEncryption=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true');
                }
                if(!self::$enableEncryption) {
                        return false;
@@ -59,7 +59,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
         * @return bool
         */
        private static function isEncrypted($path) {
-               $metadata=OC_FileCache_Cached::get($path,'');
+               $metadata=OC_FileCache_Cached::get($path, '');
                return isset($metadata['encrypted']) and (bool)$metadata['encrypted'];
        }
 
@@ -68,14 +68,14 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
                        if (!is_resource($data)) {//stream put contents should have been converter to fopen
                                $size=strlen($data);
                                $data=OC_Crypt::blockEncrypt($data);
-                               OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size),'');
+                               OC_FileCache::put($path, array('encrypted'=>true,'size'=>$size), '');
                        }
                }
        }
 
-       public function postFile_get_contents($path,$data) {
+       public function postFile_get_contents($path, $data) {
                if(self::isEncrypted($path)) {
-                       $cached=OC_FileCache_Cached::get($path,'');
+                       $cached=OC_FileCache_Cached::get($path, '');
                        $data=OC_Crypt::blockDecrypt($data, '', $cached['size']);
                }
                return $data;
@@ -92,7 +92,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
                }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);
+                               OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing', OCP\Util::DEBUG);
                                $tmp=fopen('php://temp');
                                OCP\Files::streamCopy($result, $tmp);
                                fclose($result);
@@ -106,14 +106,14 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
 
        public function postGetMimeType($path, $mime) {
                if(self::isEncrypted($path)) {
-                       $mime=OCP\Files::getMimeType('crypt://'.$path,'w');
+                       $mime=OCP\Files::getMimeType('crypt://'.$path, 'w');
                }
                return $mime;
        }
 
        public function postStat($path, $data) {
                if(self::isEncrypted($path)) {
-                       $cached=OC_FileCache_Cached::get($path,'');
+                       $cached=OC_FileCache_Cached::get($path, '');
                        $data['size']=$cached['size'];
                }
                return $data;
@@ -121,7 +121,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
 
        public function postFileSize($path, $size) {
                if(self::isEncrypted($path)) {
-                       $cached=OC_FileCache_Cached::get($path,'');
+                       $cached=OC_FileCache_Cached::get($path, '');
                        return  $cached['size'];
                }else{
                        return $size;
index ab9324dee44dec614dbe843db127b14008d77d75..ae28b088cd60b3d8d8e07088f3292d8816e61cb3 100644 (file)
@@ -8,11 +8,11 @@
 
 $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');
+$enabled=(OCP\Config::getAppValue('files_encryption', 'enable_encryption', 'true')=='true');
 $tmpl->assign('blacklist', $blackList);
 $tmpl->assign('encryption_enabled', $enabled);
 
-OCP\Util::addscript('files_encryption','settings');
-OCP\Util::addscript('core','multiselect');
+OCP\Util::addscript('files_encryption', 'settings');
+OCP\Util::addscript('core', 'multiselect');
 
 return $tmpl->fetchPage();
index b714b00b8f280ac45b595181c469a2a19e44e320..0e119f55bea1b6c4cd2b88cd3829eb046259b330 100644 (file)
@@ -17,7 +17,7 @@ class Test_Encryption extends UnitTestCase {
                $this->assertNotEqual($encrypted, $source);
                $this->assertEqual($decrypted, $source);
 
-               $chunk=substr($source,0, 8192);
+               $chunk=substr($source, 0, 8192);
                $encrypted=OC_Crypt::encrypt($chunk, $key);
                $this->assertEqual(strlen($chunk), strlen($encrypted));
                $decrypted=OC_Crypt::decrypt($encrypted, $key);
@@ -30,14 +30,14 @@ class Test_Encryption extends UnitTestCase {
                $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);
 
                $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);
 
index 25427ff4b97e104eb30d59588d471deed6b79314..1c800bbc5f62f6fac0127f663021e7e0c4950a4c 100644 (file)
@@ -13,8 +13,8 @@ class Test_CryptProxy extends UnitTestCase {
        public function setUp() {
                $user=OC_User::getUser();
 
-               $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption','true');
-               OCP\Config::setAppValue('files_encryption','enable_encryption','true');
+               $this->oldConfig=OCP\Config::getAppValue('files_encryption','enable_encryption', 'true');
+               OCP\Config::setAppValue('files_encryption', 'enable_encryption', 'true');
                $this->oldKey=isset($_SESSION['enckey'])?$_SESSION['enckey']:null;
 
 
@@ -30,7 +30,7 @@ class Test_CryptProxy extends UnitTestCase {
 
                //set up temporary storage
                OC_Filesystem::clearMounts();
-               OC_Filesystem::mount('OC_Filestorage_Temporary', array(),'/');
+               OC_Filesystem::mount('OC_Filestorage_Temporary', array(), '/');
 
                OC_Filesystem::init('/'.$user.'/files');
 
index 2caebf912ed64c9b9db21203b8001f30456395c1..67b5e98ae670ad5dd77b001e2d1a091a39b5058a 100644 (file)
@@ -10,23 +10,23 @@ class Test_CryptStream extends UnitTestCase {
        private $tmpFiles=array();
 
        function testStream() {
-               $stream=$this->getStream('test1','w', strlen('foobar'));
-               fwrite($stream,'foobar');
+               $stream=$this->getStream('test1', 'w', strlen('foobar'));
+               fwrite($stream, 'foobar');
                fclose($stream);
 
-               $stream=$this->getStream('test1','r', strlen('foobar'));
+               $stream=$this->getStream('test1', 'r', strlen('foobar'));
                $data=fread($stream, 6);
                fclose($stream);
                $this->assertEqual('foobar', $data);
 
                $file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
-               $source=fopen($file,'r');
+               $source=fopen($file, 'r');
                $target=$this->getStream('test2', 'w', 0);
                OCP\Files::streamCopy($source, $target);
                fclose($target);
                fclose($source);
 
-               $stream=$this->getStream('test2','r', filesize($file));
+               $stream=$this->getStream('test2', 'r', filesize($file));
                $data=stream_get_contents($stream);
                $original=file_get_contents($file);
                $this->assertEqual(strlen($original), strlen($data));
@@ -51,7 +51,7 @@ class Test_CryptStream extends UnitTestCase {
                        $file=$this->tmpFiles[$id];
                }
                $stream=fopen($file, $mode);
-               OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size);
+               OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id, 'stream'=>$stream, 'size'=>$size);
                return fopen('crypt://streams/'.$id, $mode);
        }
 
@@ -59,11 +59,11 @@ class Test_CryptStream extends UnitTestCase {
                $file=__DIR__.'/binary';
                $source=file_get_contents($file);
 
-               $stream=$this->getStream('test','w', strlen($source));
+               $stream=$this->getStream('test', 'w', strlen($source));
                fwrite($stream, $source);
                fclose($stream);
 
-               $stream=$this->getStream('test','r', strlen($source));
+               $stream=$this->getStream('test', 'r', strlen($source));
                $data=stream_get_contents($stream);
                fclose($stream);
                $this->assertEqual(strlen($data), strlen($source));
@@ -72,11 +72,11 @@ class Test_CryptStream extends UnitTestCase {
                $file=__DIR__.'/zeros';
                $source=file_get_contents($file);
 
-               $stream=$this->getStream('test2','w', strlen($source));
+               $stream=$this->getStream('test2', 'w', strlen($source));
                fwrite($stream, $source);
                fclose($stream);
 
-               $stream=$this->getStream('test2','r', strlen($source));
+               $stream=$this->getStream('test2', 'r', strlen($source));
                $data=stream_get_contents($stream);
                fclose($stream);
                $this->assertEqual(strlen($data), strlen($source));
index 8a67b31b20b2dc42c06eb65d30794e0c98eca76e..2fc2a3a1a3714298cde7f7831151f052395c5f7f 100644 (file)
@@ -53,7 +53,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
                        case 'ab':
                                //these are supported by the wrapper
                                $context = stream_context_create(array('ftp' => array('overwrite' => true)));
-                               return fopen($this->constructUrl($path),$mode, false, $context);
+                               return fopen($this->constructUrl($path), $mode, false, $context);
                        case 'r+':
                        case 'w+':
                        case 'wb+':
@@ -63,13 +63,13 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
                        case 'c':
                        case 'c+':
                                //emulate these
-                               if(strrpos($path,'.')!==false) {
-                                       $ext=substr($path, strrpos($path,'.'));
+                               if(strrpos($path, '.')!==false) {
+                                       $ext=substr($path, strrpos($path, '.'));
                                }else{
                                        $ext='';
                                }
                                $tmpFile=OCP\Files::tmpFile($ext);
-                               OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
+                               OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
                                if($this->file_exists($path)) {
                                        $this->getFile($path, $tmpFile);
                                }
index 32d57ed3cef62f49cd46b0bed0350ece9538b572..e5de81280acac5590155641f89f9e250b7599c4d 100644 (file)
@@ -394,8 +394,8 @@ class OC_Filestorage_Google extends OC_Filestorage_Common {
                        case 'x+':
                        case 'c':
                        case 'c+':
-                               if (strrpos($path,'.') !== false) {
-                                       $ext = substr($path, strrpos($path,'.'));
+                               if (strrpos($path, '.') !== false) {
+                                       $ext = substr($path, strrpos($path, '.'));
                                } else {
                                        $ext = '';
                                }
index 7961ecbe1b7788451371776e84f4c91175c7237d..b66a0f0ee1bf5c3ec344992bc03318ccf28d51e5 100644 (file)
@@ -60,8 +60,8 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{
 
        public function touch($path, $mtime=null) {
                if(is_null($mtime)) {
-                       $fh=$this->fopen($path,'a');
-                       fwrite($fh,'');
+                       $fh=$this->fopen($path, 'a');
+                       fwrite($fh, '');
                        fclose($fh);
                }else{
                        return false;//not supported
index c04de45d404cdea96a5eee7f488baf24da8d2401..2f0076706e4b3b2ca055ca74522626629a949f25 100644 (file)
@@ -39,7 +39,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
         * @return string
         */
        private function getContainerName($path) {
-               $path=trim(trim($this->root,'/')."/".$path,'/.');
+               $path=trim(trim($this->root, '/')."/".$path, '/.');
                return str_replace('/', '\\', $path);
        }
 
@@ -205,7 +205,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
                                unlink($tmpFile);
                                return false;
                        }else{
-                               $fh=fopen($tmpFile,'a');
+                               $fh=fopen($tmpFile, 'a');
                                fwrite($fh, $name."\n");
                        }
                }catch(Exception $e) {
@@ -432,7 +432,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
                        case 'c':
                        case 'c+':
                                $tmpFile=$this->getTmpFile($path);
-                               OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
+                               OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
                                self::$tempFiles[$tmpFile]=$path;
                                return fopen('close://'.$tmpFile, $mode);
                }
index 3d2ea7fa2a289daab89a257ffd15021439b77bab..2503fb80b1b0cfbfad2dd2dfc05a3b451d4c747b 100644 (file)
@@ -252,7 +252,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
        public function stat($path) {
                $path=$this->cleanPath($path);
                try{
-                       $response=$this->client->propfind($path, array('{DAV:}getlastmodified','{DAV:}getcontentlength'));
+                       $response=$this->client->propfind($path, array('{DAV:}getlastmodified', '{DAV:}getcontentlength'));
                        return array(
                                'mtime'=>strtotime($response['{DAV:}getlastmodified']),
                                'size'=>(int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0,
@@ -266,7 +266,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
        public function getMimeType($path) {
                $path=$this->cleanPath($path);
                try{
-                       $response=$this->client->propfind($path, array('{DAV:}getcontenttype','{DAV:}resourcetype'));
+                       $response=$this->client->propfind($path, array('{DAV:}getcontenttype', '{DAV:}resourcetype'));
                        $responseType=$response["{DAV:}resourcetype"]->resourceType;
                        $type=(count($responseType)>0 and $responseType[0]=="{DAV:}collection")?'dir':'file';
                        if($type=='dir') {
index 746f89a81391dba71f0bd44020bbd8cae4bf23ba..599d302e6e4b5a820457cd8798cd408d3c44a3ac 100644 (file)
@@ -5,7 +5,7 @@ OC::$CLASSPATH['OCA_Versions\Storage'] = 'apps/files_versions/lib/versions.php';
 OC::$CLASSPATH['OCA_Versions\Hooks'] = 'apps/files_versions/lib/hooks.php';
 
 OCP\App::registerAdmin('files_versions', 'settings');
-OCP\App::registerPersonal('files_versions','settings-personal');
+OCP\App::registerPersonal('files_versions', 'settings-personal');
 
 OCP\Util::addscript('files_versions', 'versions');
 
index 0ebb34f45e49cfebb6ca3cff2a943c9d0758fec6..deff735cedca9c994016119f70c8b23f1b757cc4 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 OCP\User::checkLoggedIn( );
-OCP\Util::addStyle('files_versions','versions');
+OCP\Util::addStyle('files_versions', 'versions');
 $tmpl = new OCP\Template( 'files_versions', 'history', 'user' );
 
 if ( isset( $_GET['path'] ) ) {
index 8ee147d085420b0dae1e4e0b5fb0d173c17bc6cf..8f807187467e0d3b26312ad3ad9a122a5e067124 100644 (file)
@@ -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
index 4fb866bd999462979b7c1be5c2e40f65ebe13982..6555bc99c3e193250255c47ab38d34688e89b399 100644 (file)
@@ -2,6 +2,6 @@
 
 $tmpl = new OCP\Template( 'files_versions', 'settings-personal');
 
-OCP\Util::addscript('files_versions','settings-personal');
+OCP\Util::addscript('files_versions', 'settings-personal');
 
 return $tmpl->fetchPage();
index 6c6cc5679ba434efe92f9db9aecc782cb48c8e3a..63437310088298b2801f9f1e6bfb78a0f1bb1a88 100644 (file)
@@ -124,7 +124,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
                        $this->connection->ldapGroupFilter,
                        $this->connection->ldapGroupMemberAssocAttr.'='.$uid
                ));
-               $groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName,'dn'));
+               $groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName, 'dn'));
                $groups = array_unique($this->ownCloudGroupNames($groups), SORT_LOCALE_STRING);
                $this->connection->writeToCache($cacheKey, $groups);
 
index 74ff55355b21ec0d9499a9b20384b97eaa7ae62d..ef92bbad40a171001cdff478896b373a17284e8c 100644 (file)
@@ -180,13 +180,13 @@ class Connection {
         * Caches the general LDAP configuration.
         */
        private function readConfiguration($force = false) {
-               \OCP\Util::writeLog('user_ldap','Checking conf state: isConfigured? '.print_r($this->configured, true).' isForce? '.print_r($force, true).' configID? '.print_r($this->configID, true), \OCP\Util::DEBUG);
+               \OCP\Util::writeLog('user_ldap', 'Checking conf state: isConfigured? '.print_r($this->configured, true).' isForce? '.print_r($force, true).' configID? '.print_r($this->configID, true), \OCP\Util::DEBUG);
                if((!$this->configured || $force) && !is_null($this->configID)) {
-                       \OCP\Util::writeLog('user_ldap','Reading the configuration', \OCP\Util::DEBUG);
+                       \OCP\Util::writeLog('user_ldap', 'Reading the configuration', \OCP\Util::DEBUG);
                        $this->config['ldapHost']              = \OCP\Config::getAppValue($this->configID, 'ldap_host', '');
                        $this->config['ldapPort']              = \OCP\Config::getAppValue($this->configID, 'ldap_port', 389);
-                       $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['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['ldapBaseGroups']        = \OCP\Config::getAppValue($this->configID, 'ldap_base_groups', $this->config['ldapBase']);
@@ -194,8 +194,8 @@ class Connection {
                        $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');
-                       $this->config['ldapUserFilter']        = \OCP\Config::getAppValue($this->configID, 'ldap_userlist_filter','objectClass=person');
-                       $this->config['ldapGroupFilter']       = \OCP\Config::getAppValue($this->configID, 'ldap_group_filter','(objectClass=posixGroup)');
+                       $this->config['ldapUserFilter']        = \OCP\Config::getAppValue($this->configID, 'ldap_userlist_filter', 'objectClass=person');
+                       $this->config['ldapGroupFilter']       = \OCP\Config::getAppValue($this->configID, 'ldap_group_filter', '(objectClass=posixGroup)');
                        $this->config['ldapLoginFilter']       = \OCP\Config::getAppValue($this->configID, 'ldap_login_filter', '(uid=%uid)');
                        $this->config['ldapGroupDisplayName']  = mb_strtolower(\OCP\Config::getAppValue($this->configID, 'ldap_group_display_name', 'uid'), 'UTF-8');
                        $this->config['ldapQuotaAttribute']    = \OCP\Config::getAppValue($this->configID, 'ldap_quota_attr', '');
@@ -263,7 +263,7 @@ class Connection {
                if(empty($this->config['ldapGroupFilter']) && empty($this->config['ldapGroupMemberAssocAttr'])) {
                        \OCP\Util::writeLog('user_ldap', 'No group filter is specified, LDAP group feature will not be used.', \OCP\Util::INFO);
                }
-               if(!in_array($this->config['ldapUuidAttribute'], array('auto','entryuuid', 'nsuniqueid', 'objectguid')) && (!is_null($this->configID))) {
+               if(!in_array($this->config['ldapUuidAttribute'], array('auto', 'entryuuid', 'nsuniqueid', 'objectguid')) && (!is_null($this->configID))) {
                        \OCP\Config::setAppValue($this->configID, 'ldap_uuid_attribute', 'auto');
                        \OCP\Util::writeLog('user_ldap', 'Illegal value for the UUID Attribute, reset to autodetect.', \OCP\Util::INFO);
                }
index f765151456a462ea3d1b4c653bc5f8f1737fe4e4..95bf6f1ed7dcd75db894e320989f4d442b19f75f 100644 (file)
@@ -31,7 +31,7 @@ if ($_POST) {
                        if('ldap_agent_password' == $param) {
                                OCP\Config::setAppValue('user_ldap', $param, base64_encode($_POST[$param]));
                        } elseif('ldap_cache_ttl' == $param) {
-                               if(OCP\Config::getAppValue('user_ldap', $param,'') != $_POST[$param]) {
+                               if(OCP\Config::getAppValue('user_ldap', $param, '') != $_POST[$param]) {
                                        $ldap = new \OCA\user_ldap\lib\Connection('user_ldap');
                                        $ldap->clearCache();
                                        OCP\Config::setAppValue('user_ldap', $param, $_POST[$param]);
@@ -59,7 +59,7 @@ if ($_POST) {
 // fill template
 $tmpl = new OCP\Template( 'user_ldap', 'settings');
 foreach($params as $param) {
-               $value = OCP\Config::getAppValue('user_ldap', $param,'');
+               $value = OCP\Config::getAppValue('user_ldap', $param, '');
                $tmpl->assign($param, $value);
 }
 
index 2acb8c35a1974f7f6e2a3c4e2cb218bb751e28a5..f99902d32f5cb028b4d922507c2e8af7f0f73e00 100644 (file)
@@ -32,8 +32,8 @@ class Test_Group_Ldap extends UnitTestCase {
                $this->assertIsA(OC_Group::getGroups(), gettype(array()));
                $this->assertIsA($group_ldap->getGroups(), gettype(array()));
 
-               $this->assertFalse(OC_Group::inGroup('john','dosers'), gettype(false));
-               $this->assertFalse($group_ldap->inGroup('john','dosers'), gettype(false));
+               $this->assertFalse(OC_Group::inGroup('john', 'dosers'), gettype(false));
+               $this->assertFalse($group_ldap->inGroup('john', 'dosers'), gettype(false));
                //TODO: check also for expected true result. This backend won't be able to do any modifications, maybe use a dummy for this.
 
                $this->assertIsA(OC_Group::getUserGroups('john doe'), gettype(array()));
index 3ab323becce5360372cfd026f2c34255ad2e6603..c4c131b7ef0205001588f76ffd6046bf13c21034 100755 (executable)
@@ -23,7 +23,7 @@
 
 require_once 'apps/user_webdavauth/user_webdavauth.php';
 
-OC_APP::registerAdmin('user_webdavauth','settings');
+OC_APP::registerAdmin('user_webdavauth', 'settings');
 
 OC_User::registerBackend("WEBDAVAUTH");
 OC_User::useBackend( "WEBDAVAUTH" );
index 5a3bd2cc9f02d3c452057a24c63059c28d317429..a7c4780d5d1dc5ce457e8ba4d3444bcc9e31f30b 100644 (file)
@@ -73,7 +73,7 @@
                <p>MySQL <?php echo $l->t( 'will be used' ); ?>.</p>
                <input type="hidden" id="dbtype" name="dbtype" value="mysql" />
                <?php else: ?>
-               <input type="radio" name="dbtype" value="mysql" id="mysql" <?php OC_Helper::init_radio('dbtype','mysql', 'sqlite'); ?>/>
+               <input type="radio" name="dbtype" value="mysql" id="mysql" <?php OC_Helper::init_radio('dbtype', 'mysql', 'sqlite'); ?>/>
                <label class="mysql" for="mysql">MySQL</label>
                <?php endif; ?>
                <?php endif; ?>
@@ -84,7 +84,7 @@
                <input type="hidden" id="dbtype" name="dbtype" value="pgsql" />
                <?php else: ?>
                <label class="pgsql" for="pgsql">PostgreSQL</label>
-               <input type="radio" name="dbtype" value='pgsql' id="pgsql" <?php OC_Helper::init_radio('dbtype','pgsql', 'sqlite'); ?>/>
+               <input type="radio" name="dbtype" value='pgsql' id="pgsql" <?php OC_Helper::init_radio('dbtype', 'pgsql', 'sqlite'); ?>/>
                <?php endif; ?>
                <?php endif; ?>
 
@@ -94,7 +94,7 @@
                <input type="hidden" id="dbtype" name="dbtype" value="oci" />
                <?php else: ?>
                <label class="oci" for="oci">Oracle</label>
-               <input type="radio" name="dbtype" value='oci' id="oci" <?php OC_Helper::init_radio('dbtype','oci', 'sqlite'); ?>/>
+               <input type="radio" name="dbtype" value='oci' id="oci" <?php OC_Helper::init_radio('dbtype', 'oci', 'sqlite'); ?>/>
                <?php endif; ?>
                <?php endif; ?>
                </div>
index c9e7170ac690478dfc897a5a6fd196d43aa4a415..bccb8cbbf0116c93140e058b1c3bca325d5db9d8 100644 (file)
@@ -351,7 +351,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
         }
 
         if ($database_file !== ':memory:') {
-                       if(!strpos($database_file,'.db')) {
+                       if(!strpos($database_file, '.db')) {
                                $database_file="$datadir/$database_file.db";
                        }
             if (!file_exists($database_file)) {
@@ -387,7 +387,7 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
 
         $php_errormsg = '';
                $this->connection = new SQLite3($database_file);
-               if(is_callable(array($this->connection,'busyTimeout'))) {//busy timout is only available in php>=5.3
+               if(is_callable(array($this->connection, 'busyTimeout'))) {//busy timout is only available in php>=5.3
                        $this->connection->busyTimeout(100);
                }
         $this->_lasterror = $this->connection->lastErrorMsg();
index f82961ca3a8a2f5561711715ae0ef3872282d07e..79c1d83314ff5903fdd121601bd2d32d64bd5d94 100755 (executable)
@@ -185,7 +185,7 @@ class OC_App{
                        }else{
                                $download=OC_OCSClient::getApplicationDownload($app, 1);
                                if(isset($download['downloadlink']) and $download['downloadlink']!='') {
-                                       $app=OC_Installer::installApp(array('source'=>'http','href'=>$download['downloadlink']));
+                                       $app=OC_Installer::installApp(array('source'=>'http', 'href'=>$download['downloadlink']));
                                }
                        }
                }
index 6e0629a0e18b9a791fe3110f590a1ae8bf1766e7..6c26468699118581ee8663fbcb8eec161288caf0 100644 (file)
@@ -23,7 +23,7 @@ class OC_Archive_TAR extends OC_Archive{
        private $path;
 
        function __construct($source) {
-               $types=array(null,'gz','bz');
+               $types=array(null, 'gz', 'bz');
                $this->path=$source;
                $this->tar=new Archive_Tar($source, $types[self::getTarType($source)]);
        }
@@ -309,7 +309,7 @@ class OC_Archive_TAR extends OC_Archive{
                if($mode=='r' or $mode=='rb') {
                        return fopen($tmpFile, $mode);
                }else{
-                       OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
+                       OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
                        self::$tempFiles[$tmpFile]=$path;
                        return fopen('close://'.$tmpFile, $mode);
                }
@@ -334,7 +334,7 @@ class OC_Archive_TAR extends OC_Archive{
                        $this->tar->_close();
                        $this->tar=null;
                }
-               $types=array(null,'gz','bz');
+               $types=array(null, 'gz', 'bz');
                $this->tar=new Archive_Tar($this->path, $types[self::getTarType($this->path)]);
        }
 }
index 5a6fc578be74688e6e505732cd4e28de8427728a..1c967baa08fc5e72f2f3fc77cf6c490cbcabc31a 100644 (file)
@@ -171,7 +171,7 @@ class OC_Archive_ZIP extends OC_Archive{
                                $ext='';
                        }
                        $tmpFile=OCP\Files::tmpFile($ext);
-                       OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
+                       OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this, 'writeBack');
                        if($this->fileExists($path)) {
                                $this->extractFile($path, $tmpFile);
                        }
index 5c3d3fb80cec1711bc12aabd6658aa013b147d63..26cb75dac8dbc4b90a7b457caf628b5ae2da84bb 100644 (file)
@@ -239,7 +239,7 @@ class OC{
                                }
                                if(file_exists(OC::$SERVERROOT."/config/config.php") and !is_writable(OC::$SERVERROOT."/config/config.php")) {
                                        $tmpl = new OC_Template( '', 'error', 'guest' );
-                                       $tmpl->assign('errors', array(1=>array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud")));
+                                       $tmpl->assign('errors', array(1=>array('error'=>"Can't write into config directory 'config'", 'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud")));
                                        $tmpl->printPage();
                                        exit;
                                }
@@ -322,7 +322,7 @@ class OC{
 
        public static function init() {
                // register autoloader
-               spl_autoload_register(array('OC','autoload'));
+               spl_autoload_register(array('OC', 'autoload'));
                setlocale(LC_ALL, 'en_US.UTF-8');
 
                // set some stuff
@@ -440,7 +440,7 @@ class OC{
                OC_Hook::connect('OC_Filesystem', 'rename', 'OC_Filesystem', 'isBlacklisted');
 
                //make sure temporary files are cleaned up
-               register_shutdown_function(array('OC_Helper','cleanTmp'));
+               register_shutdown_function(array('OC_Helper', 'cleanTmp'));
 
                //parse the given parameters
                self::$REQUESTEDAPP = (isset($_GET['app']) && trim($_GET['app']) != '' && !is_null($_GET['app'])?str_replace(array('\0', '/', '\\', '..'), '', strip_tags($_GET['app'])):OC_Config::getValue('defaultapp', 'files'));
@@ -669,7 +669,7 @@ class OC{
                }
                OC_App::loadApps(array('authentication'));
                if (OC_User::login($_SERVER["PHP_AUTH_USER"], $_SERVER["PHP_AUTH_PW"])) {
-                       //OC_Log::write('core',"Logged in with HTTP Authentication",OC_Log::DEBUG);
+                       //OC_Log::write('core',"Logged in with HTTP Authentication", OC_Log::DEBUG);
                        OC_User::unsetMagicInCookie();
                        $_REQUEST['redirect_url'] = (isset($_SERVER['REQUEST_URI'])?$_SERVER['REQUEST_URI']:'');
                        OC_Util::redirectToDefaultPage();
index ed02840195dc2a05bf4b5a1e88174aa005acc7f3..8d963a1cf8d8f081c195710eca35d8df0c1ea5a7 100644 (file)
@@ -57,7 +57,7 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
         */
        public function get() {
 
-               return OC_Filesystem::fopen($this->path,'rb');
+               return OC_Filesystem::fopen($this->path, 'rb');
 
        }
 
index 55a8d5eaa6dc63dd150f69611dde657be3bb9ab3..a72d003bc72d08cdd255ebaf93ebe4c9dfe1ac71 100644 (file)
@@ -102,7 +102,7 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
         * @param Sabre_DAV_Locks_LockInfo $lockInfo
         * @return bool
         */
-       public function lock($uri,Sabre_DAV_Locks_LockInfo $lockInfo) {
+       public function lock($uri, Sabre_DAV_Locks_LockInfo $lockInfo) {
 
                // We're making the lock timeout 5 minutes
                $lockInfo->timeout = 300;
@@ -134,7 +134,7 @@ class OC_Connector_Sabre_Locks extends Sabre_DAV_Locks_Backend_Abstract {
         * @param Sabre_DAV_Locks_LockInfo $lockInfo
         * @return bool
         */
-       public function unlock($uri,Sabre_DAV_Locks_LockInfo $lockInfo) {
+       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));
index 291b87257f167a6ac3f99a397b416457c81ee9ce..5fc106b85ed138f24b2607976145140f1a1dda3a 100644 (file)
@@ -85,7 +85,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                $this->path = $newPath;
 
                $query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertypath` = ? WHERE `userid` = ? AND `propertypath` = ?' );
-               $query->execute( array( $newPath,OC_User::getUser(), $oldPath ));
+               $query->execute( array( $newPath, OC_User::getUser(), $oldPath ));
 
        }
 
@@ -159,7 +159,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
                                                $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 ));
+                                               $query->execute( array( $propertyValue, OC_User::getUser(), $this->path, $propertyName ));
                                        }
                                }
                        }
index ba59985b7564ca0d3328ac014ff5e3c55aca78ee..fba2687967f1aa2cd820df0dc9b61df983a79e03 100644 (file)
@@ -324,7 +324,7 @@ class OC_DB {
                        if( PEAR::isError($result)) {
                                $entry = 'DB Error: "'.$result->getMessage().'"<br />';
                                $entry .= 'Offending command was: '.htmlentities($query).'<br />';
-                               OC_Log::write('core', $entry,OC_Log::FATAL);
+                               OC_Log::write('core', $entry, OC_Log::FATAL);
                                error_log('DB error: '.$entry);
                                die( $entry );
                        }
@@ -334,7 +334,7 @@ class OC_DB {
                        }catch(PDOException $e) {
                                $entry = 'DB Error: "'.$e->getMessage().'"<br />';
                                $entry .= 'Offending command was: '.htmlentities($query).'<br />';
-                               OC_Log::write('core', $entry,OC_Log::FATAL);
+                               OC_Log::write('core', $entry, OC_Log::FATAL);
                                error_log('DB error: '.$entry);
                                die( $entry );
                        }
index 782e742d244313611cfd2050c44cdb6b6cc1b73e..6263e03fc64921b74d938c085574754a2bf4b206 100644 (file)
@@ -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();
                }
@@ -120,7 +120,7 @@ class OC_FileCache{
        private static function update($id, $data) {
                $arguments=array();
                $queryParts=array();
-               foreach(array('size','mtime','ctime','mimetype','encrypted','versioned','writable') as $attribute) {
+               foreach(array('size','mtime','ctime','mimetype','encrypted','versioned', 'writable') as $attribute) {
                        if(isset($data[$attribute])) {
                                //Convert to int it args are false
                                if($data[$attribute] === false) {
@@ -227,7 +227,7 @@ class OC_FileCache{
                        $where = '`name` LIKE ? AND `user`=?';
                }
                $query=OC_DB::prepare('SELECT '.$select.' FROM `*PREFIX*fscache` WHERE '.$where);
-               $result=$query->execute(array("%$search%",OC_User::getUser()));
+               $result=$query->execute(array("%$search%", OC_User::getUser()));
                $names=array();
                while($row=$result->fetchRow()) {
                        if(!$returnData) {
@@ -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));
                }
@@ -402,7 +402,7 @@ class OC_FileCache{
                }
 
                OC_FileCache_Update::cleanFolder($path, $root);
-               self::increaseSize($path,$totalSize, $root);
+               self::increaseSize($path, $totalSize, $root);
        }
 
        /**
@@ -448,7 +448,7 @@ class OC_FileCache{
         * @return array of file paths
         *
         * $part1 and $part2 together form the complete mimetype.
-        * e.g. searchByMime('text','plain')
+        * e.g. searchByMime('text', 'plain')
         *
         * seccond mimetype part can be ommited
         * e.g. searchByMime('audio')
index ce395bf6edacd12f6d1a6582b0b1077e20f0ff84..bc403113e7cf9c89d271a8514cb31dfd1b09a551 100644 (file)
@@ -165,7 +165,7 @@ class OC_FileCache_Update{
                                $mtime=$view->filemtime($path.'/');
                                $ctime=$view->filectime($path.'/');
                                $writable=$view->is_writable($path.'/');
-                               OC_FileCache::put($path, array('size'=>$size,'mtime'=>$mtime,'ctime'=>$ctime,'mimetype'=>$mimetype,'writable'=>$writable));
+                               OC_FileCache::put($path, array('size'=>$size,'mtime'=>$mtime,'ctime'=>$ctime,'mimetype'=>$mimetype, 'writable'=>$writable));
                        }else{
                                $count=0;
                                OC_FileCache::scan($path, null, $count, $root);
@@ -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 1ca799fb74f84058e1cd695ec458f643b5994906..2f81bde64a18e61dc8912f929643d5bd0b7adcd0 100644 (file)
@@ -97,7 +97,7 @@ class OC_FileProxy{
                return true;
        }
 
-       public static function runPostProxies($operation,$path, $result) {
+       public static function runPostProxies($operation, $path, $result) {
                if(!self::$enabled) {
                        return $result;
                }
index 05b617c83270993e66e515ce54db5d349a7e8efc..81376fb6fcae32b0018482b14459ce5ec5fc5144 100644 (file)
@@ -38,9 +38,9 @@ class OC_FileProxy_Quota extends OC_FileProxy{
                if(in_array($user, $this->userQuota)) {
                        return $this->userQuota[$user];
                }
-               $userQuota=OC_Preferences::getValue($user,'files','quota','default');
+               $userQuota=OC_Preferences::getValue($user,'files','quota', 'default');
                if($userQuota=='default') {
-                       $userQuota=OC_AppConfig::getValue('files','default_quota','none');
+                       $userQuota=OC_AppConfig::getValue('files','default_quota', 'none');
                }
                if($userQuota=='none') {
                        $this->userQuota[$user]=0;
index 13bb127e863857d96dd90610c5f364fc67694a57..5a14083c2855dbf6fcaf7a3297fd6882949a10e1 100644 (file)
@@ -391,7 +391,7 @@ class OC_Files {
        */
        static function pull($source, $token, $dir, $file) {
                $tmpfile=tempnam(get_temp_dir(), 'remoteCloudFile');
-               $fp=fopen($tmpfile,'w+');
+               $fp=fopen($tmpfile, 'w+');
                $url=$source.="/files/pull.php?token=$token";
                $ch=curl_init();
                curl_setopt($ch, CURLOPT_URL, $url);
index 7b3a15dd8c6b93e3ac0566e4c88b9e5c7329f3b4..dd65f4421b7f0c18e87a125aacecc6be2b73e627 100644 (file)
@@ -48,7 +48,7 @@ abstract class OC_Filestorage{
        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);
index 3c06570d89056670e0a89bc811431e32f90ce308..b97eb79d8d4f1d0feb937e4275ea7c790ff7341f 100644 (file)
@@ -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);
@@ -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));
                                }
                        }
                }
index 89e994120ca012ad5f1afb548cf91a9fcadd1ddd..2dde0093d4bd511cb19c0537cc4bb058c813b55b 100644 (file)
@@ -86,11 +86,11 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
        }
        public function rename($path1, $path2) {
                if (!$this->isUpdatable($path1)) {
-                       OC_Log::write('core','unable to rename, file is not writable : '.$path1,OC_Log::ERROR);
+                       OC_Log::write('core','unable to rename, file is not writable : '.$path1, OC_Log::ERROR);
                        return false;
                }
                if(! $this->file_exists($path1)) {
-                       OC_Log::write('core','unable to rename, file does not exists : '.$path1,OC_Log::ERROR);
+                       OC_Log::write('core','unable to rename, file does not exists : '.$path1, OC_Log::ERROR);
                        return false;
                }
 
@@ -103,7 +103,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
                        if(!$this->file_exists($path2)) {
                                $this->mkdir($path2);
                        }
-                       $source=substr($path1, strrpos($path1,'/')+1);
+                       $source=substr($path1, strrpos($path1, '/')+1);
                        $path2.=$source;
                }
                return copy($this->datadir.$path1, $this->datadir.$path2);
@@ -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) {
@@ -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;
index 055ba66aae3d5b94a218c9e56edf17a6afde58c7..aeafb14939575a4517ee6695cf5afa300e7d6bba 100644 (file)
  *   post_create(path)
  *   delete(path, &run)
  *   post_delete(path)
- *   rename(oldpath,newpath, &run)
- *   post_rename(oldpath,newpath)
- *   copy(oldpath,newpath, &run) (if the newpath doesn't exists yes, copy, create and write will be emited in that order)
- *   post_rename(oldpath,newpath)
+ *   rename(oldpath, newpath, &run)
+ *   post_rename(oldpath, newpath)
+ *   copy(oldpath, newpath, &run) (if the newpath doesn't exists yes, copy, create and write will be emited in that order)
+ *   post_rename(oldpath, newpath)
  *
  *   the &run parameter can be set to false to prevent the operation from occuring
  */
@@ -246,7 +246,7 @@ class OC_Filesystem{
                        }\r
                \r
                        $mtime=filemtime(OC::$SERVERROOT.'/config/mount.php');\r
-                       $previousMTime=OC_Appconfig::getValue('files','mountconfigmtime',0);\r
+                       $previousMTime=OC_Appconfig::getValue('files','mountconfigmtime', 0);\r
                        if($mtime>$previousMTime) {//mount config has changed, filecache needs to be updated\r
                                OC_FileCache::triggerUpdate();\r
                                OC_Appconfig::setValue('files', 'mountconfigmtime', $mtime);\r
@@ -312,7 +312,7 @@ class OC_Filesystem{
                                return false;
                        }
                }else{
-                       OC_Log::write('core','storage backend '.$class.' not found',OC_Log::ERROR);
+                       OC_Log::write('core','storage backend '.$class.' not found', OC_Log::ERROR);
                        return false;
                }
        }
@@ -356,7 +356,7 @@ class OC_Filesystem{
                if(substr($mountpoint, -1)!=='/') {
                        $mountpoint=$mountpoint.'/';
                }
-               self::$mounts[$mountpoint]=array('class'=>$class,'arguments'=>$arguments);
+               self::$mounts[$mountpoint]=array('class'=>$class, 'arguments'=>$arguments);
        }
 
        /**
@@ -590,7 +590,7 @@ class OC_Filesystem{
                        $path=substr($path, 0, -1);
                }
                //remove duplicate slashes
-               while(strpos($path,'//')!==false) {
+               while(strpos($path, '//')!==false) {
                        $path=str_replace('//', '/', $path);
                }
                //normalize unicode if possible
index ecbdb63ec5400fe84970cb2971bb9c7ffcc48b9b..936e1feb41207d448cf308ac42a9b86ffb99f38a 100644 (file)
@@ -489,7 +489,7 @@ class OC_FilesystemView {
                                $hooks[]='write';
                                break;
                        default:
-                               OC_Log::write('core', 'invalid mode ('.$mode.') for '.$path,OC_Log::ERROR);
+                               OC_Log::write('core', 'invalid mode ('.$mode.') for '.$path, OC_Log::ERROR);
                }
 
                return $this->basicOperation('fopen', $path, $hooks, $mode);
index 38acf00d9fec4ad53d9091ad4ad200bef2fcfcc9..41cd908169023e8f47b82469b98f2b88cd8bd509 100644 (file)
@@ -271,7 +271,7 @@ class OC_Image {
                        return -1;
                }
                if(is_null($this->filepath) || !is_readable($this->filepath)) {
-                       OC_Log::write('core','OC_Image->fixOrientation() No readable file path set.', OC_Log::DEBUG);
+                       OC_Log::write('core', 'OC_Image->fixOrientation() No readable file path set.', OC_Log::DEBUG);
                        return -1;
                }
                $exif = @exif_read_data($this->filepath, 'IFD0');
index 0c776d47d5af12382e355aee3935f63cd28a50fa..266c07d5c2b6a357f9cb324e39594a4ede1a6ac2 100644 (file)
@@ -57,7 +57,7 @@ class OC_Installer{
         */
        public static function installApp( $data = array()) {
                if(!isset($data['source'])) {
-                       OC_Log::write('core','No source specified when installing app',OC_Log::ERROR);
+                       OC_Log::write('core','No source specified when installing app', OC_Log::ERROR);
                        return false;
                }
 
@@ -65,13 +65,13 @@ class OC_Installer{
                if($data['source']=='http') {
                        $path=OC_Helper::tmpFile();
                        if(!isset($data['href'])) {
-                               OC_Log::write('core','No href specified when installing app from http',OC_Log::ERROR);
+                               OC_Log::write('core','No href specified when installing app from http', OC_Log::ERROR);
                                return false;
                        }
                        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);
+                               OC_Log::write('core','No path specified when installing app from local file', OC_Log::ERROR);
                                return false;
                        }
                        $path=$data['path'];
@@ -86,7 +86,7 @@ class OC_Installer{
                        rename($path, $path.'.tgz');
                        $path.='.tgz';
                }else{
-                       OC_Log::write('core','Archives of type '.$mime.' are not supported',OC_Log::ERROR);
+                       OC_Log::write('core','Archives of type '.$mime.' are not supported', OC_Log::ERROR);
                        return false;
                }
 
@@ -248,7 +248,7 @@ class OC_Installer{
         *   -# including appinfo/upgrade.php
         *   -# setting the installed version
         *
-        * upgrade.php can determine the current installed version of the app using "OC_Appconfig::getValue($appid,'installed_version')"
+        * upgrade.php can determine the current installed version of the app using "OC_Appconfig::getValue($appid, 'installed_version')"
         */
        public static function upgradeApp( $data = array()) {
                // TODO: write function
index be37f94ca65ec9a9565491c16a6d61ab355938cc..204430411c09b28a7925dafc209529cfcebe3eb1 100644 (file)
@@ -72,7 +72,7 @@ class OC_JSON{
        public static function checkSubAdminUser() {
                self::checkLoggedIn();
                self::verifyUser();
-               if(!OC_Group::inGroup(OC_User::getUser(),'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
+               if(!OC_Group::inGroup(OC_User::getUser(), 'admin') && !OC_SubAdmin::isSubAdmin(OC_User::getUser())) {
                        $l = OC_L10N::get('lib');
                        self::error(array( 'data' => array( 'message' => $l->t('Authentication error') )));
                        exit();
index 996ace2f57a87bc7dc75369c1eb2425b0fa503a9..f172710e5d7b9a8c686e748cc6a60d9ee7628ca9 100644 (file)
@@ -167,7 +167,7 @@ class OC_L10N{
         *
         */
        public function tA($textArray) {
-               OC_Log::write('core', 'DEPRECATED: the method tA is deprecated and will be removed soon.',OC_Log::WARN);
+               OC_Log::write('core', 'DEPRECATED: the method tA is deprecated and will be removed soon.', OC_Log::WARN);
                $result = array();
                foreach($textArray as $key => $text) {
                        $result[$key] = (string)$this->t($text);
index d4644163ad56e70b64d6ac5b80b90eb677ed1bb2..ec43208d833459d9467c6f8ab3e16251c00d9089 100644 (file)
@@ -44,9 +44,9 @@ class OC_Log_Owncloud {
         * @param int level
         */
        public static function write($app, $message, $level) {
-               $minLevel=min(OC_Config::getValue( "loglevel", OC_Log::WARN ),OC_Log::ERROR);
+               $minLevel=min(OC_Config::getValue( "loglevel", OC_Log::WARN ), OC_Log::ERROR);
                if($level>=$minLevel) {
-                       $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level,'time'=>time());
+                       $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=>time());
                        $fh=fopen(self::$logFile, 'a');
                        fwrite($fh, json_encode($entry)."\n");
                        fclose($fh);
index a77ac5856992d01756424bf3f2f18cbd0c043b96..c78fcce88d4f604f43998278602540075ce04abb 100644 (file)
@@ -27,7 +27,7 @@ class OC_Mail {
         * @param string $fromname
         * @param bool $html
         */
-       public static function send($toaddress,$toname,$subject,$mailtext,$fromaddress,$fromname,$html=0,$altbody='',$ccaddress='',$ccname='',$bcc='') {
+       public static function send($toaddress,$toname,$subject,$mailtext,$fromaddress,$fromname,$html=0,$altbody='',$ccaddress='',$ccname='', $bcc='') {
 
                $SMTPMODE = OC_Config::getValue( 'mail_smtpmode', 'sendmail' );
                $SMTPHOST = OC_Config::getValue( 'mail_smtphost', '127.0.0.1' );
index e967ae06ecf11e3f9a9f401eddb22d550865134c..616417a22716e546860208f8f8a7029227b2344c 100644 (file)
@@ -611,11 +611,11 @@ class OC_Migrate{
                if( file_exists( $db ) ) {
                        // Connect to the db
                        if(!self::connectDB( $db )) {
-                               OC_Log::write('migration','Failed to connect to migration.db',OC_Log::ERROR);
+                               OC_Log::write('migration','Failed to connect to migration.db', OC_Log::ERROR);
                                return false;
                        }
                } else {
-                       OC_Log::write('migration','Migration.db not found at: '.$db, OC_Log::FATAL );
+                       OC_Log::write('migration', 'Migration.db not found at: '.$db, OC_Log::FATAL );
                        return false;
                }
 
index eec475945a87b2dcfff0023d5f6cd9995345ba93..54982b3c8470a15965b0a31875dd584a4400cb06 100644 (file)
@@ -205,7 +205,7 @@ class OC_Migration_Content{
                        }
                        closedir($dirhandle);
            } else {
-                       OC_Log::write('admin_export',"Was not able to open directory: " . $dir,OC_Log::ERROR);
+                       OC_Log::write('admin_export',"Was not able to open directory: " . $dir, OC_Log::ERROR);
                        return false;
            }
            return true;
index 2a36cbc12390c6ca8e4e02dcccf11dd164883500..ceeb78570fd49c2a1b9d0e9fa7d270865dbe7c5a 100644 (file)
@@ -162,7 +162,7 @@ class OC_OCSClient{
                $xml=OC_OCSClient::getOCSresponse($url);
 
                if($xml==false) {
-                       OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL);
+                       OC_Log::write('core','Unable to parse OCS content', OC_Log::FATAL);
                        return null;
                }
                $data=simplexml_load_string($xml);
@@ -200,7 +200,7 @@ class OC_OCSClient{
                $xml=OC_OCSClient::getOCSresponse($url);
 
                if($xml==false) {
-                       OC_Log::write('core','Unable to parse OCS content',OC_Log::FATAL);
+                       OC_Log::write('core','Unable to parse OCS content', OC_Log::FATAL);
                        return null;
                }
                $data=simplexml_load_string($xml);
@@ -238,7 +238,7 @@ class OC_OCSClient{
                $xml=OC_OCSClient::getOCSresponse($url);
 
                if($xml==false) {
-                       OC_Log::write('core','Unable to parse knowledgebase content',OC_Log::FATAL);
+                       OC_Log::write('core','Unable to parse knowledgebase content', OC_Log::FATAL);
                        return null;
                }
                $data=simplexml_load_string($xml);
index 87262d986255555467fea8485201f10f3cb274bf..287d20d1a5dbe550a0f3096c7e7499630de7c7e3 100644 (file)
@@ -63,7 +63,7 @@ class OC_Request {
                        $path_info = substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME']));
                        // following is taken from Sabre_DAV_URLUtil::decodePathSegment
                        $path_info = rawurldecode($path_info);
-                       $encoding = mb_detect_encoding($path_info, array('UTF-8','ISO-8859-1'));
+                       $encoding = mb_detect_encoding($path_info, array('UTF-8', 'ISO-8859-1'));
 
                        switch($encoding) {
 
@@ -98,7 +98,7 @@ class OC_Request {
                $HTTP_ACCEPT_ENCODING = $_SERVER["HTTP_ACCEPT_ENCODING"];
                if( strpos($HTTP_ACCEPT_ENCODING, 'x-gzip') !== false )
                        return 'x-gzip';
-               else if( strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false )
+               else if( strpos($HTTP_ACCEPT_ENCODING, 'gzip') !== false )
                        return 'gzip';
                return false;
        }
index d5233d79861cf1f822de0ef8ad201c8d8430f82a..5901717c094430c54b81fd53b3090ad890895d11 100644 (file)
@@ -108,7 +108,7 @@ class OC_Route extends Route {
        public function actionInclude($file) {
                $function = create_function('$param',
                        'unset($param["_route"]);'
-                       .'$_GET=array_merge($_GET,$param);'
+                       .'$_GET=array_merge($_GET, $param);'
                        .'unset($param);'
                        .'require_once "'.$file.'";');
                $this->action($function);
index 2629c5e2fbefaf4a651f8fdc1c989f6153369061..3c3378ad13cbb12c31f8db4e25e51f574a330e6b 100644 (file)
@@ -41,7 +41,7 @@ class OC_Search{
         * @param string $provider class name of a OC_Search_Provider
         */
        public static function registerProvider($class, $options=array()) {
-               self::$registeredProviders[]=array('class'=>$class,'options'=>$options);
+               self::$registeredProviders[]=array('class'=>$class, 'options'=>$options);
        }
 
        /**
index c424ad6fb00bc56561830bbd4ffb2780834f89b9..726b3352d50ed857bffc1f4fe39d1d0d43c7819e 100644 (file)
@@ -95,7 +95,7 @@ class OC_Setup {
                        //write the config file
                        OC_Config::setValue('datadirectory', $datadir);
                        OC_Config::setValue('dbtype', $dbtype);
-                       OC_Config::setValue('version', implode('.',OC_Util::getVersion()));
+                       OC_Config::setValue('version', implode('.', OC_Util::getVersion()));
                        if($dbtype == 'mysql') {
                                $dbuser = $options['dbuser'];
                                $dbpass = $options['dbpass'];
index b5ea0a2b2ebf2ab16e3063f27d16da526e5aacd9..981c280f0ddf92a1537a5b220b17b93d9e762ccb 100644 (file)
@@ -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() {
@@ -249,16 +249,16 @@ class OC_CloseStreamWrapper{
                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);
                                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);
                }
        }
 
index ad25dbcff519861c1b1ba4e0a86275c8d5884e14..d1cce8ad7ffe50a2165fd7d89c56dfa1f9e7dea8 100644 (file)
@@ -196,11 +196,11 @@ class OC_Template{
        public static function detectFormfactor() {
                // please add more useragent strings for other devices
                if(isset($_SERVER['HTTP_USER_AGENT'])) {
-                       if(stripos($_SERVER['HTTP_USER_AGENT'],'ipad')>0) {
+                       if(stripos($_SERVER['HTTP_USER_AGENT'], 'ipad')>0) {
                                $mode='tablet';
-                       }elseif(stripos($_SERVER['HTTP_USER_AGENT'],'iphone')>0) {
+                       }elseif(stripos($_SERVER['HTTP_USER_AGENT'], 'iphone')>0) {
                                $mode='mobile';
-                       }elseif((stripos($_SERVER['HTTP_USER_AGENT'],'N9')>0) and (stripos($_SERVER['HTTP_USER_AGENT'],'nokia')>0)) {
+                       }elseif((stripos($_SERVER['HTTP_USER_AGENT'],'N9')>0) and (stripos($_SERVER['HTTP_USER_AGENT'], 'nokia')>0)) {
                                $mode='mobile';
                        }else{
                                $mode='default';
@@ -357,7 +357,7 @@ class OC_Template{
         * @param string $text the text content for the element
         */
        public function addHeader( $tag, $attributes, $text='') {
-               $this->headers[]=array('tag'=>$tag,'attributes'=>$attributes,'text'=>$text);
+               $this->headers[]=array('tag'=>$tag,'attributes'=>$attributes, 'text'=>$text);
        }
 
        /**
index c3da172a7c18f033e95eea88d400ededfe1170c0..1a0570a270d617b4a3d2cb82a6b033aa25f5ced7 100644 (file)
@@ -12,10 +12,10 @@ class OC_TemplateLayout extends OC_Template {
 
                if( $renderas == 'user' ) {
                        parent::__construct( 'core', 'layout.user' );
-                       if(in_array(OC_APP::getCurrentApp(), array('settings','admin','help'))!==false) {
-                               $this->assign('bodyid','body-settings', false);
+                       if(in_array(OC_APP::getCurrentApp(), array('settings','admin', 'help'))!==false) {
+                               $this->assign('bodyid', 'body-settings', false);
                        }else{
-                               $this->assign('bodyid','body-user', false);
+                               $this->assign('bodyid', 'body-user', false);
                        }
 
                        // Add navigation entry
index 7d5ec4ffe90cdf864b27514a3c4b7f10b013c802..11081eded639935b27411b0edebee1d271763fa9 100644 (file)
@@ -30,7 +30,7 @@ class OC_Updater{
         */
        public static function check() {
                OC_Appconfig::setValue('core', 'lastupdatedat', microtime(true));
-               if(OC_Appconfig::getValue('core', 'installedat','')=='') OC_Appconfig::setValue('core', 'installedat', microtime(true));
+               if(OC_Appconfig::getValue('core', 'installedat', '')=='') OC_Appconfig::setValue('core', 'installedat', microtime(true));
 
                $updaterurl='http://apps.owncloud.com/updater.php';
                $version=OC_Util::getVersion();
index 126f2aa3da8c1d7c961e92035e3a1d74cf6c0ed7..be0e525d868ab0c2110a4d4833351ef9f08d0270 100644 (file)
@@ -133,7 +133,7 @@ class OC_User {
                                self::useBackend($backend);
                                $_setupedBackends[]=$i;
                        }else{
-                               OC_Log::write('core','User backend '.$class.' not found.',OC_Log::ERROR);
+                               OC_Log::write('core','User backend '.$class.' not found.', OC_Log::ERROR);
                        }
                }
        }
index f39c19829e07fa9ece4f5d1650174af1f0ddfdf8..f33e338e2e4919a0cf8c84d514f6e84e800f82b3 100644 (file)
@@ -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 ea055b6982530806888aecd73076dd4d5c354b51..944ede73a0b3a2188c7fbc446e16f09317bb362d 100644 (file)
@@ -50,7 +50,7 @@ class OC_User_HTTP extends OC_User_Backend {
         * @return boolean
         */
        private function matchUrl($url) {
-               return ! is_null(parse_url($url,PHP_URL_USER));
+               return ! is_null(parse_url($url, PHP_URL_USER));
        }
 
        /**
index a9bc5c061c84a07eff817fdc740308dee2d25da9..d8b926a065830ae75cdb1208941105984893db71 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);
        }
 
        /**
@@ -157,7 +157,7 @@ class OC_Util {
         * @param string $text the text content for the element
         */
        public static function addHeader( $tag, $attributes, $text='') {
-               self::$headers[]=array('tag'=>$tag,'attributes'=>$attributes,'text'=>$text);
+               self::$headers[]=array('tag'=>$tag,'attributes'=>$attributes, 'text'=>$text);
        }
 
        /**
@@ -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) {
@@ -217,7 +217,7 @@ class OC_Util {
                $web_server_restart= false;
                //check for database drivers
                if(!(is_callable('sqlite_open') or class_exists('SQLite3')) and !is_callable('mysql_connect') and !is_callable('pg_connect')) {
-                       $errors[]=array('error'=>'No database drivers (sqlite, mysql, or postgresql) installed.<br/>','hint'=>'');//TODO: sane hint
+                       $errors[]=array('error'=>'No database drivers (sqlite, mysql, or postgresql) installed.<br/>', 'hint'=>'');//TODO: sane hint
                        $web_server_restart= true;
                }
 
@@ -226,13 +226,13 @@ class OC_Util {
 
                // Check if config folder is writable.
                if(!is_writable(OC::$SERVERROOT."/config/") or !is_readable(OC::$SERVERROOT."/config/")) {
-                       $errors[]=array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud");
+                       $errors[]=array('error'=>"Can't write into config directory 'config'", 'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud");
                }
 
                // Check if there is a writable install folder.
                if(OC_Config::getValue('appstoreenabled', true)) {
                        if( OC_App::getInstallPath() === null  || !is_writable(OC_App::getInstallPath()) || !is_readable(OC_App::getInstallPath()) ) {
-                               $errors[]=array('error'=>"Can't write into apps directory",'hint'=>"You can usually fix this by giving the webserver user write access to the apps directory
+                               $errors[]=array('error'=>"Can't write into apps directory", 'hint'=>"You can usually fix this by giving the webserver user write access to the apps directory
                                in owncloud or disabling the appstore in the config file.");
                        }
                }
@@ -269,57 +269,57 @@ class OC_Util {
                if(!is_dir($CONFIG_DATADIRECTORY)) {
                        $success=@mkdir($CONFIG_DATADIRECTORY);
                        if(!$success) {
-                               $errors[]=array('error'=>"Can't create data directory (".$CONFIG_DATADIRECTORY.")",'hint'=>"You can usually fix this by giving the webserver write access to the ownCloud directory '".OC::$SERVERROOT."' (in a terminal, use the command 'chown -R www-data:www-data /path/to/your/owncloud/install/data' ");
+                               $errors[]=array('error'=>"Can't create data directory (".$CONFIG_DATADIRECTORY.")", 'hint'=>"You can usually fix this by giving the webserver write access to the ownCloud directory '".OC::$SERVERROOT."' (in a terminal, use the command 'chown -R www-data:www-data /path/to/your/owncloud/install/data' ");
                        }
                } else if(!is_writable($CONFIG_DATADIRECTORY) or !is_readable($CONFIG_DATADIRECTORY)) {
-                       $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY.') not writable by ownCloud<br/>','hint'=>$permissionsHint);
+                       $errors[]=array('error'=>'Data directory ('.$CONFIG_DATADIRECTORY.') not writable by ownCloud<br/>', 'hint'=>$permissionsHint);
                }
 
                // check if all required php modules are present
                if(!class_exists('ZipArchive')) {
-                       $errors[]=array('error'=>'PHP module zip not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP module zip not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
 
                if(!function_exists('mb_detect_encoding')) {
-                       $errors[]=array('error'=>'PHP module mb multibyte not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP module mb multibyte not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
                if(!function_exists('ctype_digit')) {
-                       $errors[]=array('error'=>'PHP module ctype is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP module ctype is not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
                if(!function_exists('json_encode')) {
-                       $errors[]=array('error'=>'PHP module JSON is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP module JSON is not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
                if(!function_exists('imagepng')) {
-                       $errors[]=array('error'=>'PHP module GD is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP module GD is not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
                if(!function_exists('gzencode')) {
-                       $errors[]=array('error'=>'PHP module zlib is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP module zlib is not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
                if(!function_exists('iconv')) {
-                       $errors[]=array('error'=>'PHP module iconv is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP module iconv is not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
                if(!function_exists('simplexml_load_string')) {
-                       $errors[]=array('error'=>'PHP module SimpleXML is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP module SimpleXML is not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
                if(floatval(phpversion())<5.3) {
-                       $errors[]=array('error'=>'PHP 5.3 is required.<br/>','hint'=>'Please ask your server administrator to update PHP to version 5.3 or higher. PHP 5.2 is no longer supported by ownCloud and the PHP community.');
+                       $errors[]=array('error'=>'PHP 5.3 is required.<br/>', 'hint'=>'Please ask your server administrator to update PHP to version 5.3 or higher. PHP 5.2 is no longer supported by ownCloud and the PHP community.');
                        $web_server_restart= false;
                }
                if(!defined('PDO::ATTR_DRIVER_NAME')) {
-                       $errors[]=array('error'=>'PHP PDO module is not installed.<br/>','hint'=>'Please ask your server administrator to install the module.');
+                       $errors[]=array('error'=>'PHP PDO module is not installed.<br/>', 'hint'=>'Please ask your server administrator to install the module.');
                        $web_server_restart= false;
                }
 
                if($web_server_restart) {
-                       $errors[]=array('error'=>'PHP modules have been installed, but they are still listed as missing?<br/>','hint'=>'Please ask your server administrator to restart the web server.');
+                       $errors[]=array('error'=>'PHP modules have been installed, but they are still listed as missing?<br/>', 'hint'=>'Please ask your server administrator to restart the web server.');
                }
 
                return $errors;
index ec4536673aadb77d1b103df496ff23518512c7c3..46256def9c4e674b5a74c0dbbe1e0660d3ba7e46 100644 (file)
@@ -66,7 +66,7 @@ class OC_VCategories {
        * @returns array containing the categories as strings.
        */
        public function categories() {
-               //OC_Log::write('core','OC_VCategories::categories: '.print_r($this->categories, true), OC_Log::DEBUG);
+               //OC_Log::write('core', 'OC_VCategories::categories: '.print_r($this->categories, true), OC_Log::DEBUG);
                if(!$this->categories) {
                        return array();
                }
@@ -139,12 +139,12 @@ class OC_VCategories {
                        $this->categories = array();
                }
                foreach($objects as $object) {
-                       //OC_Log::write('core','OC_VCategories::rescan: '.substr($object, 0, 100).'(...)', OC_Log::DEBUG);
+                       //OC_Log::write('core', 'OC_VCategories::rescan: '.substr($object, 0, 100).'(...)', OC_Log::DEBUG);
                        $vobject = OC_VObject::parse($object);
                        if(!is_null($vobject)) {
                                $this->loadFromVObject($vobject, $sync);
                        } else {
-                               OC_Log::write('core','OC_VCategories::rescan, unable to parse. ID: '.', '.substr($object, 0, 100).'(...)', OC_Log::DEBUG);
+                               OC_Log::write('core', 'OC_VCategories::rescan, unable to parse. ID: '.', '.substr($object, 0, 100).'(...)', OC_Log::DEBUG);
                        }
                }
                $this->save();
@@ -158,9 +158,9 @@ class OC_VCategories {
                        usort($this->categories, 'strnatcasecmp'); // usort to also renumber the keys
                        $escaped_categories = serialize($this->categories);
                        OC_Preferences::setValue($this->user, $this->app, self::PREF_CATEGORIES_LABEL, $escaped_categories);
-                       OC_Log::write('core','OC_VCategories::save: '.print_r($this->categories, true), OC_Log::DEBUG);
+                       OC_Log::write('core', 'OC_VCategories::save: '.print_r($this->categories, true), OC_Log::DEBUG);
                } else {
-                       OC_Log::write('core','OC_VCategories::save: $this->categories is not an array! '.print_r($this->categories, true), OC_Log::ERROR);
+                       OC_Log::write('core', 'OC_VCategories::save: $this->categories is not an array! '.print_r($this->categories, true), OC_Log::ERROR);
                }
        }
 
@@ -173,37 +173,37 @@ class OC_VCategories {
                if(!is_array($names)) {
                        $names = array($names);
                }
-               OC_Log::write('core','OC_VCategories::delete, before: '.print_r($this->categories, true), OC_Log::DEBUG);
+               OC_Log::write('core', 'OC_VCategories::delete, before: '.print_r($this->categories, true), OC_Log::DEBUG);
                foreach($names as $name) {
-                       OC_Log::write('core','OC_VCategories::delete: '.$name, OC_Log::DEBUG);
+                       OC_Log::write('core', 'OC_VCategories::delete: '.$name, OC_Log::DEBUG);
                        if($this->hasCategory($name)) {
-                               //OC_Log::write('core','OC_VCategories::delete: '.$name.' got it', OC_Log::DEBUG);
+                               //OC_Log::write('core', 'OC_VCategories::delete: '.$name.' got it', OC_Log::DEBUG);
                                unset($this->categories[$this->array_searchi($name, $this->categories)]);
                        }
                }
                $this->save();
-               OC_Log::write('core','OC_VCategories::delete, after: '.print_r($this->categories, true), OC_Log::DEBUG);
+               OC_Log::write('core', 'OC_VCategories::delete, after: '.print_r($this->categories, true), OC_Log::DEBUG);
                if(!is_null($objects)) {
                        foreach($objects as $key=>&$value) {
                                $vobject = OC_VObject::parse($value[1]);
                                if(!is_null($vobject)) {
                                        $categories = $vobject->getAsArray('CATEGORIES');
-                                       //OC_Log::write('core','OC_VCategories::delete, before: '.$key.': '.print_r($categories, true), OC_Log::DEBUG);
+                                       //OC_Log::write('core', 'OC_VCategories::delete, before: '.$key.': '.print_r($categories, true), OC_Log::DEBUG);
                                        foreach($names as $name) {
                                                $idx = $this->array_searchi($name, $categories);
-                                               //OC_Log::write('core','OC_VCategories::delete, loop: '.$name.', '.print_r($idx, true), OC_Log::DEBUG);
+                                               //OC_Log::write('core', 'OC_VCategories::delete, loop: '.$name.', '.print_r($idx, true), OC_Log::DEBUG);
                                                if($idx !== false) {
-                                                       OC_Log::write('core','OC_VCategories::delete, unsetting: '.$categories[$this->array_searchi($name, $categories)], OC_Log::DEBUG);
+                                                       OC_Log::write('core', 'OC_VCategories::delete, unsetting: '.$categories[$this->array_searchi($name, $categories)], OC_Log::DEBUG);
                                                        unset($categories[$this->array_searchi($name, $categories)]);
                                                        //unset($categories[$idx]);
                                                }
                                        }
-                                       //OC_Log::write('core','OC_VCategories::delete, after: '.$key.': '.print_r($categories, true), OC_Log::DEBUG);
+                                       //OC_Log::write('core', 'OC_VCategories::delete, after: '.$key.': '.print_r($categories, true), OC_Log::DEBUG);
                                        $vobject->setString('CATEGORIES', implode(',', $categories));
                                        $value[1] = $vobject->serialize();
                                        $objects[$key] = $value;
                                } else {
-                                       OC_Log::write('core','OC_VCategories::delete, unable to parse. ID: '.$value[0].', '.substr($value[1], 0, 50).'(...)', OC_Log::DEBUG);
+                                       OC_Log::write('core', 'OC_VCategories::delete, unable to parse. ID: '.$value[0].', '.substr($value[1], 0, 50).'(...)', OC_Log::DEBUG);
                                }
                        }
                }
index 7ce0ee0d6ffb7459a35c2bcaa3b1939ed1cebc01..c704704ed33dc362510b8c5246ba4820e8dbc5a6 100755 (executable)
@@ -25,7 +25,7 @@ function compareEntries($a, $b) {
 }
 usort($entries, 'compareEntries');
 
-$tmpl->assign('loglevel',OC_Config::getValue( "loglevel", 2 ));
+$tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 ));
 $tmpl->assign('entries', $entries);
 $tmpl->assign('entriesremain', $entriesremain);
 $tmpl->assign('htaccessworking', $htaccessworking);
index 4b32585b3066cff0f955f33e4b88ce582bd7f94e..845f8ea408c82da7d328cfcee6b1e2fdcae9096b 100644 (file)
@@ -36,5 +36,5 @@ if($username) {
        }
        OC_Appconfig::setValue('files', 'default_quota', $quota);
 }
-OC_JSON::success(array("data" => array( "username" => $username ,'quota' => $quota)));
+OC_JSON::success(array("data" => array( "username" => $username , 'quota' => $quota)));
 
index f28ab2ae755feddf6676da15a639081ff502d635..47dbcc53ebc5c4c71a6275e190f2dcf7b0ff3224 100644 (file)
@@ -40,11 +40,11 @@ $languages=array();
 foreach($languageCodes as $lang) {
        $l=OC_L10N::get('settings', $lang);
        if(substr($l->t('__language_name__'), 0, 1)!='_') {//first check if the language name is in the translation file
-               $languages[]=array('code'=>$lang,'name'=>$l->t('__language_name__'));
+               $languages[]=array('code'=>$lang, 'name'=>$l->t('__language_name__'));
        }elseif(isset($languageNames[$lang])) {
-               $languages[]=array('code'=>$lang,'name'=>$languageNames[$lang]);
+               $languages[]=array('code'=>$lang, 'name'=>$languageNames[$lang]);
        }else{//fallback to language code
-               $languages[]=array('code'=>$lang,'name'=>$lang);
+               $languages[]=array('code'=>$lang, 'name'=>$lang);
        }
 }
 
index 35f34489fec170f90cc0358b01dcca5171aef2eb..300d6093d6faa91feaeaf697a90be1400263892c 100644 (file)
@@ -3,7 +3,7 @@
  * This file is licensed under the Affero General Public License version 3 or later.
  * See the COPYING-README file.
  */
-$levels=array('Debug','Info','Warning','Error','Fatal');
+$levels=array('Debug','Info','Warning','Error', 'Fatal');
 ?>
 
 <?php
index 408dc2bbae88eb76f507c4e0a99a3c8665c75d61..cd2ca6630a5f6d99cb4ec464ce4b37ba34d06fea 100644 (file)
@@ -26,16 +26,16 @@ abstract class Test_Archive extends UnitTestCase {
        public function testGetFiles() {
                $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');
+               $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');
                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');
+                       $this->assertTrue($this->instance->fileExists($file), 'file '.$file.' does not exist in archive');
                }
                $this->assertFalse($this->instance->fileExists('non/existing/file'));
 
                $rootContent=$this->instance->getFolder('');
-               $expected=array('lorem.txt','logo-wide.png','dir/');
+               $expected=array('lorem.txt','logo-wide.png', 'dir/');
                $this->assertEqual(3, count($rootContent));
                foreach($expected as $file) {
                        $this->assertContains($file, $rootContent, 'cant find '.  $file . ' in archive');
@@ -71,14 +71,14 @@ abstract class Test_Archive extends UnitTestCase {
                $this->assertFalse($this->instance->fileExists('lorem.txt/'));
 
                $this->assertEqual(file_get_contents($textFile), $this->instance->getFile('lorem.txt'));
-               $this->instance->addFile('lorem.txt','foobar');
+               $this->instance->addFile('lorem.txt', 'foobar');
                $this->assertEqual('foobar', $this->instance->getFile('lorem.txt'));
        }
 
        public function testReadStream() {
                $dir=OC::$SERVERROOT.'/tests/data';
                $this->instance=$this->getExisting();
-               $fh=$this->instance->getStream('lorem.txt','r');
+               $fh=$this->instance->getStream('lorem.txt', 'r');
                $this->assertTrue($fh);
                $content=fread($fh, $this->instance->filesize('lorem.txt'));
                fclose($fh);
@@ -87,8 +87,8 @@ abstract class Test_Archive extends UnitTestCase {
        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');
+               $fh=$this->instance->getStream('lorem.txt', 'w');
+               $source=fopen($dir.'/lorem.txt', 'r');
                OCP\Files::streamCopy($source, $fh);
                fclose($source);
                fclose($fh);
@@ -123,7 +123,7 @@ abstract class Test_Archive extends UnitTestCase {
                $this->instance=$this->getNew();
                $this->instance->addFile('lorem.txt', $textFile);
                $this->assertFalse($this->instance->fileExists('target.txt'));
-               $this->instance->rename('lorem.txt','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'));
index c104460ea4d21845cbb0c83797c01280f2e92fd0..1a1287ff1352af6eb2fdb846e2f25a837d047c12 100644 (file)
@@ -26,22 +26,22 @@ abstract class Test_Cache extends UnitTestCase {
                $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);
                $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);
                $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');
+               $this->assertNull($this->instance->get('not_set'), 'Unset value not equal to null');
 
                $this->assertTrue($this->instance->remove('value1'));
                $this->assertFalse($this->instance->hasKey('value1'));
index 47b18e5b9f42f7186b82b896911aec5888328272..d64627198e0e188d8508c3e01ddebff4f0068ef7 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 9ad397b94a6d8148d8089b38e8bc68568237179d..7b9ca3414b028f40d13b29264eb52be81ab9ded8 100644 (file)
@@ -50,15 +50,15 @@ class Test_Group extends UnitTestCase {
 
                $this->assertFalse(OC_Group::addToGroup($user1, $group1));
 
-               $this->assertEqual(array($user1),OC_Group::usersInGroup($group1));
-               $this->assertEqual(array(),OC_Group::usersInGroup($group2));
+               $this->assertEqual(array($user1), OC_Group::usersInGroup($group1));
+               $this->assertEqual(array(), OC_Group::usersInGroup($group2));
 
-               $this->assertEqual(array($group1),OC_Group::getUserGroups($user1));
-               $this->assertEqual(array(),OC_Group::getUserGroups($user2));
+               $this->assertEqual(array($group1), OC_Group::getUserGroups($user1));
+               $this->assertEqual(array(), OC_Group::getUserGroups($user2));
 
                OC_Group::deleteGroup($group1);
-               $this->assertEqual(array(),OC_Group::getUserGroups($user1));
-               $this->assertEqual(array(),OC_Group::usersInGroup($group1));
+               $this->assertEqual(array(), OC_Group::getUserGroups($user1));
+               $this->assertEqual(array(), OC_Group::usersInGroup($group1));
                $this->assertFalse(OC_Group::inGroup($user1, $group1));
        }
 
@@ -76,13 +76,13 @@ class Test_Group extends UnitTestCase {
                $this->assertEqual(array($group1), $backend1->getGroups());
                $this->assertEqual(array(), $backend2->getGroups());
 
-               $this->assertEqual(array($group1),OC_Group::getGroups());
+               $this->assertEqual(array($group1), OC_Group::getGroups());
                $this->assertTrue(OC_Group::groupExists($group1));
                $this->assertFalse(OC_Group::groupExists($group2));
 
                $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));
 
@@ -101,14 +101,14 @@ class Test_Group extends UnitTestCase {
 
                $this->assertFalse(OC_Group::addToGroup($user1, $group1));
 
-               $this->assertEqual(array($user1),OC_Group::usersInGroup($group1));
+               $this->assertEqual(array($user1), OC_Group::usersInGroup($group1));
 
-               $this->assertEqual(array($group1),OC_Group::getUserGroups($user1));
-               $this->assertEqual(array(),OC_Group::getUserGroups($user2));
+               $this->assertEqual(array($group1), OC_Group::getUserGroups($user1));
+               $this->assertEqual(array(), OC_Group::getUserGroups($user2));
 
                OC_Group::deleteGroup($group1);
-               $this->assertEqual(array(),OC_Group::getUserGroups($user1));
-               $this->assertEqual(array(),OC_Group::usersInGroup($group1));
+               $this->assertEqual(array(), OC_Group::getUserGroups($user1));
+               $this->assertEqual(array(), OC_Group::usersInGroup($group1));
                $this->assertFalse(OC_Group::inGroup($user1, $group1));
        }
 }
index f864a9e3611c51facb55b80e99a92cc398f42acc..89b2785fca6e705bb776d72ea5597f0315dfdfbc 100644 (file)
@@ -22,7 +22,7 @@
 
 class Test_StreamWrappers extends UnitTestCase {
        public function testFakeDir() {
-               $items=array('foo','bar');
+               $items=array('foo', 'bar');
                OC_FakeDirStream::$dirs['test']=$items;
                $dh=opendir('fakedir://test');
                $result=array();
@@ -60,9 +60,9 @@ class Test_StreamWrappers extends UnitTestCase {
                //test callback
                $tmpFile=OC_Helper::TmpFile('.txt');
                $file='close://'.$tmpFile;
-               OC_CloseStreamWrapper::$callBacks[$tmpFile]=array('Test_StreamWrappers','closeCallBack');
-               $fh=fopen($file,'w');
-               fwrite($fh,'asd');
+               OC_CloseStreamWrapper::$callBacks[$tmpFile]=array('Test_StreamWrappers', 'closeCallBack');
+               $fh=fopen($file, 'w');
+               fwrite($fh, 'asd');
                try{
                        fclose($fh);
                        $this->fail('Expected exception');
index eb3aa91b683f4766e79d977b66becc8524c0b0b6..79653481f9099940270ebde9dff74764f8def1d8 100644 (file)
@@ -51,12 +51,12 @@ abstract class Test_User_Backend extends UnitTestCase {
 
                $name1=$this->getUser();
                $name2=$this->getUser();
-               $this->backend->createUser($name1,'');
+               $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->backend->createUser($name2,'');
+               $this->backend->createUser($name2, '');
                $count=count($this->backend->getUsers())-$startCount;
                $this->assertEqual(2, $count);
                $this->assertTrue((array_search($name1, $this->backend->getUsers())!==false));
@@ -76,24 +76,24 @@ abstract class Test_User_Backend extends UnitTestCase {
                $this->assertFalse($this->backend->userExists($name1));
                $this->assertFalse($this->backend->userExists($name2));
                
-               $this->backend->createUser($name1,'pass1');
-               $this->backend->createUser($name2,'pass2');
+               $this->backend->createUser($name1, 'pass1');
+               $this->backend->createUser($name2, 'pass2');
                
                $this->assertTrue($this->backend->userExists($name1));
                $this->assertTrue($this->backend->userExists($name2));
                
-               $this->assertTrue($this->backend->checkPassword($name1,'pass1'));
-               $this->assertTrue($this->backend->checkPassword($name2,'pass2'));
+               $this->assertTrue($this->backend->checkPassword($name1, 'pass1'));
+               $this->assertTrue($this->backend->checkPassword($name2, 'pass2'));
                
-               $this->assertFalse($this->backend->checkPassword($name1,'pass2'));
-               $this->assertFalse($this->backend->checkPassword($name2,'pass1'));
+               $this->assertFalse($this->backend->checkPassword($name1, 'pass2'));
+               $this->assertFalse($this->backend->checkPassword($name2, 'pass1'));
                
-               $this->assertFalse($this->backend->checkPassword($name1,'dummy'));
-               $this->assertFalse($this->backend->checkPassword($name2,'foobar'));
+               $this->assertFalse($this->backend->checkPassword($name1, 'dummy'));
+               $this->assertFalse($this->backend->checkPassword($name2, 'foobar'));
                
-               $this->backend->setPassword($name1,'newpass1');
-               $this->assertFalse($this->backend->checkPassword($name1,'pass1'));
-               $this->assertTrue($this->backend->checkPassword($name1,'newpass1'));
-               $this->assertFalse($this->backend->checkPassword($name2,'newpass1'));
+               $this->backend->setPassword($name1, 'newpass1');
+               $this->assertFalse($this->backend->checkPassword($name1, 'pass1'));
+               $this->assertTrue($this->backend->checkPassword($name1, 'newpass1'));
+               $this->assertFalse($this->backend->checkPassword($name2, 'newpass1'));
        }
 }