TYPO3 API  SVNRelease
Public Member Functions | Protected Attributes
t3lib_lock Class Reference

List of all members.

Public Member Functions

 __construct ($id, $method= '', $loops=0, $step=0)
 __destruct ()
 acquire ()
 release ()
 getMethod ()
 getId ()
 getResource ()
 getLockStatus ()
 setSyslogFacility ($syslogFacility)
 setEnableLogging ($isLoggingEnabled)
 sysLog ($message, $severity=0)

Protected Attributes

 $method
 $id
 $resource
 $filepointer
 $isAcquired = FALSE
 $loops = 150
 $step = 200
 $syslogFacility = 'cms'
 $isLoggingEnabled = TRUE

Detailed Description

Definition at line 48 of file class.t3lib_lock.php.


Constructor & Destructor Documentation

t3lib_lock::__construct ( id,
method = '',
loops = 0,
step = 0 
)

Constructor: initializes locking, check input parameters and set variables accordingly.

Parameters:
stringID to identify this lock in the system
stringDefine which locking method to use. Defaults to "simple".
integerNumber of times a locked resource is tried to be acquired. This is only used by manual locks like the "simple" method.
integerMilliseconds after lock acquire is retried. $loops * $step results in the maximum delay of a lock. Only used by manual locks like the "simple" method.
Returns:
boolean Returns true unless something went wrong

Definition at line 71 of file class.t3lib_lock.php.

References $id, $loops, $method, $step, and t3lib_div\mkdir().

t3lib_lock::__destruct ( )

Destructor: Releases lock automatically when instance is destroyed.

Returns:
void

Definition at line 121 of file class.t3lib_lock.php.

References release().


Member Function Documentation

t3lib_lock::acquire ( )

Acquire a lock and return when successful. If the lock is already open, the client will be

It is important to know that the lock will be acquired in any case, even if the request was blocked first. Therefore, the lock needs to be released in every situation.

Returns:
boolean Returns true if lock could be acquired without waiting, false otherwise.

Definition at line 132 of file class.t3lib_lock.php.

References $filepointer, $isAcquired, t3lib_div\fixPermissions(), and sysLog().

t3lib_lock::getId ( )

Return the ID which is currently used

Returns:
string Locking ID

Definition at line 250 of file class.t3lib_lock.php.

t3lib_lock::getLockStatus ( )

Return the status of a lock

Returns:
string Returns TRUE if lock is acquired, FALSE otherwise

Definition at line 269 of file class.t3lib_lock.php.

Referenced by t3lib_formprotection_BackendFormProtection\releaseLock(), and tslib_fe\releasePageGenerationLock().

t3lib_lock::getMethod ( )

Return the locking method which is currently used

Returns:
string Locking method

Definition at line 241 of file class.t3lib_lock.php.

t3lib_lock::getResource ( )

Return the resource which is currently used. Depending on the locking method this can be a filename or a semaphore resource.

Returns:
mixed Locking resource (filename as string or semaphore as resource)

Definition at line 260 of file class.t3lib_lock.php.

t3lib_lock::release ( )

Release the lock

Returns:
boolean Returns TRUE on success or FALSE on failure

Definition at line 201 of file class.t3lib_lock.php.

Referenced by __destruct().

t3lib_lock::setEnableLogging ( isLoggingEnabled)

Enable/ disable logging

Parameters:
boolean$isLoggingEnabled

Definition at line 287 of file class.t3lib_lock.php.

References $isLoggingEnabled.

t3lib_lock::setSyslogFacility ( syslogFacility)

Sets the facility (extension name) for the syslog entry.

Parameters:
string$syslogFacility

Definition at line 278 of file class.t3lib_lock.php.

References $syslogFacility.

t3lib_lock::sysLog ( message,
severity = 0 
)

Adds a common log entry for this locking API using t3lib_div::sysLog(). Example: 25-02-08 17:58 - cms: Locking [simple::0aeafd2a67a6bb8b9543fb9ea25ecbe2]: Acquired

Parameters:
string$message,:The message to be logged
integer$severity,:Severity - 0 is info (default), 1 is notice, 2 is warning, 3 is error, 4 is fatal error
Returns:
void

Definition at line 299 of file class.t3lib_lock.php.

Referenced by acquire().


Member Data Documentation

t3lib_lock::$filepointer [protected]

Definition at line 52 of file class.t3lib_lock.php.

Referenced by acquire().

t3lib_lock::$id [protected]

Definition at line 50 of file class.t3lib_lock.php.

Referenced by __construct().

t3lib_lock::$isAcquired = FALSE [protected]

Definition at line 53 of file class.t3lib_lock.php.

Referenced by acquire().

t3lib_lock::$isLoggingEnabled = TRUE [protected]

Definition at line 58 of file class.t3lib_lock.php.

Referenced by setEnableLogging().

t3lib_lock::$loops = 150 [protected]

Definition at line 55 of file class.t3lib_lock.php.

Referenced by __construct().

t3lib_lock::$method [protected]

Definition at line 49 of file class.t3lib_lock.php.

Referenced by __construct().

t3lib_lock::$resource [protected]

Definition at line 51 of file class.t3lib_lock.php.

t3lib_lock::$step = 200 [protected]

Definition at line 56 of file class.t3lib_lock.php.

Referenced by __construct().

t3lib_lock::$syslogFacility = 'cms' [protected]

Definition at line 57 of file class.t3lib_lock.php.

Referenced by setSyslogFacility().


The documentation for this class was generated from the following file: