summaryrefslogtreecommitdiffstats
path: root/lib/files/storage/local.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-11-07 17:18:56 +0100
committerRobin Appelman <icewind@owncloud.com>2012-11-07 17:18:56 +0100
commit961ff01a93dd69cb12196a1b8507cce925e74fbc (patch)
tree4956c9a42d6286b0851ca73641439e5c002f6a9a /lib/files/storage/local.php
parent4b940955ddb3266f625eae83da412a655efef319 (diff)
parent5cad2d7ccc3d2b4ccd9e1b090e28787f1c28b6ca (diff)
downloadnextcloud-server-961ff01a93dd69cb12196a1b8507cce925e74fbc.tar.gz
nextcloud-server-961ff01a93dd69cb12196a1b8507cce925e74fbc.zip
merge master into filesystem
Diffstat (limited to 'lib/files/storage/local.php')
-rw-r--r--lib/files/storage/local.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/files/storage/local.php b/lib/files/storage/local.php
index 71f3bedad39..e888094627a 100644
--- a/lib/files/storage/local.php
+++ b/lib/files/storage/local.php
@@ -15,7 +15,7 @@ class Local extends \OC\Files\Storage\Common{
protected $datadir;
public function __construct($arguments) {
$this->datadir=$arguments['datadir'];
- if(substr($this->datadir,-1)!=='/') {
+ if(substr($this->datadir, -1)!=='/') {
$this->datadir.='/';
}
}
@@ -33,7 +33,7 @@ class Local extends \OC\Files\Storage\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);
}
@@ -87,13 +87,13 @@ class Local extends \OC\Files\Storage\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;
@@ -103,22 +103,22 @@ class Local extends \OC\Files\Storage\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);
}
- $source=substr($path1, strrpos($path1,'/')+1);
+ $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;
@@ -138,7 +138,7 @@ class Local extends \OC\Files\Storage\Common{
public function getMimeType($path) {
if($this->isReadable($path)) {
- return \OC_Helper::getMimeType($this->datadir.$path);
+ return \OC_Helper::getMimeType($this->datadir . $path);
}else{
return false;
}
@@ -165,8 +165,8 @@ class Local extends \OC\Files\Storage\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) {
@@ -183,7 +183,7 @@ class Local extends \OC\Files\Storage\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;
@@ -191,7 +191,7 @@ class Local extends \OC\Files\Storage\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;
@@ -202,7 +202,7 @@ class Local extends \OC\Files\Storage\Common{
* @param int $time
* @return bool
*/
- public function hasUpdated($path,$time) {
+ public function hasUpdated($path, $time) {
return $this->filemtime($path)>$time;
}
}