Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5994712
FetchWmfSitematrix.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
914 B
Referenced Files
None
Subscribers
None
FetchWmfSitematrix.php
View Options
<?php
namespace
Wikimedia\Parsoid\Tools
;
use
Wikimedia\Parsoid\Config\Api\ApiHelper
;
require_once
__DIR__
.
'/Maintenance.php'
;
/**
* Class FetchWmfSitematrix
* Simple script to update sitematrix.json
*/
class
FetchWmfSitematrix
extends
Maintenance
{
/**
* Updates sitematrix.json
*/
public
function
execute
()
{
$apiHelperOpts
=
[
'apiEndpoint'
=>
'https://en.wikipedia.org/w/api.php'
];
$apiHelper
=
new
ApiHelper
(
$apiHelperOpts
);
$apiParams
=
[
'action'
=>
'sitematrix'
,
'format'
=>
'json'
,
'formatversion'
=>
1
];
$response
=
$apiHelper
->
makeRequest
(
$apiParams
);
$fileName
=
__DIR__
.
'/data/wmf.sitematrix.json'
;
$resultStr
=
json_encode
(
$response
,
JSON_PRETTY_PRINT
|
JSON_UNESCAPED_UNICODE
|
JSON_UNESCAPED_SLASHES
);
file_put_contents
(
$fileName
,
$resultStr
);
}
}
$maintClass
=
FetchWmfSitematrix
::
class
;
require_once
PARSOID_RUN_MAINTENANCE_IF_MAIN
;
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 03:27 (4 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
14/fb/86c493afd8a76bfbae2b4dab3481
Default Alt Text
FetchWmfSitematrix.php (914 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment