summaryrefslogtreecommitdiffstats
path: root/lib/filestorage
diff options
context:
space:
mode:
Diffstat (limited to 'lib/filestorage')
-rw-r--r--lib/filestorage/common.php18
-rw-r--r--lib/filestorage/commontest.php6
-rw-r--r--lib/filestorage/local.php28
3 files changed, 26 insertions, 26 deletions
diff --git a/lib/filestorage/common.php b/lib/filestorage/common.php
index cf09ea71e8c..3c06570d890 100644
--- a/lib/filestorage/common.php
+++ b/lib/filestorage/common.php
@@ -89,25 +89,25 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
}
return fread($handle, $size);
}
- public function file_put_contents($path,$data) {
+ public function file_put_contents($path, $data) {
$handle = $this->fopen($path, "w");
return fwrite($handle, $data);
}
// abstract public function unlink($path);
- public function rename($path1,$path2) {
+ public function rename($path1, $path2) {
if($this->copy($path1, $path2)) {
return $this->unlink($path1);
}else{
return false;
}
}
- public function copy($path1,$path2) {
+ public function copy($path1, $path2) {
$source=$this->fopen($path1, 'r');
$target=$this->fopen($path2, 'w');
$count=OC_Helper::streamCopy($source, $target);
return $count>0;
}
-// abstract public function fopen($path,$mode);
+// abstract public function fopen($path, $mode);
/**
* @brief Deletes all files and folders recursively within a directory
@@ -204,7 +204,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
unlink($tmpFile);
return $mime;
}
- public function hash($type,$path,$raw = false) {
+ public function hash($type,$path, $raw = false) {
$tmpFile=$this->getLocalFile();
$hash=hash($type, $tmpFile, $raw);
unlink($tmpFile);
@@ -237,7 +237,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
$this->addLocalFolder($path, $baseDir);
return $baseDir;
}
- private function addLocalFolder($path,$target) {
+ private function addLocalFolder($path, $target) {
if($dh=$this->opendir($path)) {
while($file=readdir($dh)) {
if($file!=='.' and $file!=='..') {
@@ -254,7 +254,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
}
// abstract public function touch($path, $mtime=null);
- protected function searchInDir($query,$dir='') {
+ protected function searchInDir($query, $dir='') {
$files=array();
$dh=$this->opendir($dir);
if($dh) {
@@ -264,7 +264,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
$files[]=$dir.'/'.$item;
}
if($this->is_dir($dir.'/'.$item)) {
- $files=array_merge($files,$this->searchInDir($query,$dir.'/'.$item));
+ $files=array_merge($files,$this->searchInDir($query, $dir.'/'.$item));
}
}
}
@@ -276,7 +276,7 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
* @param int $time
* @return bool
*/
- public function hasUpdated($path,$time) {
+ public function hasUpdated($path, $time) {
return $this->filemtime($path)>$time;
}
diff --git a/lib/filestorage/commontest.php b/lib/filestorage/commontest.php
index b88bb232c36..3b038b3fda9 100644
--- a/lib/filestorage/commontest.php
+++ b/lib/filestorage/commontest.php
@@ -63,13 +63,13 @@ class OC_Filestorage_CommonTest extends OC_Filestorage_Common{
public function unlink($path) {
return $this->storage->unlink($path);
}
- public function fopen($path,$mode) {
- return $this->storage->fopen($path,$mode);
+ public function fopen($path, $mode) {
+ return $this->storage->fopen($path, $mode);
}
public function free_space($path) {
return $this->storage->free_space($path);
}
public function touch($path, $mtime=null) {
- return $this->storage->touch($path,$mtime);
+ return $this->storage->touch($path, $mtime);
}
} \ No newline at end of file
diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php
index 731ac4a3c72..89e994120ca 100644
--- a/lib/filestorage/local.php
+++ b/lib/filestorage/local.php
@@ -21,7 +21,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
}
public function is_dir($path) {
if(substr($path,-1)=='/') {
- $path=substr($path,0,-1);
+ $path=substr($path, 0, -1);
}
return is_dir($this->datadir.$path);
}
@@ -78,13 +78,13 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
public function file_get_contents($path) {
return file_get_contents($this->datadir.$path);
}
- public function file_put_contents($path,$data) {
- return file_put_contents($this->datadir.$path,$data);
+ public function file_put_contents($path, $data) {
+ return file_put_contents($this->datadir.$path, $data);
}
public function unlink($path) {
return $this->delTree($path);
}
- public function rename($path1,$path2) {
+ public function rename($path1, $path2) {
if (!$this->isUpdatable($path1)) {
OC_Log::write('core','unable to rename, file is not writable : '.$path1,OC_Log::ERROR);
return false;
@@ -94,11 +94,11 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
return false;
}
- if($return=rename($this->datadir.$path1,$this->datadir.$path2)) {
+ if($return=rename($this->datadir.$path1, $this->datadir.$path2)) {
}
return $return;
}
- public function copy($path1,$path2) {
+ public function copy($path1, $path2) {
if($this->is_dir($path2)) {
if(!$this->file_exists($path2)) {
$this->mkdir($path2);
@@ -106,10 +106,10 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
$source=substr($path1, strrpos($path1,'/')+1);
$path2.=$source;
}
- return copy($this->datadir.$path1,$this->datadir.$path2);
+ return copy($this->datadir.$path1, $this->datadir.$path2);
}
- public function fopen($path,$mode) {
- if($return=fopen($this->datadir.$path,$mode)) {
+ public function fopen($path, $mode) {
+ if($return=fopen($this->datadir.$path, $mode)) {
switch($mode) {
case 'r':
break;
@@ -156,8 +156,8 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
return $return;
}
- public function hash($path,$type,$raw=false) {
- return hash_file($type,$this->datadir.$path,$raw);
+ public function hash($path,$type, $raw=false) {
+ return hash_file($type,$this->datadir.$path, $raw);
}
public function free_space($path) {
@@ -174,7 +174,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
return $this->datadir.$path;
}
- protected function searchInDir($query,$dir='') {
+ protected function searchInDir($query, $dir='') {
$files=array();
foreach (scandir($this->datadir.$dir) as $item) {
if ($item == '.' || $item == '..') continue;
@@ -182,7 +182,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
$files[]=$dir.'/'.$item;
}
if(is_dir($this->datadir.$dir.'/'.$item)) {
- $files=array_merge($files,$this->searchInDir($query,$dir.'/'.$item));
+ $files=array_merge($files,$this->searchInDir($query, $dir.'/'.$item));
}
}
return $files;
@@ -193,7 +193,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
* @param int $time
* @return bool
*/
- public function hasUpdated($path,$time) {
+ public function hasUpdated($path, $time) {
return $this->filemtime($path)>$time;
}
}