Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7429421
BlockRestrictionStoreFactory.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
BlockRestrictionStoreFactory.php
View Options
<?php
/**
* @license GPL-2.0-or-later
* @file
*/
namespace
MediaWiki\Block
;
use
MediaWiki\DAO\WikiAwareEntity
;
use
Wikimedia\Rdbms\LBFactory
;
/**
* @author Zabe
*
* @since 1.38
*/
class
BlockRestrictionStoreFactory
{
private
LBFactory
$loadBalancerFactory
;
/** @var BlockRestrictionStore[] */
private
array
$storeCache
=
[];
public
function
__construct
(
LBFactory
$loadBalancerFactory
)
{
$this
->
loadBalancerFactory
=
$loadBalancerFactory
;
}
public
function
getBlockRestrictionStore
(
string
|
false
$wikiId
=
WikiAwareEntity
::
LOCAL
):
BlockRestrictionStore
{
if
(
is_string
(
$wikiId
)
&&
$this
->
loadBalancerFactory
->
getLocalDomainID
()
===
$wikiId
)
{
$wikiId
=
WikiAwareEntity
::
LOCAL
;
}
$storeCacheKey
=
$wikiId
===
WikiAwareEntity
::
LOCAL
?
'LOCAL'
:
'crosswikistore-'
.
$wikiId
;
if
(
!
isset
(
$this
->
storeCache
[
$storeCacheKey
]
)
)
{
$this
->
storeCache
[
$storeCacheKey
]
=
new
BlockRestrictionStore
(
$this
->
loadBalancerFactory
,
$wikiId
);
}
return
$this
->
storeCache
[
$storeCacheKey
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 22, 09:59 (4 h, 38 m ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
cc/39/e1a3230115f850597c96b98d6db8
Default Alt Text
BlockRestrictionStoreFactory.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment