X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FvalidateRegistrationFile.php;h=0d6cfa2412f6663a31c08a4c5da4f930608e5372;hb=187ef28a08e82dd2cf4cbf2c8891db37f7769b03;hp=ea27a7e3c2c353a6c14935034630d2c6f419de4a;hpb=863b4880ad8c244dfb8d99b8488e7e0f64513aea;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/validateRegistrationFile.php b/maintenance/validateRegistrationFile.php index ea27a7e3c2..0d6cfa2412 100644 --- a/maintenance/validateRegistrationFile.php +++ b/maintenance/validateRegistrationFile.php @@ -5,22 +5,28 @@ require_once __DIR__ . '/Maintenance.php'; class ValidateRegistrationFile extends Maintenance { public function __construct() { parent::__construct(); - $this->addArg( 'path', 'Path to extension.json/skin.json file.', true ); + $this->addArg( + 'path', + 'Path or glob pattern to extension.json/skin.json file.', + true + ); } public function execute() { $validator = new ExtensionJsonValidator( function ( $msg ) { $this->fatalError( $msg ); } ); $validator->checkDependencies(); - $path = $this->getArg( 0 ); - try { - $validator->validate( $path ); - $this->output( "$path validates against the schema!\n" ); - } catch ( ExtensionJsonValidationError $e ) { - $this->fatalError( $e->getMessage() ); + $paths = glob( $this->getArg( 0 ) ); + foreach ( $paths as $path ) { + try { + $validator->validate( $path ); + $this->output( "$path validates against the schema!\n" ); + } catch ( ExtensionJsonValidationError $e ) { + $this->fatalError( $e->getMessage() ); + } } } } -$maintClass = 'ValidateRegistrationFile'; +$maintClass = ValidateRegistrationFile::class; require_once RUN_MAINTENANCE_IF_MAIN;