summaryrefslogtreecommitdiffstats
path: root/lib/private/files/filesystem.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/files/filesystem.php')
-rw-r--r--lib/private/files/filesystem.php38
1 files changed, 21 insertions, 17 deletions
diff --git a/lib/private/files/filesystem.php b/lib/private/files/filesystem.php
index 71d70bbf2a5..4774d25ad9e 100644
--- a/lib/private/files/filesystem.php
+++ b/lib/private/files/filesystem.php
@@ -325,32 +325,36 @@ class Filesystem {
$userObject = \OC_User::getManager()->get($user);
if (!is_null($userObject)) {
- $homeStorage = \OC_Config::getValue( 'objectstore', array(
- //default home storage configuration:
- 'class' => '\OC\Files\Storage\Home',
- 'arguments' => array()
- ));
- // sanity checks
- if (empty($homeStorage['class'])) {
- \OCP\Util::writeLog('files', 'No class given for objectstore', \OCP\Util::ERROR);
- }
- if (!isset($homeStorage['arguments'])) {
- $homeStorage['arguments'] = array();
+ $homeStorage = \OC_Config::getValue( 'objectstore' );
+ if (!empty($homeStorage)) {
+ // sanity checks
+ if (empty($homeStorage['class'])) {
+ \OCP\Util::writeLog('files', 'No class given for objectstore', \OCP\Util::ERROR);
+ }
+ if (!isset($homeStorage['arguments'])) {
+ $homeStorage['arguments'] = array();
+ }
+ // instantiate object store implementation
+ $homeStorage['arguments']['objectstore'] = new $homeStorage['class']($homeStorage['arguments']);
+ // mount with home object store implementation
+ $homeStorage['class'] = '\OC\Files\ObjectStore\HomeObjectStoreStorage';
+ } else {
+ $homeStorage = array(
+ //default home storage configuration:
+ 'class' => '\OC\Files\Storage\Home',
+ 'arguments' => array()
+ );
}
$homeStorage['arguments']['user'] = $userObject;
+
// check for legacy home id (<= 5.0.12)
if (\OC\Files\Cache\Storage::exists('local::' . $root . '/')) {
$homeStorage['arguments']['legacy'] = true;
}
+
self::mount($homeStorage['class'], $homeStorage['arguments'], $user);
$home = \OC\Files\Filesystem::getStorage($user);
- if ( $home->instanceOfStorage('\OC\Files\ObjectStore\AbstractObjectStore') ) {
- //create the files folder in the cache when mounting the objectstore for a user
- if ( ! $home->is_dir('files') ) {
- $home->mkdir('files');
- }
- }
}
else {
self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);