|
| ping () |
|
| purge () |
| Purge old locks. More...
|
|
| exists ($item, $id=null, $user=null) |
| Check wether a lock exists. More...
|
|
| request ($item, $id=null) |
| Request a lock on an item. More...
|
|
| refresh ($item=null, $id=null) |
| Refresh one or multiple lock(s). More...
|
|
| release ($item=null, $id=null) |
| Release one or multiple lock(s). More...
|
|
| owner ($item, $id=null) |
| Who owns a lock. More...
|
|
| __construct ($fred, $config=null) |
|
| __destruct () |
|
| clientConfig () |
| Public configuration. More...
|
|
| config ($key, $default=null) |
| Retrieve a config value. More...
|
|
| ping () |
| Ping function. More...
|
|
| filemtime ($filename) |
| Filemtime with session cache. More...
|
|
| component ($name) |
| Get a component (local or default). More...
|
|
| components (... $names) |
| Get multiple components in an array. More...
|
|
| propertyExists ($property) |
| Check if a property exists (public or published). More...
|
|
| constants ($prefix=null) |
| Return all constants. More...
|
|
| get ($key) |
| Get one or more properties. More...
|
|
| set ($key, $value=null) |
| Set one or more properties. More...
|
|
| __get ($key) |
|
| __set ($key, $value) |
|
|
| key ($item, $id, $user=null) |
| Generate a lock key. More...
|
|
| filename ($item, $id, $user=null) |
| Filename for a lock file. More...
|
|
| find ($item=null, $id=null, $user=null) |
| Find lock files. More...
|
|
| getPath () |
|
| getTimeout () |
|
| init () |
|
| done () |
|
| getSession () |
|
| publish ($property, $visibility=self::READABLE) |
| Publish a property (or hide it again). More...
|
|
| configure ($config) |
| Configure the object. More...
|
|
| _get ($key) |
| Default getter if no specific setter is defined, and the property is also not published (readable). More...
|
|
| _set ($key, $value) |
| Default setter if no specific setter is defined, and the property is also not published (writeable). More...
|
|
Definition at line 5 of file Lock.php.
◆ exists()
exists |
( |
|
$item, |
|
|
|
$id = null , |
|
|
|
$user = null |
|
) |
| |
Check wether a lock exists.
- Parameters
-
string | $item | Item type. |
mixed | $id | ID of the item (empty = check for all items lock). |
mixed | $user | User ID of the owner (all users when empty; use false to exclude own locks). |
- Returns
- int Number of active locks (should be 0 or 1, but in a race condition it could be more).
Definition at line 63 of file Lock.php.
◆ filename()
filename |
( |
|
$item, |
|
|
|
$id, |
|
|
|
$user = null |
|
) |
| |
|
protected |
Filename for a lock file.
- Parameters
-
string | $item | Item type. |
mixed | $id | Id of the item (true = all ID's). |
mixed | $user | User ID of the owner (current user when empty). |
- Returns
- string
Definition at line 37 of file Lock.php.
◆ find()
find |
( |
|
$item = null , |
|
|
|
$id = null , |
|
|
|
$user = null |
|
) |
| |
|
protected |
Find lock files.
- Parameters
-
string | $item | Item type (empty = return all locks for this user). |
mixed | $id | ID of the item (empty = return all locks for this item type). |
mixed | $user | User ID of the owner (current user when empty). |
- Returns
- array Lock filenames.
Definition at line 47 of file Lock.php.
◆ getPath()
◆ getTimeout()
◆ key()
key |
( |
|
$item, |
|
|
|
$id, |
|
|
|
$user = null |
|
) |
| |
|
protected |
Generate a lock key.
- Parameters
-
string | $item | Item type. |
mixed | $id | Id of the item. |
mixed | $user | User ID of the owner (current user when empty). |
- Returns
- string
Definition at line 27 of file Lock.php.
◆ owner()
owner |
( |
|
$item, |
|
|
|
$id = null |
|
) |
| |
Who owns a lock.
- Parameters
-
string | $item | Item type. |
mixed | $id | ID of the item. |
- Returns
- mixed User ID of the owner (false when not locked).
Definition at line 127 of file Lock.php.
◆ ping()
◆ purge()
Purge old locks.
Definition at line 53 of file Lock.php.
◆ refresh()
refresh |
( |
|
$item = null , |
|
|
|
$id = null |
|
) |
| |
Refresh one or multiple lock(s).
- Parameters
-
string | $item | Item type (empty = refresh all locks for this user). |
mixed | $id | ID of the item (empty = refresh all locks for this item type). |
- Returns
- bool True on success.
Definition at line 101 of file Lock.php.
◆ release()
release |
( |
|
$item = null , |
|
|
|
$id = null |
|
) |
| |
Release one or multiple lock(s).
- Parameters
-
string | $item | Item type (empty = release all locks for this user). |
mixed | $id | ID of the item (empty = release all locks for this item type). |
- Returns
- bool True on success.
Definition at line 116 of file Lock.php.
◆ request()
request |
( |
|
$item, |
|
|
|
$id = null |
|
) |
| |
Request a lock on an item.
- Parameters
-
string | $item | Item type. |
mixed | $id | ID of the item (empty = lock all items). |
- Returns
- bool True on success.
Definition at line 77 of file Lock.php.
◆ $_path
Path to store the lock files (temp path if empty).
Definition at line 14 of file Lock.php.
◆ $_timeout
Number of seconds after which a lock expires (empty = use double of.
Definition at line 12 of file Lock.php.
◆ $ext
Extension for lock file.
Definition at line 10 of file Lock.php.
◆ $keySeperator
String to seperate key info with (may not be present in item type or ID).
Definition at line 7 of file Lock.php.
◆ $multiIndicator
$multiIndicator = '-----' |
String to indicate a lock for all ID's of an item type.
Definition at line 8 of file Lock.php.
The documentation for this class was generated from the following file:
- /var/www/fred.local/vendor/rsi/fred/src/Rsi/Fred/Lock.php