Mock
extends AbstractBackend
in package
Locks Mock backend.
This backend stores lock information in memory. Mainly useful for testing.
Tags
Table of Contents
- $data : mixed
- getLocks() : array<string|int, mixed>
- Returns a list of Sabre\DAV\Locks\LockInfo objects.
- lock() : bool
- Locks a uri.
- unlock() : bool
- Removes a lock from a uri.
- getData() : array<string|int, mixed>
- Loads the lockdata from the filesystem.
- putData() : mixed
- Saves the lockdata.
Properties
$data
protected
mixed
$data
= []
Methods
getLocks()
Returns a list of Sabre\DAV\Locks\LockInfo objects.
public
getLocks(string $uri, bool $returnChildLocks) : array<string|int, mixed>
This method should return all the locks for a particular uri, including locks that might be set on a parent uri.
If returnChildLocks is set to true, this method should also look for any locks in the subtree of the uri for locks.
Parameters
- $uri : string
- $returnChildLocks : bool
Return values
array<string|int, mixed> —lock()
Locks a uri.
public
lock(string $uri, LockInfo $lockInfo) : bool
Parameters
- $uri : string
- $lockInfo : LockInfo
Return values
bool —unlock()
Removes a lock from a uri.
public
unlock(string $uri, LockInfo $lockInfo) : bool
Parameters
- $uri : string
- $lockInfo : LockInfo
Return values
bool —getData()
Loads the lockdata from the filesystem.
protected
getData() : array<string|int, mixed>
Return values
array<string|int, mixed> —putData()
Saves the lockdata.
protected
putData(array<string|int, mixed> $newData) : mixed
Parameters
- $newData : array<string|int, mixed>