Page MenuHomeWickedGov Phorge

NullLockManager.php
No OneTemporary

Size
1003 B
Referenced Files
None
Subscribers
None

NullLockManager.php

<?php
/**
* @license GPL-2.0-or-later
* @file
*/
/**
* Simple lock management based on in-process reference counting.
*
* @since 1.19
* @ingroup LockManager
*/
class NullLockManager extends LockManager {
/** @inheritDoc */
protected function doLock( array $paths, $type ) {
foreach ( $paths as $path ) {
if ( isset( $this->locksHeld[$path][$type] ) ) {
++$this->locksHeld[$path][$type];
} else {
$this->locksHeld[$path][$type] = 1;
}
}
return StatusValue::newGood();
}
/** @inheritDoc */
protected function doUnlock( array $paths, $type ) {
$status = StatusValue::newGood();
foreach ( $paths as $path ) {
if ( isset( $this->locksHeld[$path][$type] ) ) {
if ( --$this->locksHeld[$path][$type] <= 0 ) {
unset( $this->locksHeld[$path][$type] );
if ( !$this->locksHeld[$path] ) {
unset( $this->locksHeld[$path] ); // clean up
}
}
} else {
$status->warning( 'lockmanager-notlocked', $path );
}
}
return $status;
}
}

File Metadata

Mime Type
text/x-php
Expires
Aug 14 2026, 23:20 (13 w, 14 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4a/99/4b658fbf96e8ea63c4c78028af55
Default Alt Text
NullLockManager.php (1003 B)

Event Timeline