Merge "Improve sorting on SpecialWanted*-Pages"
[mediawiki.git] / maintenance / validateRegistrationFile.php
blob9906990bb5d55bf813a6d20e91fa599e360f7d47
1 <?php
3 require_once __DIR__ . '/Maintenance.php';
5 class ValidateRegistrationFile extends Maintenance {
6 public function __construct() {
7 parent::__construct();
8 $this->addArg( 'path', 'Path to extension.json/skin.json file.', true );
10 public function execute() {
11 $validator = new ExtensionJsonValidator( function( $msg ) {
12 $this->error( $msg, 1 );
13 } );
14 $validator->checkDependencies();
15 $path = $this->getArg( 0 );
16 try {
17 $validator->validate( $path );
18 $this->output( "$path validates against the schema!\n" );
19 } catch ( ExtensionJsonValidationError $e ) {
20 $this->error( $e->getMessage(), 1 );
25 $maintClass = 'ValidateRegistrationFile';
26 require_once RUN_MAINTENANCE_IF_MAIN;