wiki.techinc.nl/maintenance/validateRegistrationFile.php
Umherirrender be42e09aa8 build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0
The used phpcs has a bug, so the version 0.9.0 could not be enforced at the moment.
Will be fixed in next version, see T167168

Changed:
- Remove duplicate newline at end of file
- Add space between function and ( for closures
- and -> &&, or -> ||

Change-Id: I4172fb08861729bccd55aecbd07e029e2638d311
2017-06-26 17:14:31 +00:00

26 lines
713 B
PHP

<?php
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 );
}
public function execute() {
$validator = new ExtensionJsonValidator( function ( $msg ) {
$this->error( $msg, 1 );
} );
$validator->checkDependencies();
$path = $this->getArg( 0 );
try {
$validator->validate( $path );
$this->output( "$path validates against the schema!\n" );
} catch ( ExtensionJsonValidationError $e ) {
$this->error( $e->getMessage(), 1 );
}
}
}
$maintClass = 'ValidateRegistrationFile';
require_once RUN_MAINTENANCE_IF_MAIN;