@@ -57,6 +57,18 @@ abstract class AbstractObjectStore extends \OC\Files\Storage\Common { | |||
*/ | |||
private static $tmpFiles = array(); | |||
public function __construct($params) { | |||
if (isset($params['user']) && is_object($params['user'])) { | |||
$this->user = $params['user']; | |||
} else { | |||
$this->user = null; | |||
} | |||
//initialize cache with root directory in cache | |||
if ( ! $this->is_dir('/') ) { | |||
$this->mkdir('/'); | |||
} | |||
} | |||
/** | |||
* @param string $path | |||
* @return \OC\Files\Cache\Cache | |||
@@ -125,14 +137,6 @@ abstract class AbstractObjectStore extends \OC\Files\Storage\Common { | |||
return 'objstore::root'; | |||
} | |||
public function __construct($params) { | |||
if (isset($params['user']) && is_object($params['user'])) { | |||
$this->user = $params['user']; | |||
} else { | |||
$this->user = null; | |||
} | |||
} | |||
public function mkdir($path) { | |||
$path = $this->normalizePath($path); | |||
@@ -110,17 +110,8 @@ class OC_Util { | |||
$userDir = '/'.$user.'/files'; | |||
//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 | |||
// copy skeleton for local storage only | |||
if ( ! isset( $root_storage ) ) { | |||
$userRoot = OC_User::getHome($user); | |||
$userDirectory = $userRoot . '/files'; | |||
if( !is_dir( $userDirectory )) { |
@@ -35,7 +35,6 @@ class Swift extends PHPUnit_Framework_TestCase { | |||
\OC_App::disable('files_sharing'); | |||
\OC_App::disable('files_versions'); | |||
\OC_App::enable('objectstore'); | |||
// reset backend | |||
\OC_User::clearBackends(); |