Commit e35feada authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Pass \OC::$WEBROOT to the ctr

parent fef32e63
...@@ -466,7 +466,7 @@ class OC { ...@@ -466,7 +466,7 @@ class OC {
} }
// setup the basic server // setup the basic server
self::$server = new \OC\Server(); self::$server = new \OC\Server(\OC::$WEBROOT);
\OC::$server->getEventLogger()->log('autoloader', 'Autoloader', $loaderStart, $loaderEnd); \OC::$server->getEventLogger()->log('autoloader', 'Autoloader', $loaderStart, $loaderEnd);
\OC::$server->getEventLogger()->start('boot', 'Initialize'); \OC::$server->getEventLogger()->start('boot', 'Initialize');
......
...@@ -29,7 +29,15 @@ use OC\Tagging\TagMapper; ...@@ -29,7 +29,15 @@ use OC\Tagging\TagMapper;
* TODO: hookup all manager classes * TODO: hookup all manager classes
*/ */
class Server extends SimpleContainer implements IServerContainer { class Server extends SimpleContainer implements IServerContainer {
function __construct() { /** @var string */
private $webRoot;
/**
* @param string $webRoot
*/
function __construct($webRoot) {
$this->webRoot = $webRoot;
$this->registerService('ContactsManager', function ($c) { $this->registerService('ContactsManager', function ($c) {
return new ContactsManager(); return new ContactsManager();
}); });
...@@ -233,8 +241,7 @@ class Server extends SimpleContainer implements IServerContainer { ...@@ -233,8 +241,7 @@ class Server extends SimpleContainer implements IServerContainer {
return new NullQueryLogger(); return new NullQueryLogger();
} }
}); });
$this->registerService('TempManager', function ($c) { $this->registerService('TempManager', function (Server $c) {
/** @var Server $c */
return new TempManager(get_temp_dir(), $c->getLogger()); return new TempManager(get_temp_dir(), $c->getLogger());
}); });
$this->registerService('AppManager', function(Server $c) { $this->registerService('AppManager', function(Server $c) {
...@@ -638,6 +645,6 @@ class Server extends SimpleContainer implements IServerContainer { ...@@ -638,6 +645,6 @@ class Server extends SimpleContainer implements IServerContainer {
* @return string * @return string
*/ */
function getWebRoot() { function getWebRoot() {
return \OC::$WEBROOT; return $this->webRoot;
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment