mediawiki-extensions-Discus.../maintenance/manageForeignResources.php
Timo Tijhof 86d47438d3 maintenance: Use standard doMaintenance boilerplate
Consistent with core, most WMF extensions, and boilerplate as
documented in extensions/README and elsewhere; as per T316722.

Change-Id: I02cfcb2bd3debf877d1cbf8654dff4a98dd354ad
2022-09-30 18:01:57 +02:00

32 lines
699 B
PHP

<?php
namespace MediaWiki\Extension\DiscussionTools\Maintenance;
use ForeignResourceManager;
use Maintenance;
$IP = getenv( 'MW_INSTALL_PATH' );
if ( $IP === false ) {
$IP = __DIR__ . '/../../..';
}
require_once "$IP/maintenance/Maintenance.php";
class ManageForeignResources extends Maintenance {
public function __construct() {
parent::__construct();
$this->requireExtension( 'DiscussionTools' );
}
public function execute() {
$frm = new ForeignResourceManager(
__DIR__ . '/../modules/lib/foreign-resources.yaml',
__DIR__ . '/../modules/lib'
);
return $frm->run( 'update', 'all' );
}
}
$maintClass = ManageForeignResources::class;
require_once RUN_MAINTENANCE_IF_MAIN;