Moodle PHP Documentation 4.4
Moodle 4.4.1 (Build: 20240610) (db07c09afc5)
core\lock\installation_lock_factory Class Reference
Inheritance diagram for core\lock\installation_lock_factory:
core\lock\lock_factory

Public Member Functions

 __construct ($type)
 Create this lock factory.
 
 extend_lock ()
 
 get_lock ($resource, $timeout, $maxlifetime=86400)
 Get a lock within the specified timeout or return false.
 
 is_available ()
 This lock factory is only available during the initial installation.
 
 release_lock (lock $lock)
 Release a lock that was previously obtained with @lock.
 
 supports_auto_release ()
 This lock type will be automatically released when a process ends.
 
 supports_recursion ()
 
 supports_timeout ()
 Return information about the blocking behaviour of the lock type on this platform.
 

Protected Member Functions

 get_debug_info ()
 Get some info that might be useful for debugging.
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

core\lock\installation_lock_factory::__construct ( $type)

Create this lock factory.

Parameters
string$type- The type, e.g. cron, cache, session

Implements core\lock\lock_factory.

Member Function Documentation

◆ extend_lock()

core\lock\installation_lock_factory::extend_lock ( )
Deprecated
since Moodle 3.10.

◆ get_debug_info()

core\lock\installation_lock_factory::get_debug_info ( )
protected

Get some info that might be useful for debugging.

Return values
boolean- string

◆ get_lock()

core\lock\installation_lock_factory::get_lock ( $resource,
$timeout,
$maxlifetime = 86400 )

Get a lock within the specified timeout or return false.

Parameters
string$resource- The identifier for the lock. Should use frankenstyle prefix.
int$timeout- The number of seconds to wait for a lock before giving up.
int$maxlifetime- Unused by this lock type.
Return values
boolean- true if a lock was obtained.

Implements core\lock\lock_factory.

◆ is_available()

core\lock\installation_lock_factory::is_available ( )

This lock factory is only available during the initial installation.

To use it at any other time would be potentially dangerous.

Return values
boolean

Implements core\lock\lock_factory.

◆ release_lock()

core\lock\installation_lock_factory::release_lock ( lock $lock)

Release a lock that was previously obtained with @lock.

Parameters
lock$lock- A lock obtained from this factory.
Return values
boolean- true if the lock is no longer held (including if it was never held).

Implements core\lock\lock_factory.

◆ supports_auto_release()

core\lock\installation_lock_factory::supports_auto_release ( )

This lock type will be automatically released when a process ends.

Return values
boolean- True

Implements core\lock\lock_factory.

◆ supports_recursion()

core\lock\installation_lock_factory::supports_recursion ( )
Deprecated
since Moodle 3.10.

◆ supports_timeout()

core\lock\installation_lock_factory::supports_timeout ( )

Return information about the blocking behaviour of the lock type on this platform.

Return values
boolean- False if attempting to get a lock will block indefinitely.

Implements core\lock\lock_factory.


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