diff options
author | icewind1991 <icewind1991@gmail.com> | 2013-04-25 08:07:07 -0700 |
---|---|---|
committer | icewind1991 <icewind1991@gmail.com> | 2013-04-25 08:07:07 -0700 |
commit | 80e91e1ac6f8c3c3daa0b8e65ab038ebb57b0794 (patch) | |
tree | c59574e97378dc2741ee5ce6498ce5ef0f3269df | |
parent | 632221bed0a33d2b8d6c1eb7cc285f715967fd26 (diff) | |
parent | cea56df59ec4530d78e66fd341738d77e0ab1745 (diff) | |
download | nextcloud-server-80e91e1ac6f8c3c3daa0b8e65ab038ebb57b0794.tar.gz nextcloud-server-80e91e1ac6f8c3c3daa0b8e65ab038ebb57b0794.zip |
Merge pull request #3132 from owncloud/mount-setupfs
Make sure the filesystem is initialized when searching for mounts
-rw-r--r-- | lib/files/filesystem.php | 1 | ||||
-rw-r--r-- | lib/files/mount.php | 3 | ||||
-rw-r--r-- | tests/lib/files/cache/updater.php | 9 |
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php index 8c8e80c1be4..09732e67ac6 100644 --- a/lib/files/filesystem.php +++ b/lib/files/filesystem.php @@ -311,6 +311,7 @@ class Filesystem { */ static public function tearDown() { self::clearMounts(); + self::$defaultInstance = null; } /** diff --git a/lib/files/mount.php b/lib/files/mount.php index 59c98e9dcc8..0030d0ee7a6 100644 --- a/lib/files/mount.php +++ b/lib/files/mount.php @@ -136,6 +136,7 @@ class Mount { * @return Mount */ public static function find($path) { + \OC_Util::setupFS(); $path = self::formatPath($path); if (isset(self::$mounts[$path])) { return self::$mounts[$path]; @@ -163,6 +164,7 @@ class Mount { * @return Mount[] */ public static function findIn($path) { + \OC_Util::setupFS(); $path = self::formatPath($path); $result = array(); $pathLength = strlen($path); @@ -186,6 +188,7 @@ class Mount { * @return Mount[] */ public static function findByStorageId($id) { + \OC_Util::setupFS(); if (strlen($id) > 64) { $id = md5($id); } diff --git a/tests/lib/files/cache/updater.php b/tests/lib/files/cache/updater.php index aaf932c97fe..dad3cd7e650 100644 --- a/tests/lib/files/cache/updater.php +++ b/tests/lib/files/cache/updater.php @@ -42,14 +42,11 @@ class Updater extends \PHPUnit_Framework_TestCase { $this->scanner->scan(''); $this->cache = $this->storage->getCache(); + \OC\Files\Filesystem::tearDown(); if (!self::$user) { - if (!\OC\Files\Filesystem::getView()) { - self::$user = uniqid(); - \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files'); - } else { - self::$user = \OC_User::getUser(); - } + self::$user = uniqid(); } + \OC\Files\Filesystem::init(self::$user, '/' . self::$user . '/files'); Filesystem::clearMounts(); Filesystem::mount($this->storage, array(), '/' . self::$user . '/files'); |