Nextcloud PHP API (master)

ILockManager extends ILockProvider

Manage app integrations with the files_lock app and collaborative editors.

This public API exposes locking operations to apps and allows a lock provider from files_lock to be registered. The actual locking implementation remains in the provider and the DAV plugin of the files_lock app.

Tags
since
24.0.0

Table of Contents

Methods

getLockInScope()  : LockContext|null
Get the lock context currently active in this scope.
getLocks()  : array<string|int, mixed>
isLockProviderAvailable()  : bool
Check whether a lock provider is currently available.
lock()  : ILock
registerLazyLockProvider()  : void
Register a lock provider class for lazy resolution from the server container.
registerLockProvider()  : void
Register the lock provider implementation.
runInScope()  : void
Run a callback within the scope of the given lock context.
unlock()  : void

Methods

getLockInScope()

Get the lock context currently active in this scope.

public getLockInScope() : LockContext|null

Returns null if no lock scope is active.

Tags
since
24.0.0
Return values
LockContext|null

isLockProviderAvailable()

Check whether a lock provider is currently available.

public isLockProviderAvailable() : bool

If a provider class was registered lazily, this may attempt to resolve it.

Tags
since
24.0.0
Return values
bool

registerLazyLockProvider()

Register a lock provider class for lazy resolution from the server container.

public registerLazyLockProvider(string $lockProviderClass) : void
Parameters
$lockProviderClass : string
Tags
throws
PreConditionNotMetException

if a lock provider is already registered

since
30.0.0

runInScope()

Run a callback within the scope of the given lock context.

public runInScope(LockContext $lock, callable $callback) : void

The callback is also executed if no lock provider is available.

Parameters
$lock : LockContext
$callback : callable
Tags
throws
PreConditionNotMetException

if another lock scope is already active

since
24.0.0
On this page

Search results