diff options
Diffstat (limited to 'lib/private/server.php')
-rw-r--r-- | lib/private/server.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index 186714740f7..f43613e8188 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -14,6 +14,7 @@ use OC\DB\ConnectionWrapper; use OC\Files\Node\Root; use OC\Files\View; use OC\Security\Crypto; +use OC\Security\Hasher; use OC\Security\SecureRandom; use OC\Diagnostics\NullEventLogger; use OCP\IServerContainer; @@ -197,6 +198,9 @@ class Server extends SimpleContainer implements IServerContainer { $this->registerService('Crypto', function (Server $c) { return new Crypto($c->getConfig(), $c->getSecureRandom()); }); + $this->registerService('Hasher', function (Server $c) { + return new Hasher($c->getConfig()); + }); $this->registerService('DatabaseConnection', function (Server $c) { $factory = new \OC\DB\ConnectionFactory(); $type = $c->getConfig()->getSystemValue('dbtype', 'sqlite'); @@ -530,6 +534,15 @@ class Server extends SimpleContainer implements IServerContainer { } /** + * Returns a Hasher instance + * + * @return \OCP\Security\IHasher + */ + function getHasher() { + return $this->query('Hasher'); + } + + /** * Returns an instance of the db facade * * @return \OCP\IDb |