aboutsummaryrefslogtreecommitdiffstats
path: root/lib/filesystem.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-06-12 00:57:43 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-06-12 00:57:43 +0200
commit2a5ee9512ee88da53dcba862a32279bdc7096bfb (patch)
tree19da70b3a7a37762c450d03be976b669045740f1 /lib/filesystem.php
parent5425c3d1e919f305930176aef6f531eb2d42f7dd (diff)
downloadnextcloud-server-2a5ee9512ee88da53dcba862a32279bdc7096bfb.tar.gz
nextcloud-server-2a5ee9512ee88da53dcba862a32279bdc7096bfb.zip
allow tear down of filesystem.
also fix a bug when chrooting to '/'
Diffstat (limited to 'lib/filesystem.php')
-rw-r--r--lib/filesystem.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php
index 2b5c3a56b6e..27a937f5e4c 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -68,6 +68,16 @@ class OC_FILESYSTEM{
}
/**
+ * tear down the filesystem, removing all storage providers
+ */
+ static public function tearDown(){
+ foreach(self::$storages as $mountpoint=>$storage){
+ unset(self::$storages[$mountpoint]);
+ }
+ $fakeRoot='';
+ }
+
+ /**
* create a new storage of a specific type
* @param string type
* @param array arguments
@@ -91,8 +101,10 @@ class OC_FILESYSTEM{
* @return bool
*/
static public function chroot($fakeRoot){
- if($fakeRoot[0]!=='/'){
- $fakeRoot='/'.$fakeRoot;
+ if(!$fakeRoot==''){
+ if($fakeRoot[0]!=='/'){
+ $fakeRoot='/'.$fakeRoot;
+ }
}
self::$fakeRoot=$fakeRoot;
}