◆ get()
static get |
( |
|
$lockname, |
|
|
|
$timeout = 10 |
|
) |
| |
|
static |
Tries to obtain a lock with a name given by the string $lockname, using a timeout of $timeout seconds. Returns 1 if the lock was obtained successfully, 0 if the attempt timed out (for example, because another client has previously locked the name), or NULL if an error occurred If a name has been locked by one client, any request by another client for a lock with the same name is blocked.
- Parameters
-
string | $lockname | |
number | $timeout | in seconds |
- Exceptions
-
UnexpectedValueException | if there is already an active lock |
- Returns
- integer 1 if the lock was obtained successfully, 0 if the attempt timed out
◆ getCurrent()
returns the name of the current active lock
- Returns
- string name of active lock
◆ isFree()
static isFree |
( |
|
$lockname | ) |
|
|
static |
check if lock with given name is available
- Parameters
-
- Returns
- integer 1 if lock is available
◆ lockname()
static lockname |
( |
|
$lockname | ) |
|
|
static |
prepends the name of current database to lockname because locks are server-wide
- Parameters
-
- Returns
- string
◆ release()
release the current lock
- Returns
- integer 1 if the lock could be released
The documentation for this class was generated from the following file: