mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Merge "resources: Use core's manageForeignResources script now we can"
This commit is contained in:
commit
12abc51940
|
@ -301,6 +301,7 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"ForeignResourcesDir": "modules/lib",
|
||||
"QUnitTestModule": {
|
||||
"localBasePath": "tests",
|
||||
"remoteExtPath": "DiscussionTools/tests",
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace MediaWiki\Extension\DiscussionTools\Maintenance;
|
||||
|
||||
use Exception;
|
||||
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'
|
||||
);
|
||||
|
||||
try {
|
||||
return $frm->run( 'update', 'all' );
|
||||
} catch ( Exception $e ) {
|
||||
$this->fatalError( "Error: {$e->getMessage()}" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$maintClass = ManageForeignResources::class;
|
||||
require_once RUN_MAINTENANCE_IF_MAIN;
|
Loading…
Reference in a new issue