Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F8097440
clearInterwikiCache.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
clearInterwikiCache.php
View Options
<?php
/**
* @license GPL-2.0-or-later
* @file
* @ingroup Maintenance
*/
use
MediaWiki\Maintenance\Maintenance
;
// @codeCoverageIgnoreStart
require_once
__DIR__
.
'/Maintenance.php'
;
// @codeCoverageIgnoreEnd
/**
* Clear the cache of interwiki prefixes.
*
* @ingroup Maintenance
*/
class
ClearInterwikiCache
extends
Maintenance
{
public
function
__construct
()
{
parent
::
__construct
();
$this
->
addDescription
(
'Clear all interwiki links for all languages from the cache'
);
}
public
function
execute
()
{
$lookup
=
$this
->
getServiceContainer
()->
getInterwikiLookup
();
$dbr
=
$this
->
getReplicaDB
();
$prefixes
=
$dbr
->
newSelectQueryBuilder
()
->
select
(
'iw_prefix'
)
->
from
(
'interwiki'
)
->
caller
(
__METHOD__
)
->
fetchFieldValues
();
foreach
(
$prefixes
as
$prefix
)
{
$this
->
output
(
"...$prefix
\n
"
);
$lookup
->
invalidateCache
(
$prefix
);
}
$this
->
output
(
"done
\n
"
);
}
}
// @codeCoverageIgnoreStart
$maintClass
=
ClearInterwikiCache
::
class
;
require_once
RUN_MAINTENANCE_IF_MAIN
;
// @codeCoverageIgnoreEnd
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Dec 8, 01:49 (1 d, 6 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
43/b1/3e8369a6eed14ca510297556b077
Default Alt Text
clearInterwikiCache.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment