diff options
Diffstat (limited to 'lib/private/server.php')
-rw-r--r-- | lib/private/server.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index de3324d2cce..fe0d9dcf55d 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -51,6 +51,10 @@ use OC\Files\Node\HookConnector; use OC\Files\Node\Root; use OC\Files\View; use OC\Http\Client\ClientService; +use OC\IntegrityCheck\Checker; +use OC\IntegrityCheck\Helpers\AppLocator; +use OC\IntegrityCheck\Helpers\EnvironmentHelper; +use OC\IntegrityCheck\Helpers\FileAccessHelper; use OC\Lock\DBLockingProvider; use OC\Lock\MemcacheLockingProvider; use OC\Lock\NoopLockingProvider; @@ -409,6 +413,26 @@ class Server extends SimpleContainer implements IServerContainer { $this->registerService('TrustedDomainHelper', function ($c) { return new TrustedDomainHelper($this->getConfig()); }); + $this->registerService('IntegrityCodeChecker', function (Server $c) { + // IConfig and IAppManager requires a working database. This code + // might however be called when ownCloud is not yet setup. + if(\OC::$server->getSystemConfig()->getValue('installed', false)) { + $config = $c->getConfig(); + $appManager = $c->getAppManager(); + } else { + $config = null; + $appManager = null; + } + + return new Checker( + new EnvironmentHelper(), + new FileAccessHelper(), + new AppLocator(), + $config, + $c->getMemCacheFactory(), + $appManager + ); + }); $this->registerService('Request', function ($c) { if (isset($this['urlParams'])) { $urlParams = $this['urlParams']; @@ -1094,6 +1118,13 @@ class Server extends SimpleContainer implements IServerContainer { } /** + * @return \OC\IntegrityCheck\Checker + */ + public function getIntegrityCodeChecker() { + return $this->query('IntegrityCodeChecker'); + } + + /** * @return \OC\Session\CryptoWrapper */ public function getSessionCryptoWrapper() { |