Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4031530
NullLockManager.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1003 B
Referenced Files
None
Subscribers
None
NullLockManager.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment