summaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib/swift.php
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/swift.php
parentd9e97610999ddf9f3a060b786f22d0abb054521e (diff)
downloadnextcloud-server-afadf93d317e27fd848f1e70d5849169f862aed9.tar.gz
nextcloud-server-afadf93d317e27fd848f1e70d5849169f862aed9.zip
Checkstyle: many fixes
Diffstat (limited to 'apps/files_external/lib/swift.php')
-rw-r--r--apps/files_external/lib/swift.php38
1 files changed, 19 insertions, 19 deletions
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);