Merge pull request #3132 from owncloud/mount-setupfs

Make sure the filesystem is initialized when searching for mounts
remotes/origin/stable6
icewind1991 13 years ago
commit 80e91e1ac6
  1. 1
      lib/files/filesystem.php
  2. 3
      lib/files/mount.php
  3. 9
      tests/lib/files/cache/updater.php

@ -311,6 +311,7 @@ class Filesystem {
*/
static public function tearDown() {
self::clearMounts();
self::$defaultInstance = null;
}
/**

@ -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);
}

@ -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');

Loading…
Cancel
Save