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.',
14 public function execute() {
15 $validator = new ExtensionJsonValidator( function ( $msg ) {
16 $this->fatalError( $msg );
18 $validator->checkDependencies();
19 $paths = glob( $this->getArg( 0 ) );
20 foreach ( $paths as $path ) {
22 $validator->validate( $path );
23 $this->output( "$path validates against the schema!\n" );
24 } catch ( ExtensionJsonValidationError
$e ) {
25 $this->fatalError( $e->getMessage() );
31 $maintClass = ValidateRegistrationFile
::class;
32 require_once RUN_MAINTENANCE_IF_MAIN
;