X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FvalidateRegistrationFile.php;h=a704d61a9361a34fbbd8cc178e89292af18d5b4a;hp=4b07796d2f68016143bb4974d7f27d8a03f082d8;hb=7afced64454ad30d688540f7626448ac2faefebb;hpb=236488d398046838059f758b0915341648b64c7b diff --git a/maintenance/validateRegistrationFile.php b/maintenance/validateRegistrationFile.php index 4b07796d2f..a704d61a93 100644 --- a/maintenance/validateRegistrationFile.php +++ b/maintenance/validateRegistrationFile.php @@ -5,19 +5,26 @@ 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() ); + } } } }