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>
This commit is contained in:
Roeland Jago Douma 2018-05-08 13:32:37 +02:00
parent 9fe95e8a7c
commit c37bc4fdf9
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 3 additions and 0 deletions

View File

@ -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;
});