summaryrefslogtreecommitdiffstats
path: root/lib/private/server.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-11-28 10:16:22 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-11-28 10:16:22 +0100
commitb188710af33fde461a57e81dfc4aaf1cf7c6fda5 (patch)
tree3d66021b2507fc28e887b5c4b647a65ae11ef654 /lib/private/server.php
parent7a9af8c40c4ff2c2005a304a6474e9f328a3be5c (diff)
parente35feadac2ed68f0aad911713cb3d5f8725707e6 (diff)
downloadnextcloud-server-b188710af33fde461a57e81dfc4aaf1cf7c6fda5.tar.gz
nextcloud-server-b188710af33fde461a57e81dfc4aaf1cf7c6fda5.zip
Merge pull request #12472 from owncloud/modifyCookies
Add functions to modify cookies to response class
Diffstat (limited to 'lib/private/server.php')
-rw-r--r--lib/private/server.php28
1 files changed, 22 insertions, 6 deletions
diff --git a/lib/private/server.php b/lib/private/server.php
index cd57d41ce58..7bd7f8ca45d 100644
--- a/lib/private/server.php
+++ b/lib/private/server.php
@@ -29,19 +29,27 @@ 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();
});
- $this->registerService('Request', function ($c) {
+ $this->registerService('Request', function (Server $c) {
if (isset($c['urlParams'])) {
$urlParams = $c['urlParams'];
} else {
$urlParams = array();
}
- if (\OC::$server->getSession()->exists('requesttoken')) {
- $requestToken = \OC::$server->getSession()->get('requesttoken');
+ if ($c->getSession()->exists('requesttoken')) {
+ $requestToken = $c->getSession()->get('requesttoken');
} else {
$requestToken = false;
}
@@ -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) {
@@ -631,4 +638,13 @@ class Server extends SimpleContainer implements IServerContainer {
function getAppManager() {
return $this->query('AppManager');
}
+
+ /**
+ * Get the webroot
+ *
+ * @return string
+ */
+ function getWebRoot() {
+ return $this->webRoot;
+ }
}