Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4151085
MockPoolCounterFailing.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
MockPoolCounterFailing.php
View Options
<?php
/**
* @license GPL-2.0-or-later
* @file
*/
use
MediaWiki\PoolCounter\PoolCounter
;
use
MediaWiki\Status\Status
;
/**
* Fake PoolCounter that always fails
*/
class
MockPoolCounterFailing
extends
PoolCounter
{
/** @var Status|null */
private
$mockAcquire
;
/** @var Status|null */
private
$mockRelease
;
/** @inheritDoc */
public
function
__construct
(
$conf
,
$type
,
$key
)
{
$conf
+=
[
'timeout'
=>
15
,
'workers'
=>
2
,
'maxqueue'
=>
50
,
];
parent
::
__construct
(
$conf
,
$type
,
$key
);
$this
->
mockAcquire
=
$conf
[
'mockAcquire'
]
??
null
;
$this
->
mockRelease
=
$conf
[
'mockRelease'
]
??
null
;
}
/** @inheritDoc */
public
function
acquireForMe
(
$timeout
=
null
)
{
return
$this
->
mockAcquire
??
Status
::
newGood
(
PoolCounter
::
QUEUE_FULL
);
}
/** @inheritDoc */
public
function
acquireForAnyone
(
$timeout
=
null
)
{
return
$this
->
mockAcquire
??
Status
::
newGood
(
PoolCounter
::
QUEUE_FULL
);
}
/** @inheritDoc */
public
function
release
()
{
return
$this
->
mockRelease
??
Status
::
newGood
(
PoolCounter
::
NOT_LOCKED
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 19 2026, 19:49 (7 w, 13 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
16/2c/b7b0be165d42fbbceffb935a9874
Default Alt Text
MockPoolCounterFailing.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment