3 require_once __DIR__
. '/Maintenance.php';
5 class ValidateRegistrationFile
extends Maintenance
{
6 public function __construct() {
10 'Path or glob pattern to extension.json/skin.json file.',
15 public function execute() {
16 $validator = new ExtensionJsonValidator( function ( $msg ) {
17 $this->fatalError( $msg );
19 $validator->checkDependencies();
20 $paths = glob( $this->getArg( 0 ) );
21 foreach ( $paths as $path ) {
23 $validator->validate( $path );
24 $this->output( "$path validates against the schema!\n" );
25 } catch ( ExtensionJsonValidationError
$e ) {
26 $this->fatalError( $e->getMessage() );
32 $maintClass = ValidateRegistrationFile
::class;
33 require_once RUN_MAINTENANCE_IF_MAIN
;