]> source.dussan.org Git - nextcloud-server.git/commitdiff
move creation of / and users 'files' from storage constructor to setupFS / mount...
authorJörn Friedrich Dreyer <jfd@butonic.de>
Fri, 13 Jun 2014 11:26:09 +0000 (13:26 +0200)
committerJörn Friedrich Dreyer <jfd@butonic.de>
Wed, 18 Jun 2014 10:53:20 +0000 (12:53 +0200)
lib/private/files/filesystem.php
lib/private/files/objectstore/abstractobjectstore.php
lib/private/util.php

index 5fb345c87f8c7da4ea40c191a1ce4183e341f805..f5a7060ec9098241e1f0df6ca3d5702f417b0dbc 100644 (file)
@@ -343,6 +343,14 @@ class Filesystem {
                                $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);
index 2ef2f38bf40339e5d5cd80d315a18aa03f57a9c5..3f67ad9a494e5daff30ace75595618c029555470 100644 (file)
@@ -131,17 +131,6 @@ abstract class AbstractObjectStore extends \OC\Files\Storage\Common {
                } 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) {
index c2db9e5773e9cc64eca5318eba33e9da73553d5e..435a29145550b147709dd066fbe87b9cc22e70bb 100755 (executable)
@@ -110,8 +110,17 @@ class OC_Util {
 
                        $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 )) {