2019-10-18 12:12:55 +00:00
|
|
|
<?php
|
|
|
|
|
2020-02-19 01:41:05 +00:00
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Maintenance;
|
|
|
|
|
|
|
|
use ForeignResourceManager;
|
|
|
|
use Maintenance;
|
|
|
|
|
2022-09-29 17:00:38 +00:00
|
|
|
$IP = getenv( 'MW_INSTALL_PATH' );
|
|
|
|
if ( $IP === false ) {
|
|
|
|
$IP = __DIR__ . '/../../..';
|
2020-02-19 01:41:05 +00:00
|
|
|
}
|
2022-09-29 17:00:38 +00:00
|
|
|
require_once "$IP/maintenance/Maintenance.php";
|
2019-10-18 12:12:55 +00:00
|
|
|
|
2020-01-13 19:48:11 +00:00
|
|
|
class ManageForeignResources extends Maintenance {
|
2020-01-13 21:15:43 +00:00
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
parent::__construct();
|
|
|
|
$this->requireExtension( 'DiscussionTools' );
|
|
|
|
}
|
|
|
|
|
2019-10-18 12:12:55 +00:00
|
|
|
public function execute() {
|
|
|
|
$frm = new ForeignResourceManager(
|
|
|
|
__DIR__ . '/../modules/lib/foreign-resources.yaml',
|
|
|
|
__DIR__ . '/../modules/lib'
|
|
|
|
);
|
|
|
|
return $frm->run( 'update', 'all' );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-13 19:48:11 +00:00
|
|
|
$maintClass = ManageForeignResources::class;
|
2019-10-18 12:12:55 +00:00
|
|
|
require_once RUN_MAINTENANCE_IF_MAIN;
|