summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-11-27 14:50:14 +0100
committerLukas Reschke <lukas@owncloud.com>2014-11-27 14:50:14 +0100
commite35feadac2ed68f0aad911713cb3d5f8725707e6 (patch)
treefd98fc4dc47855f00efcfa882458e1524909da34
parentfef32e63ddd706a13c48111dd5b0792703becc78 (diff)
downloadnextcloud-server-e35feadac2ed68f0aad911713cb3d5f8725707e6.tar.gz
nextcloud-server-e35feadac2ed68f0aad911713cb3d5f8725707e6.zip
Pass \OC::$WEBROOT to the ctr
-rw-r--r--lib/base.php2
-rw-r--r--lib/private/server.php15
2 files changed, 12 insertions, 5 deletions
diff --git a/lib/base.php b/lib/base.php
index 5c33be351a4..cd5d8feb1f6 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -466,7 +466,7 @@ class OC {
}
// 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()->start('boot', 'Initialize');
diff --git a/lib/private/server.php b/lib/private/server.php
index 328a2e05cae..59ca2a244d6 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -29,7 +29,15 @@ use OC\Tagging\TagMapper;
* TODO: hookup all manager classes
*/
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) {
return new ContactsManager();
});
@@ -233,8 +241,7 @@ class Server extends SimpleContainer implements IServerContainer {
return new NullQueryLogger();
}
});
- $this->registerService('TempManager', function ($c) {
- /** @var Server $c */
+ $this->registerService('TempManager', function (Server $c) {
return new TempManager(get_temp_dir(), $c->getLogger());
});
$this->registerService('AppManager', function(Server $c) {
@@ -638,6 +645,6 @@ class Server extends SimpleContainer implements IServerContainer {
* @return string
*/
function getWebRoot() {
- return \OC::$WEBROOT;
+ return $this->webRoot;
}
}