diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2016-05-30 11:16:14 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-05-30 11:16:14 +0200 |
commit | 12b482b976656bb73b1dd265b3e069ff4eb71c65 (patch) | |
tree | 0c533bfac7f04f59587aa08a2ca80e151bac9a13 /apps/testing/appinfo | |
parent | d717b583d22c66c08563e35b9b770a8b18954087 (diff) | |
download | nextcloud-server-12b482b976656bb73b1dd265b3e069ff4eb71c65.tar.gz nextcloud-server-12b482b976656bb73b1dd265b3e069ff4eb71c65.zip |
[testing] Allow to lock a file without the lock being killed at the end of the request (#22823)
* Allow to lock a file without the lock being killed at the end of the request
* Make DB locking detectable
Diffstat (limited to 'apps/testing/appinfo')
-rw-r--r-- | apps/testing/appinfo/routes.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/testing/appinfo/routes.php b/apps/testing/appinfo/routes.php index 6684d486360..619daf40da9 100644 --- a/apps/testing/appinfo/routes.php +++ b/apps/testing/appinfo/routes.php @@ -22,6 +22,7 @@ namespace OCA\Testing\AppInfo; use OCA\Testing\Config; +use OCA\Testing\Locking\Provisioning; use OCP\API; $config = new Config( @@ -44,3 +45,17 @@ API::register( 'testing', API::ADMIN_AUTH ); + +$locking = new Provisioning( + \OC::$server->getLockingProvider(), + \OC::$server->getDatabaseConnection(), + \OC::$server->getConfig(), + \OC::$server->getRequest() +); +API::register('get', '/apps/testing/api/v1/lockprovisioning', [$locking, 'isLockingEnabled'], 'files_lockprovisioning', API::ADMIN_AUTH); +API::register('get', '/apps/testing/api/v1/lockprovisioning/{type}/{user}', [$locking, 'isLocked'], 'files_lockprovisioning', API::ADMIN_AUTH); +API::register('post', '/apps/testing/api/v1/lockprovisioning/{type}/{user}', [$locking, 'acquireLock'], 'files_lockprovisioning', API::ADMIN_AUTH); +API::register('put', '/apps/testing/api/v1/lockprovisioning/{type}/{user}', [$locking, 'changeLock'], 'files_lockprovisioning', API::ADMIN_AUTH); +API::register('delete', '/apps/testing/api/v1/lockprovisioning/{type}/{user}', [$locking, 'releaseLock'], 'files_lockprovisioning', API::ADMIN_AUTH); +API::register('delete', '/apps/testing/api/v1/lockprovisioning/{type}', [$locking, 'releaseAll'], 'files_lockprovisioning', API::ADMIN_AUTH); +API::register('delete', '/apps/testing/api/v1/lockprovisioning', [$locking, 'releaseAll'], 'files_lockprovisioning', API::ADMIN_AUTH); |