aboutsummaryrefslogtreecommitdiffstats
path: root/lib/filestorage
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-08-29 08:38:33 +0200
committerBart Visscher <bartv@thisnet.nl>2012-08-29 20:28:45 +0200
commit52f2e7112ea985203eca16aa787bd75a7cf92194 (patch)
tree1d1f5070b050652940847c569b1d3968bdae082c /lib/filestorage
parent76bc4753e9bd2698415b067108806d82ac56b663 (diff)
downloadnextcloud-server-52f2e7112ea985203eca16aa787bd75a7cf92194.tar.gz
nextcloud-server-52f2e7112ea985203eca16aa787bd75a7cf92194.zip
Whitespace fixes in lib
Diffstat (limited to 'lib/filestorage')
-rw-r--r--lib/filestorage/common.php62
-rw-r--r--lib/filestorage/commontest.php4
-rw-r--r--lib/filestorage/local.php4
3 files changed, 35 insertions, 35 deletions
diff --git a/lib/filestorage/common.php b/lib/filestorage/common.php
index c829be62f74..e2828e56170 100644
--- a/lib/filestorage/common.php
+++ b/lib/filestorage/common.php
@@ -21,11 +21,11 @@
*/
/**
- * Storage backend class for providing common filesystem operation methods
+ * Storage backend class for providing common filesystem operation methods
* which are not storage-backend specific.
*
* OC_Filestorage_Common is never used directly; it is extended by all other
- * storage backends, where its methods may be overridden, and additional
+ * storage backends, where its methods may be overridden, and additional
* (backend-specific) methods are defined.
*
* Some OC_Filestorage_Common methods call functions which are first defined
@@ -115,71 +115,71 @@ abstract class OC_Filestorage_Common extends OC_Filestorage {
* @param $empty Flag indicating whether directory will be emptied
* @returns true/false
*
- * @note By default the directory specified by $directory will be
+ * @note By default the directory specified by $directory will be
* deleted together with its contents. To avoid this set $empty to true
*/
public function deleteAll( $directory, $empty = false ) {
-
+
// strip leading slash
if( substr( $directory, 0, 1 ) == "/" ) {
-
+
$directory = substr( $directory, 1 );
-
+
}
-
+
// strip trailing slash
if( substr( $directory, -1) == "/" ) {
-
+
$directory = substr( $directory, 0, -1 );
-
+
}
-
+
if ( !$this->file_exists( \OCP\USER::getUser() . '/' . $directory ) || !$this->is_dir( \OCP\USER::getUser() . '/' . $directory ) ) {
-
+
return false;
-
+
} elseif( !$this->is_readable( \OCP\USER::getUser() . '/' . $directory ) ) {
-
+
return false;
-
+
} else {
-
+
$directoryHandle = $this->opendir( \OCP\USER::getUser() . '/' . $directory );
-
+
while ( $contents = readdir( $directoryHandle ) ) {
-
+
if ( $contents != '.' && $contents != '..') {
-
+
$path = $directory . "/" . $contents;
-
+
if ( $this->is_dir( $path ) ) {
-
+
deleteAll( $path );
-
+
} else {
-
+
$this->unlink( \OCP\USER::getUser() .'/' . $path ); // TODO: make unlink use same system path as is_dir
-
+
}
}
-
+
}
-
+
//$this->closedir( $directoryHandle ); // TODO: implement closedir in OC_FSV
if ( $empty == false ) {
-
+
if ( !$this->rmdir( $directory ) ) {
-
+
return false;
-
+
}
-
+
}
-
+
return true;
}
-
+
}
public function getMimeType($path){
if(!$this->file_exists($path)){
diff --git a/lib/filestorage/commontest.php b/lib/filestorage/commontest.php
index b5126a407b3..4d06e4fa321 100644
--- a/lib/filestorage/commontest.php
+++ b/lib/filestorage/commontest.php
@@ -31,11 +31,11 @@ class OC_Filestorage_CommonTest extends OC_Filestorage_Common{
* @var OC_FileStorage_Local
*/
private $storage;
-
+
public function __construct($params){
$this->storage=new OC_Filestorage_Local($params);
}
-
+
public function mkdir($path){
return $this->storage->mkdir($path);
}
diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php
index 22d17469df3..b19205f45b1 100644
--- a/lib/filestorage/local.php
+++ b/lib/filestorage/local.php
@@ -61,7 +61,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
return filemtime($this->datadir.$path);
}
public function touch($path, $mtime=null){
- // sets the modification time of the file to the given value.
+ // sets the modification time of the file to the given value.
// If mtime is nil the current time is set.
// note that the access time of the file always changes to the current time.
if(!is_null($mtime)){
@@ -72,7 +72,7 @@ class OC_Filestorage_Local extends OC_Filestorage_Common{
if( $result ) {
clearstatcache( true, $this->datadir.$path );
}
-
+
return $result;
}
public function file_get_contents($path){