File
extends AbstractBackend
in package
This Locks backend stores all locking information in a single file.
Note that this is not nearly as robust as a database. If you are considering using this backend, keep in mind that the PDO backend can work with SqLite, which is designed to be a good file-based database.
It literally solves the problem this class solves as well, but much better.
Tags
Table of Contents
- $locksFile : string
- The storage file.
- __construct() : mixed
- Constructor.
- 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
$locksFile
The storage file.
private
string
$locksFile
Methods
__construct()
Constructor.
public
__construct(string $locksFile) : mixed
Parameters
- $locksFile : string
-
path to file
Return values
mixed —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>