summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-06-02 22:09:44 +0200
committerRobin Appelman <icewind@owncloud.com>2013-06-02 22:09:44 +0200
commit38bd234686d206013d1f402c89e310503a65a5a8 (patch)
tree58e92f8e182ec2759cdcfbf4b880d2c96e4cd541 /lib
parentb5e817d638afcbdb86f6f8ffd6e92348c2454d3e (diff)
downloadnextcloud-server-38bd234686d206013d1f402c89e310503a65a5a8.tar.gz
nextcloud-server-38bd234686d206013d1f402c89e310503a65a5a8.zip
make sure the filesystem is setup before doing mount operations
Diffstat (limited to 'lib')
-rw-r--r--lib/files/filesystem.php27
1 files changed, 24 insertions, 3 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 7e0bcfd1a27..d3fddf8c421 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -152,6 +152,9 @@ class Filesystem {
* @return string
*/
static public function getMountPoint($path) {
+ if (!self::$mounts) {
+ \OC_Util::setupFS();
+ }
$mount = self::$mounts->find($path);
if ($mount) {
return $mount->getMountPoint();
@@ -167,6 +170,9 @@ class Filesystem {
* @return string[]
*/
static public function getMountPoints($path) {
+ if (!self::$mounts) {
+ \OC_Util::setupFS();
+ }
$result = array();
$mounts = self::$mounts->findIn($path);
foreach ($mounts as $mount) {
@@ -182,6 +188,9 @@ class Filesystem {
* @return \OC\Files\Storage\Storage
*/
public static function getStorage($mountPoint) {
+ if (!self::$mounts) {
+ \OC_Util::setupFS();
+ }
$mount = self::$mounts->find($mountPoint);
return $mount->getStorage();
}
@@ -191,6 +200,9 @@ class Filesystem {
* @return Mount\Mount[]
*/
public static function getMountByStorageId($id) {
+ if (!self::$mounts) {
+ \OC_Util::setupFS();
+ }
return self::$mounts->findByStorageId($id);
}
@@ -199,6 +211,9 @@ class Filesystem {
* @return Mount\Mount[]
*/
public static function getMountByNumericId($id) {
+ if (!self::$mounts) {
+ \OC_Util::setupFS();
+ }
return self::$mounts->findByNumericId($id);
}
@@ -209,6 +224,9 @@ class Filesystem {
* @return array consisting of the storage and the internal path
*/
static public function resolvePath($path) {
+ if (!self::$mounts) {
+ \OC_Util::setupFS();
+ }
$mount = self::$mounts->find($path);
if ($mount) {
return array($mount->getStorage(), $mount->getInternalPath($path));
@@ -223,7 +241,7 @@ class Filesystem {
}
self::$defaultInstance = new View($root);
- if(!self::$mounts) {
+ if (!self::$mounts) {
self::$mounts = new Mount\Manager();
}
@@ -235,8 +253,8 @@ class Filesystem {
return true;
}
- static public function initMounts(){
- if(!self::$mounts) {
+ static public function initMounts() {
+ if (!self::$mounts) {
self::$mounts = new Mount\Manager();
}
}
@@ -372,6 +390,9 @@ class Filesystem {
* @param string $mountpoint
*/
static public function mount($class, $arguments, $mountpoint) {
+ if (!self::$mounts) {
+ \OC_Util::setupFS();
+ }
$mount = new Mount\Mount($class, $mountpoint, $arguments);
self::$mounts->addMount($mount);
}