summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFelix Moeller <mail@felixmoeller.de>2012-11-02 19:53:02 +0100
committerFelix Moeller <mail@felixmoeller.de>2012-11-02 19:53:02 +0100
commitafadf93d317e27fd848f1e70d5849169f862aed9 (patch)
tree4a9ed633a7735a1be3cf33fdad31ab981fd64a6b /apps
parentd9e97610999ddf9f3a060b786f22d0abb054521e (diff)
downloadnextcloud-server-afadf93d317e27fd848f1e70d5849169f862aed9.tar.gz
nextcloud-server-afadf93d317e27fd848f1e70d5849169f862aed9.zip
Checkstyle: many fixes
Diffstat (limited to 'apps')
-rw-r--r--apps/files/appinfo/filesync.php2
-rw-r--r--apps/files/download.php2
-rw-r--r--apps/files/index.php2
-rw-r--r--apps/files_encryption/lib/crypt.php8
-rw-r--r--apps/files_encryption/lib/cryptstream.php2
-rw-r--r--apps/files_encryption/lib/proxy.php16
-rw-r--r--apps/files_encryption/settings.php4
-rw-r--r--apps/files_encryption/tests/encryption.php60
-rw-r--r--apps/files_encryption/tests/proxy.php26
-rw-r--r--apps/files_encryption/tests/stream.php24
-rwxr-xr-xapps/files_external/lib/config.php2
-rw-r--r--apps/files_external/lib/ftp.php8
-rw-r--r--apps/files_external/lib/smb.php10
-rw-r--r--apps/files_external/lib/streamwrapper.php18
-rw-r--r--apps/files_external/lib/swift.php38
-rw-r--r--apps/files_external/lib/webdav.php14
-rw-r--r--apps/files_sharing/lib/sharedstorage.php2
-rw-r--r--apps/files_versions/lib/hooks.php2
-rw-r--r--apps/files_versions/lib/versions.php8
-rw-r--r--apps/user_ldap/lib/connection.php4
-rwxr-xr-xapps/user_webdavauth/user_webdavauth.php6
21 files changed, 129 insertions, 129 deletions
diff --git a/apps/files/appinfo/filesync.php b/apps/files/appinfo/filesync.php
index 47fc6fb4de6..dfafe3f9561 100644
--- a/apps/files/appinfo/filesync.php
+++ b/apps/files/appinfo/filesync.php
@@ -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);
diff --git a/apps/files/download.php b/apps/files/download.php
index ff6aefbbe0f..0d632c9b2c2 100644
--- a/apps/files/download.php
+++ b/apps/files/download.php
@@ -32,7 +32,7 @@ $filename = $_GET["file"];
if(!OC_Filesystem::file_exists($filename)) {
header("HTTP/1.0 404 Not Found");
$tmpl = new OCP\Template( '', '404', 'guest' );
- $tmpl->assign('file',$filename);
+ $tmpl->assign('file', $filename);
$tmpl->printPage();
exit;
}
diff --git a/apps/files/index.php b/apps/files/index.php
index 8b8b0fd7610..51fe6b0379c 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -86,7 +86,7 @@ $post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace=OC_Filesystem::free_space($dir);
-$freeSpace=max($freeSpace,0);
+$freeSpace=max($freeSpace, 0);
$maxUploadFilesize = min($maxUploadFilesize, $freeSpace);
$permissions = OCP\Share::PERMISSION_READ;
diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 28bf3c5c93e..d8e7e4d1dd9 100644
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -43,7 +43,7 @@ class OC_Crypt {
self::init($params['uid'], $params['password']);
}
- public static function init($login,$password) {
+ public static function init($login, $password) {
$view=new OC_FilesystemView('/');
if(!$view->file_exists('/'.$login)) {
$view->mkdir('/'.$login);
@@ -195,7 +195,7 @@ class OC_Crypt {
public static function blockEncrypt($data, $key='') {
$result='';
while(strlen($data)) {
- $result.=self::encrypt(substr($data, 0, 8192),$key);
+ $result.=self::encrypt(substr($data, 0, 8192), $key);
$data=substr($data, 8192);
}
return $result;
@@ -204,10 +204,10 @@ class OC_Crypt {
/**
* decrypt data in 8192b sized blocks
*/
- public static function blockDecrypt($data, $key='',$maxLength=0) {
+ public static function blockDecrypt($data, $key='', $maxLength=0) {
$result='';
while(strlen($data)) {
- $result.=self::decrypt(substr($data, 0, 8192),$key);
+ $result.=self::decrypt(substr($data, 0, 8192), $key);
$data=substr($data, 8192);
}
if($maxLength>0) {
diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php
index 0dd2d4b7b1e..3170cff366c 100644
--- a/apps/files_encryption/lib/cryptstream.php
+++ b/apps/files_encryption/lib/cryptstream.php
@@ -106,7 +106,7 @@ class OC_CryptStream{
if($currentPos%8192!=0) {
//make sure we always start on a block start
fseek($this->source, -($currentPos%8192), SEEK_CUR);
- $encryptedBlock=fread($this->source,8192);
+ $encryptedBlock=fread($this->source, 8192);
fseek($this->source, -($currentPos%8192), SEEK_CUR);
$block=OC_Crypt::decrypt($encryptedBlock);
$data=substr($block, 0, $currentPos%8192).$data;
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 61b87ab5463..fed6acaf91b 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -76,7 +76,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
public function postFile_get_contents($path,$data) {
if(self::isEncrypted($path)) {
$cached=OC_FileCache_Cached::get($path,'');
- $data=OC_Crypt::blockDecrypt($data,'',$cached['size']);
+ $data=OC_Crypt::blockDecrypt($data, '', $cached['size']);
}
return $data;
}
@@ -88,30 +88,30 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
$meta=stream_get_meta_data($result);
if(self::isEncrypted($path)) {
fclose($result);
- $result=fopen('crypt://'.$path,$meta['mode']);
+ $result=fopen('crypt://'.$path, $meta['mode']);
}elseif(self::shouldEncrypt($path) and $meta['mode']!='r' and $meta['mode']!='rb') {
if(OC_Filesystem::file_exists($path) and OC_Filesystem::filesize($path)>0) {
//first encrypt the target file so we don't end up with a half encrypted file
OCP\Util::writeLog('files_encryption','Decrypting '.$path.' before writing',OCP\Util::DEBUG);
$tmp=fopen('php://temp');
- OCP\Files::streamCopy($result,$tmp);
+ OCP\Files::streamCopy($result, $tmp);
fclose($result);
- OC_Filesystem::file_put_contents($path,$tmp);
+ OC_Filesystem::file_put_contents($path, $tmp);
fclose($tmp);
}
- $result=fopen('crypt://'.$path,$meta['mode']);
+ $result=fopen('crypt://'.$path, $meta['mode']);
}
return $result;
}
- public function postGetMimeType($path,$mime) {
+ public function postGetMimeType($path, $mime) {
if(self::isEncrypted($path)) {
$mime=OCP\Files::getMimeType('crypt://'.$path,'w');
}
return $mime;
}
- public function postStat($path,$data) {
+ public function postStat($path, $data) {
if(self::isEncrypted($path)) {
$cached=OC_FileCache_Cached::get($path,'');
$data['size']=$cached['size'];
@@ -119,7 +119,7 @@ class OC_FileProxy_Encryption extends OC_FileProxy{
return $data;
}
- public function postFileSize($path,$size) {
+ public function postFileSize($path, $size) {
if(self::isEncrypted($path)) {
$cached=OC_FileCache_Cached::get($path,'');
return $cached['size'];
diff --git a/apps/files_encryption/settings.php b/apps/files_encryption/settings.php
index 168124a8d22..ab9324dee44 100644
--- a/apps/files_encryption/settings.php
+++ b/apps/files_encryption/settings.php
@@ -9,8 +9,8 @@
$tmpl = new OCP\Template( 'files_encryption', 'settings');
$blackList=explode(',', OCP\Config::getAppValue('files_encryption', 'type_blacklist', 'jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
$enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');
-$tmpl->assign('blacklist',$blackList);
-$tmpl->assign('encryption_enabled',$enabled);
+$tmpl->assign('blacklist', $blackList);
+$tmpl->assign('encryption_enabled', $enabled);
OCP\Util::addscript('files_encryption','settings');
OCP\Util::addscript('core','multiselect');
diff --git a/apps/files_encryption/tests/encryption.php b/apps/files_encryption/tests/encryption.php
index a7bc2df0e12..b714b00b8f2 100644
--- a/apps/files_encryption/tests/encryption.php
+++ b/apps/files_encryption/tests/encryption.php
@@ -11,46 +11,46 @@ class Test_Encryption extends UnitTestCase {
$key=uniqid();
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$source=file_get_contents($file); //nice large text file
- $encrypted=OC_Crypt::encrypt($source,$key);
- $decrypted=OC_Crypt::decrypt($encrypted,$key);
+ $encrypted=OC_Crypt::encrypt($source, $key);
+ $decrypted=OC_Crypt::decrypt($encrypted, $key);
$decrypted=rtrim($decrypted, "\0");
- $this->assertNotEqual($encrypted,$source);
- $this->assertEqual($decrypted,$source);
+ $this->assertNotEqual($encrypted, $source);
+ $this->assertEqual($decrypted, $source);
- $chunk=substr($source,0,8192);
- $encrypted=OC_Crypt::encrypt($chunk,$key);
+ $chunk=substr($source,0, 8192);
+ $encrypted=OC_Crypt::encrypt($chunk, $key);
$this->assertEqual(strlen($chunk), strlen($encrypted));
- $decrypted=OC_Crypt::decrypt($encrypted,$key);
+ $decrypted=OC_Crypt::decrypt($encrypted, $key);
$decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted,$chunk);
+ $this->assertEqual($decrypted, $chunk);
- $encrypted=OC_Crypt::blockEncrypt($source,$key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
- $this->assertNotEqual($encrypted,$source);
- $this->assertEqual($decrypted,$source);
+ $encrypted=OC_Crypt::blockEncrypt($source, $key);
+ $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+ $this->assertNotEqual($encrypted, $source);
+ $this->assertEqual($decrypted, $source);
$tmpFileEncrypted=OCP\Files::tmpFile();
- OC_Crypt::encryptfile($file,$tmpFileEncrypted,$key);
+ OC_Crypt::encryptfile($file,$tmpFileEncrypted, $key);
$encrypted=file_get_contents($tmpFileEncrypted);
- $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
- $this->assertNotEqual($encrypted,$source);
- $this->assertEqual($decrypted,$source);
+ $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+ $this->assertNotEqual($encrypted, $source);
+ $this->assertEqual($decrypted, $source);
$tmpFileDecrypted=OCP\Files::tmpFile();
- OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted,$key);
+ OC_Crypt::decryptfile($tmpFileEncrypted,$tmpFileDecrypted, $key);
$decrypted=file_get_contents($tmpFileDecrypted);
- $this->assertEqual($decrypted,$source);
+ $this->assertEqual($decrypted, $source);
$file=OC::$SERVERROOT.'/core/img/weather-clear.png';
$source=file_get_contents($file); //binary file
- $encrypted=OC_Crypt::encrypt($source,$key);
- $decrypted=OC_Crypt::decrypt($encrypted,$key);
+ $encrypted=OC_Crypt::encrypt($source, $key);
+ $decrypted=OC_Crypt::decrypt($encrypted, $key);
$decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted,$source);
+ $this->assertEqual($decrypted, $source);
- $encrypted=OC_Crypt::blockEncrypt($source,$key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted,$key);
- $this->assertEqual($decrypted,$source);
+ $encrypted=OC_Crypt::blockEncrypt($source, $key);
+ $decrypted=OC_Crypt::blockDecrypt($encrypted, $key);
+ $this->assertEqual($decrypted, $source);
}
@@ -59,14 +59,14 @@ class Test_Encryption extends UnitTestCase {
$file=__DIR__.'/binary';
$source=file_get_contents($file); //binary file
- $encrypted=OC_Crypt::encrypt($source,$key);
- $decrypted=OC_Crypt::decrypt($encrypted,$key);
+ $encrypted=OC_Crypt::encrypt($source, $key);
+ $decrypted=OC_Crypt::decrypt($encrypted, $key);
$decrypted=rtrim($decrypted, "\0");
- $this->assertEqual($decrypted,$source);
+ $this->assertEqual($decrypted, $source);
- $encrypted=OC_Crypt::blockEncrypt($source,$key);
- $decrypted=OC_Crypt::blockDecrypt($encrypted,$key, strlen($source));
- $this->assertEqual($decrypted,$source);
+ $encrypted=OC_Crypt::blockEncrypt($source, $key);
+ $decrypted=OC_Crypt::blockDecrypt($encrypted, $key, strlen($source));
+ $this->assertEqual($decrypted, $source);
}
}
diff --git a/apps/files_encryption/tests/proxy.php b/apps/files_encryption/tests/proxy.php
index c3c8f4a2db0..25427ff4b97 100644
--- a/apps/files_encryption/tests/proxy.php
+++ b/apps/files_encryption/tests/proxy.php
@@ -41,7 +41,7 @@ class Test_CryptProxy extends UnitTestCase {
}
public function tearDown() {
- OCP\Config::setAppValue('files_encryption','enable_encryption',$this->oldConfig);
+ OCP\Config::setAppValue('files_encryption', 'enable_encryption', $this->oldConfig);
if(!is_null($this->oldKey)) {
$_SESSION['enckey']=$this->oldKey;
}
@@ -51,16 +51,16 @@ class Test_CryptProxy extends UnitTestCase {
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$original=file_get_contents($file);
- OC_Filesystem::file_put_contents('/file',$original);
+ OC_Filesystem::file_put_contents('/file', $original);
OC_FileProxy::$enabled=false;
$stored=OC_Filesystem::file_get_contents('/file');
OC_FileProxy::$enabled=true;
$fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original,$stored);
+ $this->assertNotEqual($original, $stored);
$this->assertEqual(strlen($original), strlen($fromFile));
- $this->assertEqual($original,$fromFile);
+ $this->assertEqual($original, $fromFile);
}
@@ -72,46 +72,46 @@ class Test_CryptProxy extends UnitTestCase {
$view=new OC_FilesystemView('/'.OC_User::getUser());
$userDir='/'.OC_User::getUser().'/files';
- $rootView->file_put_contents($userDir.'/file',$original);
+ $rootView->file_put_contents($userDir.'/file', $original);
OC_FileProxy::$enabled=false;
$stored=$rootView->file_get_contents($userDir.'/file');
OC_FileProxy::$enabled=true;
- $this->assertNotEqual($original,$stored);
+ $this->assertNotEqual($original, $stored);
$fromFile=$rootView->file_get_contents($userDir.'/file');
- $this->assertEqual($original,$fromFile);
+ $this->assertEqual($original, $fromFile);
$fromFile=$view->file_get_contents('files/file');
- $this->assertEqual($original,$fromFile);
+ $this->assertEqual($original, $fromFile);
}
public function testBinary() {
$file=__DIR__.'/binary';
$original=file_get_contents($file);
- OC_Filesystem::file_put_contents('/file',$original);
+ OC_Filesystem::file_put_contents('/file', $original);
OC_FileProxy::$enabled=false;
$stored=OC_Filesystem::file_get_contents('/file');
OC_FileProxy::$enabled=true;
$fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original,$stored);
+ $this->assertNotEqual($original, $stored);
$this->assertEqual(strlen($original), strlen($fromFile));
- $this->assertEqual($original,$fromFile);
+ $this->assertEqual($original, $fromFile);
$file=__DIR__.'/zeros';
$original=file_get_contents($file);
- OC_Filesystem::file_put_contents('/file',$original);
+ OC_Filesystem::file_put_contents('/file', $original);
OC_FileProxy::$enabled=false;
$stored=OC_Filesystem::file_get_contents('/file');
OC_FileProxy::$enabled=true;
$fromFile=OC_Filesystem::file_get_contents('/file');
- $this->assertNotEqual($original,$stored);
+ $this->assertNotEqual($original, $stored);
$this->assertEqual(strlen($original), strlen($fromFile));
}
}
diff --git a/apps/files_encryption/tests/stream.php b/apps/files_encryption/tests/stream.php
index 5ea0da48017..2caebf912ed 100644
--- a/apps/files_encryption/tests/stream.php
+++ b/apps/files_encryption/tests/stream.php
@@ -15,14 +15,14 @@ class Test_CryptStream extends UnitTestCase {
fclose($stream);
$stream=$this->getStream('test1','r', strlen('foobar'));
- $data=fread($stream,6);
+ $data=fread($stream, 6);
fclose($stream);
- $this->assertEqual('foobar',$data);
+ $this->assertEqual('foobar', $data);
$file=OC::$SERVERROOT.'/3rdparty/MDB2.php';
$source=fopen($file,'r');
- $target=$this->getStream('test2','w',0);
- OCP\Files::streamCopy($source,$target);
+ $target=$this->getStream('test2', 'w', 0);
+ OCP\Files::streamCopy($source, $target);
fclose($target);
fclose($source);
@@ -30,7 +30,7 @@ class Test_CryptStream extends UnitTestCase {
$data=stream_get_contents($stream);
$original=file_get_contents($file);
$this->assertEqual(strlen($original), strlen($data));
- $this->assertEqual($original,$data);
+ $this->assertEqual($original, $data);
}
/**
@@ -40,7 +40,7 @@ class Test_CryptStream extends UnitTestCase {
* @param int size
* @return resource
*/
- function getStream($id,$mode,$size) {
+ function getStream($id, $mode, $size) {
if($id==='') {
$id=uniqid();
}
@@ -50,9 +50,9 @@ class Test_CryptStream extends UnitTestCase {
}else{
$file=$this->tmpFiles[$id];
}
- $stream=fopen($file,$mode);
+ $stream=fopen($file, $mode);
OC_CryptStream::$sourceStreams[$id]=array('path'=>'dummy'.$id,'stream'=>$stream,'size'=>$size);
- return fopen('crypt://streams/'.$id,$mode);
+ return fopen('crypt://streams/'.$id, $mode);
}
function testBinary() {
@@ -60,26 +60,26 @@ class Test_CryptStream extends UnitTestCase {
$source=file_get_contents($file);
$stream=$this->getStream('test','w', strlen($source));
- fwrite($stream,$source);
+ fwrite($stream, $source);
fclose($stream);
$stream=$this->getStream('test','r', strlen($source));
$data=stream_get_contents($stream);
fclose($stream);
$this->assertEqual(strlen($data), strlen($source));
- $this->assertEqual($source,$data);
+ $this->assertEqual($source, $data);
$file=__DIR__.'/zeros';
$source=file_get_contents($file);
$stream=$this->getStream('test2','w', strlen($source));
- fwrite($stream,$source);
+ fwrite($stream, $source);
fclose($stream);
$stream=$this->getStream('test2','r', strlen($source));
$data=stream_get_contents($stream);
fclose($stream);
$this->assertEqual(strlen($data), strlen($source));
- $this->assertEqual($source,$data);
+ $this->assertEqual($source, $data);
}
}
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 9dc3cdd7147..57a6438ff10 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -256,7 +256,7 @@ class OC_Mount_Config {
foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
$content .= "\t\t'".$group."' => array (\n";
foreach ($mounts as $mountPoint => $mount) {
- $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
+ $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).", \n";
}
$content .= "\t\t),\n";
diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php
index 13d1387f287..8a67b31b20b 100644
--- a/apps/files_external/lib/ftp.php
+++ b/apps/files_external/lib/ftp.php
@@ -43,7 +43,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
$url.='://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path;
return $url;
}
- public function fopen($path,$mode) {
+ public function fopen($path, $mode) {
switch($mode) {
case 'r':
case 'rb':
@@ -53,7 +53,7 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
case 'ab':
//these are supported by the wrapper
$context = stream_context_create(array('ftp' => array('overwrite' => true)));
- return fopen($this->constructUrl($path),$mode, false,$context);
+ return fopen($this->constructUrl($path),$mode, false, $context);
case 'r+':
case 'w+':
case 'wb+':
@@ -71,10 +71,10 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
$tmpFile=OCP\Files::tmpFile($ext);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
if($this->file_exists($path)) {
- $this->getFile($path,$tmpFile);
+ $this->getFile($path, $tmpFile);
}
self::$tempFiles[$tmpFile]=$path;
- return fopen('close://'.$tmpFile,$mode);
+ return fopen('close://'.$tmpFile, $mode);
}
}
diff --git a/apps/files_external/lib/smb.php b/apps/files_external/lib/smb.php
index eed2582dc99..d7636894347 100644
--- a/apps/files_external/lib/smb.php
+++ b/apps/files_external/lib/smb.php
@@ -24,14 +24,14 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
}
- if(substr($this->root,-1,1)!='/') {
+ if(substr($this->root,-1, 1)!='/') {
$this->root.='/';
}
if(!$this->share || $this->share[0]!='/') {
$this->share='/'.$this->share;
}
- if(substr($this->share,-1,1)=='/') {
- $this->share=substr($this->share,0,-1);
+ if(substr($this->share, -1, 1)=='/') {
+ $this->share=substr($this->share, 0, -1);
}
//create the root folder if necesary
@@ -42,7 +42,7 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
public function constructUrl($path) {
if(substr($path,-1)=='/') {
- $path=substr($path,0,-1);
+ $path=substr($path, 0, -1);
}
return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path;
}
@@ -67,7 +67,7 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
* @param int $time
* @return bool
*/
- public function hasUpdated($path,$time) {
+ public function hasUpdated($path, $time) {
if(!$path and $this->root=='/') {
//mtime doesn't work for shares, but giving the nature of the backend, doing a full update is still just fast enough
return true;
diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php
index 7263ef23253..7961ecbe1b7 100644
--- a/apps/files_external/lib/streamwrapper.php
+++ b/apps/files_external/lib/streamwrapper.php
@@ -50,15 +50,15 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{
return $succes;
}
- public function fopen($path,$mode) {
- return fopen($this->constructUrl($path),$mode);
+ public function fopen($path, $mode) {
+ return fopen($this->constructUrl($path), $mode);
}
public function free_space($path) {
return 0;
}
- public function touch($path,$mtime=null) {
+ public function touch($path, $mtime=null) {
if(is_null($mtime)) {
$fh=$this->fopen($path,'a');
fwrite($fh,'');
@@ -68,16 +68,16 @@ abstract class OC_FileStorage_StreamWrapper extends OC_Filestorage_Common{
}
}
- public function getFile($path,$target) {
- return copy($this->constructUrl($path),$target);
+ public function getFile($path, $target) {
+ return copy($this->constructUrl($path), $target);
}
- public function uploadFile($path,$target) {
- return copy($path,$this->constructUrl($target));
+ public function uploadFile($path, $target) {
+ return copy($path, $this->constructUrl($target));
}
- public function rename($path1,$path2) {
- return rename($this->constructUrl($path1),$this->constructUrl($path2));
+ public function rename($path1, $path2) {
+ return rename($this->constructUrl($path1), $this->constructUrl($path2));
}
public function stat($path) {
diff --git a/apps/files_external/lib/swift.php b/apps/files_external/lib/swift.php
index 632c72c280f..c04de45d404 100644
--- a/apps/files_external/lib/swift.php
+++ b/apps/files_external/lib/swift.php
@@ -40,7 +40,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
*/
private function getContainerName($path) {
$path=trim(trim($this->root,'/')."/".$path,'/.');
- return str_replace('/','\\',$path);
+ return str_replace('/', '\\', $path);
}
/**
@@ -189,7 +189,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string name
* @return bool
*/
- private function addSubContainer($container,$name) {
+ private function addSubContainer($container, $name) {
if(!$name) {
return false;
}
@@ -201,16 +201,16 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
foreach($containers as &$sub) {
$sub=trim($sub);
}
- if(array_search($name,$containers)!==false) {
+ if(array_search($name, $containers)!==false) {
unlink($tmpFile);
return false;
}else{
$fh=fopen($tmpFile,'a');
- fwrite($fh,$name."\n");
+ fwrite($fh, $name."\n");
}
}catch(Exception $e) {
$containers=array();
- file_put_contents($tmpFile,$name."\n");
+ file_put_contents($tmpFile, $name."\n");
}
$obj->load_from_filename($tmpFile);
@@ -224,7 +224,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @param string name
* @return bool
*/
- private function removeSubContainer($container,$name) {
+ private function removeSubContainer($container, $name) {
if(!$name) {
return false;
}
@@ -239,13 +239,13 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
foreach($containers as &$sub) {
$sub=trim($sub);
}
- $i=array_search($name,$containers);
+ $i=array_search($name, $containers);
if($i===false) {
unlink($tmpFile);
return false;
}else{
unset($containers[$i]);
- file_put_contents($tmpFile, implode("\n",$containers)."\n");
+ file_put_contents($tmpFile, implode("\n", $containers)."\n");
}
$obj->load_from_filename($tmpFile);
@@ -337,12 +337,12 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
public function opendir($path) {
$container=$this->getContainer($path);
$files=$this->getObjects($container);
- $i=array_search(self::SUBCONTAINER_FILE,$files);
+ $i=array_search(self::SUBCONTAINER_FILE, $files);
if($i!==false) {
unset($files[$i]);
}
$subContainers=$this->getSubContainers($container);
- $files=array_merge($files,$subContainers);
+ $files=array_merge($files, $subContainers);
$id=$this->getContainerName($path);
OC_FakeDirStream::$dirs[$id]=$files;
return opendir('fakedir://'.$id);
@@ -380,7 +380,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
return $obj->read();
}
- public function file_put_contents($path,$content) {
+ public function file_put_contents($path, $content) {
$obj=$this->getObject($path);
if(is_null($obj)) {
$container=$this->getContainer(dirname($path));
@@ -406,7 +406,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
}
}
- public function fopen($path,$mode) {
+ public function fopen($path, $mode) {
switch($mode) {
case 'r':
case 'rb':
@@ -434,7 +434,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$tmpFile=$this->getTmpFile($path);
OC_CloseStreamWrapper::$callBacks[$tmpFile]=array($this,'writeBack');
self::$tempFiles[$tmpFile]=$path;
- return fopen('close://'.$tmpFile,$mode);
+ return fopen('close://'.$tmpFile, $mode);
}
}
@@ -449,7 +449,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
return 1024*1024*1024*8;
}
- public function touch($path,$mtime=null) {
+ public function touch($path, $mtime=null) {
$obj=$this->getObject($path);
if(is_null($obj)) {
return false;
@@ -463,10 +463,10 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$obj->sync_metadata();
}
- public function rename($path1,$path2) {
+ public function rename($path1, $path2) {
$sourceContainer=$this->getContainer(dirname($path1));
$targetContainer=$this->getContainer(dirname($path2));
- $result=$sourceContainer->move_object_to(basename($path1),$targetContainer, basename($path2));
+ $result=$sourceContainer->move_object_to(basename($path1), $targetContainer, basename($path2));
unset($this->objects[$path1]);
if($result) {
$targetObj=$this->getObject($path2);
@@ -475,10 +475,10 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
return $result;
}
- public function copy($path1,$path2) {
+ public function copy($path1, $path2) {
$sourceContainer=$this->getContainer(dirname($path1));
$targetContainer=$this->getContainer(dirname($path2));
- $result=$sourceContainer->copy_object_to(basename($path1),$targetContainer, basename($path2));
+ $result=$sourceContainer->copy_object_to(basename($path1), $targetContainer, basename($path2));
if($result) {
$targetObj=$this->getObject($path2);
$this->resetMTime($targetObj);
@@ -525,7 +525,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
}
}
- private function fromTmpFile($tmpFile,$path) {
+ private function fromTmpFile($tmpFile, $path) {
$obj=$this->getObject($path);
if(is_null($obj)) {
$obj=$this->createObject($path);
diff --git a/apps/files_external/lib/webdav.php b/apps/files_external/lib/webdav.php
index e29ec6cb8a2..3d2ea7fa2a2 100644
--- a/apps/files_external/lib/webdav.php
+++ b/apps/files_external/lib/webdav.php
@@ -126,7 +126,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
return $this->simpleResponse('DELETE', $path, null, 204);
}
- public function fopen($path,$mode) {
+ public function fopen($path, $mode) {
$path=$this->cleanPath($path);
switch($mode) {
case 'r':
@@ -194,7 +194,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
}
}
- public function touch($path,$mtime=null) {
+ public function touch($path, $mtime=null) {
if(is_null($mtime)) {
$mtime=time();
}
@@ -202,12 +202,12 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$this->client->proppatch($path, array('{DAV:}lastmodified' => $mtime));
}
- public function getFile($path,$target) {
+ public function getFile($path, $target) {
$source=$this->fopen($path, 'r');
file_put_contents($target, $source);
}
- public function uploadFile($path,$target) {
+ public function uploadFile($path, $target) {
$source=fopen($path, 'r');
$curl = curl_init();
@@ -221,7 +221,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
curl_close ($curl);
}
- public function rename($path1,$path2) {
+ public function rename($path1, $path2) {
$path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2);
try{
@@ -235,7 +235,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
}
}
- public function copy($path1,$path2) {
+ public function copy($path1, $path2) {
$path1=$this->cleanPath($path1);
$path2=$this->root.$this->cleanPath($path2);
try{
@@ -289,7 +289,7 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
}
}
- private function simpleResponse($method,$path,$body,$expected) {
+ private function simpleResponse($method, $path, $body, $expected) {
$path=$this->cleanPath($path);
try{
$response=$this->client->request($method, $path, $body);
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 7271dcc930b..ac6fb1f683e 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -451,7 +451,7 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
* @param int $time
* @return bool
*/
- public function hasUpdated($path,$time) {
+ public function hasUpdated($path, $time) {
//TODO
return false;
}
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php
index 822103ebc32..e897a81f7af 100644
--- a/apps/files_versions/lib/hooks.php
+++ b/apps/files_versions/lib/hooks.php
@@ -64,7 +64,7 @@ class Hooks {
$abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$params['newpath'].'.v';
if(Storage::isversioned($rel_oldpath)) {
$info=pathinfo($abs_newpath);
- if(!file_exists($info['dirname'])) mkdir($info['dirname'],0750, true);
+ if(!file_exists($info['dirname'])) mkdir($info['dirname'], 0750, true);
$versions = Storage::getVersions($rel_oldpath);
foreach ($versions as $v) {
rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 2f27cd0e667..8ee147d0854 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -73,7 +73,7 @@ class Storage {
}
// check filetype blacklist
- $blacklist=explode(' ',\OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
+ $blacklist=explode(' ', \OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
foreach($blacklist as $bl) {
$parts=explode('.', $filename);
$ext=end($parts);
@@ -99,7 +99,7 @@ class Storage {
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('');
$matches=glob($versionsName.'.v*');
sort($matches);
- $parts=explode('.v',end($matches));
+ $parts=explode('.v', end($matches));
if((end($parts)+Storage::DEFAULTMININTERVAL)>time()) {
return false;
}
@@ -109,7 +109,7 @@ class Storage {
// create all parent folders
$info=pathinfo($filename);
if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {
- mkdir($versionsFolderName.'/'.$info['dirname'],0750,true);
+ mkdir($versionsFolderName.'/'.$info['dirname'],0750, true);
}
// store a new version of a file
@@ -124,7 +124,7 @@ class Storage {
/**
* rollback to an old version of a file.
*/
- public static function rollback($filename,$revision) {
+ public static function rollback($filename, $revision) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index a570b29b793..74ff55355b2 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -188,9 +188,9 @@ class Connection {
$this->config['ldapAgentName'] = \OCP\Config::getAppValue($this->configID, 'ldap_dn','');
$this->config['ldapAgentPassword'] = base64_decode(\OCP\Config::getAppValue($this->configID, 'ldap_agent_password',''));
$this->config['ldapBase'] = \OCP\Config::getAppValue($this->configID, 'ldap_base', '');
- $this->config['ldapBaseUsers'] = \OCP\Config::getAppValue($this->configID, 'ldap_base_users',$this->config['ldapBase']);
+ $this->config['ldapBaseUsers'] = \OCP\Config::getAppValue($this->configID, 'ldap_base_users', $this->config['ldapBase']);
$this->config['ldapBaseGroups'] = \OCP\Config::getAppValue($this->configID, 'ldap_base_groups', $this->config['ldapBase']);
- $this->config['ldapTLS'] = \OCP\Config::getAppValue($this->configID, 'ldap_tls',0);
+ $this->config['ldapTLS'] = \OCP\Config::getAppValue($this->configID, 'ldap_tls', 0);
$this->config['ldapNoCase'] = \OCP\Config::getAppValue($this->configID, 'ldap_nocase', 0);
$this->config['turnOffCertCheck'] = \OCP\Config::getAppValue($this->configID, 'ldap_turn_off_cert_check', 0);
$this->config['ldapUserDisplayName'] = mb_strtolower(\OCP\Config::getAppValue($this->configID, 'ldap_display_name', 'uid'), 'UTF-8');
diff --git a/apps/user_webdavauth/user_webdavauth.php b/apps/user_webdavauth/user_webdavauth.php
index bd9f45d357b..5a16a4c992a 100755
--- a/apps/user_webdavauth/user_webdavauth.php
+++ b/apps/user_webdavauth/user_webdavauth.php
@@ -30,19 +30,19 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
public function createUser() {
// Can't create user
- OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend',3);
+ OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend', 3);
return false;
}
public function deleteUser() {
// Can't delete user
- OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend',3);
+ OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend', 3);
return false;
}
public function setPassword ( $uid, $password ) {
// We can't change user password
- OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend',3);
+ OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend', 3);
return false;
}