Skip to content
Snippets Groups Projects
Commit 10de4a7b authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

move creation of / and users 'files' from storage constructor to setupFS / mount initialization

parent 652af71b
No related branches found
No related tags found
No related merge requests found
...@@ -343,6 +343,14 @@ class Filesystem { ...@@ -343,6 +343,14 @@ class Filesystem {
$homeStorage['arguments']['legacy'] = true; $homeStorage['arguments']['legacy'] = true;
} }
self::mount($homeStorage['class'], $homeStorage['arguments'], $user); 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 { else {
self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user); self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);
......
...@@ -131,17 +131,6 @@ abstract class AbstractObjectStore extends \OC\Files\Storage\Common { ...@@ -131,17 +131,6 @@ abstract class AbstractObjectStore extends \OC\Files\Storage\Common {
} else { } else {
$this->user = null; $this->user = null;
} }
//initialize cache with root directory in cache
if ( ! $this->is_dir('/') ) {
$this->mkdir('/');
}
if (isset($params['user']) && is_object($params['user'])) {
//create the files folder in the cache when mounting the objectstore for a user
if ( ! $this->is_dir('files') ) {
$this->mkdir('files');
}
}
} }
public function mkdir($path) { public function mkdir($path) {
......
...@@ -110,8 +110,17 @@ class OC_Util { ...@@ -110,8 +110,17 @@ class OC_Util {
$userDir = '/'.$user.'/files'; $userDir = '/'.$user.'/files';
//autocreate users "home" directory for local storage only //autocreate users "home" directory
if ( ! isset( $root_storage ) ) { if ( isset( $root_storage ) ) {
$root = \OC\Files\Filesystem::getStorage('/');
if ( $root->instanceOfStorage('\OC\Files\ObjectStore\AbstractObjectStore') ) {
//initialize cache with root directory in cache
if ( ! $root->is_dir('/') ) {
$root->mkdir('/');
}
}
} else {
//copy skeleton for local storage only
$userRoot = OC_User::getHome($user); $userRoot = OC_User::getHome($user);
$userDirectory = $userRoot . '/files'; $userDirectory = $userRoot . '/files';
if( !is_dir( $userDirectory )) { if( !is_dir( $userDirectory )) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment