$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);
} else {
$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) {
$userDir = '/'.$user.'/files';
- //autocreate users "home" directory for local storage only
- if ( ! isset( $root_storage ) ) {
+ //autocreate users "home" directory
+ 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);
$userDirectory = $userRoot . '/files';
if( !is_dir( $userDirectory )) {