summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-05-08 13:32:37 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-05-08 13:32:37 +0200
commitc37bc4fdf934a20b95334874b807b8f25f74d9f0 (patch)
tree8444f544eb4dc1a852244f6ccaa499df16bd19cb /lib
parent9fe95e8a7cf5f639fe3ba2a3aa33ce4a5c9a77b6 (diff)
downloadnextcloud-server-c37bc4fdf934a20b95334874b807b8f25f74d9f0.tar.gz
nextcloud-server-c37bc4fdf934a20b95334874b807b8f25f74d9f0.zip
Expose isCLI to DI
This allows apps/backgroundjobs to find out if they are run from the CLI or not. Some apps/backgroundjobs might do more if they are not at risk of timing out. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Server.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/Server.php b/lib/private/Server.php
index a879c65bb9b..f230ce5b884 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -164,6 +164,9 @@ class Server extends ServerContainer implements IServerContainer {
parent::__construct();
$this->webRoot = $webRoot;
+ // To find out if we are running from CLI or not
+ $this->registerParameter('isCLI', \OC::$CLI);
+
$this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) {
return $c;
});