use a getter for the storage loader to ensure the instance is created

This commit is contained in:
Robin Appelman 2013-06-07 17:50:10 +02:00
parent 31693d3937
commit 94ca576c9a

View file

@ -146,7 +146,14 @@ class Filesystem {
/** /**
* @var \OC\Files\Storage\Loader $loader * @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 * get the mountpoint of the storage object for a path
@ -245,7 +252,7 @@ class Filesystem {
if (self::$defaultInstance) { if (self::$defaultInstance) {
return false; return false;
} }
self::$loader = new Loader(); self::getLoader();
self::$defaultInstance = new View($root); self::$defaultInstance = new View($root);
if (!self::$mounts) { if (!self::$mounts) {
@ -400,7 +407,7 @@ class Filesystem {
if (!self::$mounts) { if (!self::$mounts) {
\OC_Util::setupFS(); \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); self::$mounts->addMount($mount);
} }