Merge "resources: Use core's manageForeignResources script now we can"

This commit is contained in:
jenkins-bot 2023-04-25 19:09:28 +00:00 committed by Gerrit Code Review
commit 12abc51940
2 changed files with 1 additions and 37 deletions

View file

@ -301,6 +301,7 @@
]
}
},
"ForeignResourcesDir": "modules/lib",
"QUnitTestModule": {
"localBasePath": "tests",
"remoteExtPath": "DiscussionTools/tests",

View file

@ -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;