class LockManager (View source)

The Lock Manager controls the master lock of the whole site which is mainly used to regenerate code caches in peace.

Constants

LOCKFILE_MAXIMUM_AGE

Properties

protected string $lockPathAndFilename

This file contains the actual lock, set via \flock() in lockSiteOrExit()

protected string $lockFlagPathAndFilename

This file is used to track the status of the site lock: If it exists the site is considered locked.

protected string $lockHoldingPage
protected resource $lockResource

Methods

__construct()

Initializes the manager, removing expired locks

string
getLockPath()

Returns the absolute path to a directory that should contain the lock files

void
removeExpiredLock()

No description

bool
isSiteLocked()

Tells if the site is currently locked

void
exitIfSiteLocked()

Exits if the site is currently locked

void
lockSiteOrExit()

Locks the site for further requests.

void
unlockSite()

Unlocks the site if this request has locked it.

void
doExit()

Exit and emit a message about the reason.

Details

__construct()

Initializes the manager, removing expired locks

protected string getLockPath()

Returns the absolute path to a directory that should contain the lock files

Return Value

string

protected void removeExpiredLock()

No description

Return Value

void

bool isSiteLocked()

Tells if the site is currently locked

Return Value

bool

void exitIfSiteLocked()

Exits if the site is currently locked

Return Value

void

void lockSiteOrExit()

Locks the site for further requests.

Return Value

void

void unlockSite()

Unlocks the site if this request has locked it.

Return Value

void

protected void doExit()

Exit and emit a message about the reason.

Return Value

void