aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
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/files_external/lib
parentd9e97610999ddf9f3a060b786f22d0abb054521e (diff)
downloadnextcloud-server-afadf93d317e27fd848f1e70d5849169f862aed9.tar.gz
nextcloud-server-afadf93d317e27fd848f1e70d5849169f862aed9.zip
Checkstyle: many fixes
Diffstat (limited to 'apps/files_external/lib')
-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
6 files changed, 45 insertions, 45 deletions
diff --git a/apps/files_external/lib/config.php b/apps/files_external/lib/config.php
index 9dc3cdd7147..57a6438ff10 100755
--- a/apps/files_external/lib/config.php
+++ b/apps/files_external/lib/config.php
@@ -256,7 +256,7 @@ class OC_Mount_Config {
foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
$content .= "\t\t'".$group."' => array (\n";
foreach ($mounts as $mountPoint => $mount) {
- $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
+ $content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).", \n";
}
$content .= "\t\t),\n";
diff --git a/apps/files_external/lib/ftp.php b/apps/files_external/lib/ftp.php
index 13d1387f287..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);