TYPO3
7.6
|
Public Member Functions | |
__construct ($subject) | |
init ($loops=0, $step=0) | |
__destruct () | |
release () | |
isAcquired () | |
acquire ($mode=self::LOCK_CAPABILITY_EXCLUSIVE) | |
destroy () | |
Static Public Member Functions | |
static | getCapabilities () |
static | getPriority () |
Public Attributes | |
const | FILE_LOCK_FOLDER = 'typo3temp/locks/' |
Public Attributes inherited from LockingStrategyInterface | |
const | LOCK_CAPABILITY_EXCLUSIVE = 1 |
const | LOCK_CAPABILITY_SHARED = 2 |
const | LOCK_CAPABILITY_NOBLOCK = 4 |
Protected Attributes | |
$filePath | |
$isAcquired = false | |
$loops = 150 | |
$step = 200 | |
Simple file locking
Definition at line 24 of file SimpleLockStrategy.php.
__construct | ( | $subject | ) |
string | $subject | ID to identify this lock in the system |
LockCreateException | if the lock could not be created |
Implements LockingStrategyInterface.
Definition at line 52 of file SimpleLockStrategy.php.
References GeneralUtility\mkdir().
__destruct | ( | ) |
Destructor: Releases lock automatically when instance is destroyed and release resources
Definition at line 87 of file SimpleLockStrategy.php.
References SimpleLockStrategy\release().
acquire | ( | $mode = self::LOCK_CAPABILITY_EXCLUSIVE | ) |
Try to acquire a lock
int | $mode | LOCK_CAPABILITY_EXCLUSIVE or self::LOCK_CAPABILITY_NOBLOCK |
LockAcquireWouldBlockException |
Implements LockingStrategyInterface.
Definition at line 142 of file SimpleLockStrategy.php.
References SimpleLockStrategy\$isAcquired, SimpleLockStrategy\$loops, GeneralUtility\fixPermissions(), and SimpleLockStrategy\isAcquired().
destroy | ( | ) |
Destroys the resource associated with the lock
Implements LockingStrategyInterface.
Definition at line 194 of file SimpleLockStrategy.php.
|
static |
Implements LockingStrategyInterface.
Definition at line 130 of file SimpleLockStrategy.php.
|
static |
Implements LockingStrategyInterface.
Definition at line 184 of file SimpleLockStrategy.php.
init | ( | $loops = 0 , |
|
$step = 0 |
|||
) |
int | $loops | Number of times a locked resource is tried to be acquired. |
int | $step | Milliseconds after lock acquire is retried. $loops * $step results in the maximum delay of a lock. |
Definition at line 77 of file SimpleLockStrategy.php.
References SimpleLockStrategy\$loops, and SimpleLockStrategy\$step.
isAcquired | ( | ) |
Get status of this lock
Implements LockingStrategyInterface.
Definition at line 122 of file SimpleLockStrategy.php.
References SimpleLockStrategy\$isAcquired.
Referenced by SimpleLockStrategy\acquire(), and SimpleLockStrategy\release().
release | ( | ) |
Release the lock
Implements LockingStrategyInterface.
Definition at line 97 of file SimpleLockStrategy.php.
References SimpleLockStrategy\isAcquired(), GeneralUtility\isAllowedAbsPath(), and GeneralUtility\isFirstPartOfStr().
Referenced by SimpleLockStrategy\__destruct().
|
protected |
Definition at line 31 of file SimpleLockStrategy.php.
|
protected |
Definition at line 36 of file SimpleLockStrategy.php.
Referenced by SimpleLockStrategy\acquire(), and SimpleLockStrategy\isAcquired().
|
protected |
Definition at line 41 of file SimpleLockStrategy.php.
Referenced by SimpleLockStrategy\acquire(), and SimpleLockStrategy\init().
|
protected |
Definition at line 46 of file SimpleLockStrategy.php.
Referenced by SimpleLockStrategy\init().
const FILE_LOCK_FOLDER = 'typo3temp/locks/' |
Definition at line 26 of file SimpleLockStrategy.php.