aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-06-07 17:50:10 +0200
committerRobin Appelman <icewind@owncloud.com>2013-06-07 17:50:10 +0200
commit94ca576c9ac30b7e5878c108a5efe2cad16faa94 (patch)
treefac12d092c0ccb6f4635de3fa1535b38eee4583e
parent31693d393749c94591dc0814cc502eac8d415e11 (diff)
downloadnextcloud-server-94ca576c9ac30b7e5878c108a5efe2cad16faa94.tar.gz
nextcloud-server-94ca576c9ac30b7e5878c108a5efe2cad16faa94.zip
use a getter for the storage loader to ensure the instance is created
-rw-r--r--lib/files/filesystem.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index a7b1da57c1a..3d7d5abf8fe 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -146,7 +146,14 @@ class Filesystem {
/**
* @var \OC\Files\Storage\Loader $loader
*/
- public static $loader;
+ private static $loader;
+
+ public static function getLoader(){
+ if (!self::$loader) {
+ self::$loader = new Loader();
+ }
+ return self::$loader;
+ }
/**
* get the mountpoint of the storage object for a path
@@ -245,7 +252,7 @@ class Filesystem {
if (self::$defaultInstance) {
return false;
}
- self::$loader = new Loader();
+ self::getLoader();
self::$defaultInstance = new View($root);
if (!self::$mounts) {
@@ -400,7 +407,7 @@ class Filesystem {
if (!self::$mounts) {
\OC_Util::setupFS();
}
- $mount = new Mount\Mount($class, $mountpoint, $arguments, self::$loader);
+ $mount = new Mount\Mount($class, $mountpoint, $arguments, self::getLoader());
self::$mounts->addMount($mount);
}