diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-05-04 14:02:27 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-06-01 13:22:55 +0200 |
commit | cdf7f91259d5e0e261832d0edffadf3760575223 (patch) | |
tree | 368558e622c382047534e7de4ed88d189ef0da47 /lib/private/server.php | |
parent | 2c86cc821c783ce6221ad4e9b6afa704cc6f8b3f (diff) | |
download | nextcloud-server-cdf7f91259d5e0e261832d0edffadf3760575223.tar.gz nextcloud-server-cdf7f91259d5e0e261832d0edffadf3760575223.zip |
expose locking provider in the server container
Diffstat (limited to 'lib/private/server.php')
-rw-r--r-- | lib/private/server.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/private/server.php b/lib/private/server.php index aeea4a6485e..7c8e59c8aa1 100644 --- a/lib/private/server.php +++ b/lib/private/server.php @@ -43,6 +43,7 @@ use OC\Command\AsyncBus; use OC\Diagnostics\NullQueryLogger; use OC\Diagnostics\EventLogger; use OC\Diagnostics\QueryLogger; +use OC\Lock\MemcacheLockingProvider; use OC\Mail\Mailer; use OC\Memcache\ArrayCache; use OC\Http\Client\ClientService; @@ -420,6 +421,13 @@ class Server extends SimpleContainer implements IServerContainer { $this->getLogger() ); }); + $this->registerService('LockingProvider', function (Server $c) { + /** @var \OC\Memcache\Factory $memcacheFactory */ + $memcacheFactory = $c->getMemCacheFactory(); + return new MemcacheLockingProvider( + $memcacheFactory->createDistributed('lock') + ); + }); } /** @@ -908,4 +916,14 @@ class Server extends SimpleContainer implements IServerContainer { public function getTrustedDomainHelper() { return $this->query('TrustedDomainHelper'); } + + /** + * Get the locking provider + * + * @return \OCP\Lock\ILockingProvider + * @since 8.1.0 + */ + public function getLockingProvider() { + return $this->query('LockingProvider'); + } } |