Page MenuHomeWickedGov Phorge

validateRegistrationFile.php
No OneTemporary

Size
1018 B
Referenced Files
None
Subscribers
None

validateRegistrationFile.php

<?php
use MediaWiki\Registration\ExtensionJsonValidationError;
use MediaWiki\Registration\ExtensionJsonValidator;
// @codeCoverageIgnoreStart
require_once __DIR__ . '/Maintenance.php';
// @codeCoverageIgnoreEnd
class ValidateRegistrationFile extends Maintenance {
public function __construct() {
parent::__construct();
$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();
$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() );
}
}
}
}
// @codeCoverageIgnoreStart
$maintClass = ValidateRegistrationFile::class;
require_once RUN_MAINTENANCE_IF_MAIN;
// @codeCoverageIgnoreEnd

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 16:40 (11 h, 58 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
64/92/9dfeba73c8cf88e89190ea0e0b8d
Default Alt Text
validateRegistrationFile.php (1018 B)

Event Timeline