|
| acquire_lock ($key, $ownerid) |
| Acquires a lock on the given key for the given identifier.
|
|
| check_lock_state ($key, $ownerid) |
| Test if there is already a lock for the given key and if there is whether it belongs to the calling code.
|
|
| release_lock ($key, $ownerid) |
| Releases the lock on the given key.
|
|
◆ acquire_lock()
core_cache\lockable_cache_interface::acquire_lock |
( |
| $key, |
|
|
| $ownerid ) |
Acquires a lock on the given key for the given identifier.
- Parameters
-
string | $key | The key we are locking. |
string | $ownerid | The identifier so we can check if we have the lock or if it is someone else. The use of this property is entirely optional and implementations can act as they like upon it. |
- Return values
-
bool | True if the lock could be acquired, false otherwise. |
Implemented in cachestore_file, and cachestore_redis.
◆ check_lock_state()
core_cache\lockable_cache_interface::check_lock_state |
( |
| $key, |
|
|
| $ownerid ) |
Test if there is already a lock for the given key and if there is whether it belongs to the calling code.
- Parameters
-
string | $key | The key we are locking. |
string | $ownerid | The identifier so we can check if we have the lock or if it is someone else. |
- Return values
-
bool | True if this code has the lock, false if there is a lock but this code doesn't have it, null if there is no lock. |
Implemented in cachestore_file, and cachestore_redis.
◆ release_lock()
core_cache\lockable_cache_interface::release_lock |
( |
| $key, |
|
|
| $ownerid ) |
Releases the lock on the given key.
- Parameters
-
string | $key | The key we are locking. |
string | $ownerid | The identifier so we can check if we have the lock or if it is someone else. The use of this property is entirely optional and implementations can act as they like upon it. |
- Return values
-
bool | True if the lock has been released, false if there was a problem releasing the lock. |
Implemented in cachestore_file, and cachestore_redis.
The documentation for this interface was generated from the following file:
- cache/classes/lockable_cache_interface.php