MediaWiki REL1_30
validateRegistrationFile.php
Go to the documentation of this file.
1<?php
2
3require_once __DIR__ . '/Maintenance.php';
4
6 public function __construct() {
7 parent::__construct();
8 $this->addArg( 'path', 'Path to extension.json/skin.json file.', true );
9 }
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" );
20 $this->error( $e->getMessage(), 1 );
21 }
22 }
23}
24
25$maintClass = 'ValidateRegistrationFile';
26require_once RUN_MAINTENANCE_IF_MAIN;
Abstract maintenance class for quickly writing and churning out maintenance scripts with minimal effo...
addArg( $arg, $description, $required=true)
Add some args that are needed.
getArg( $argId=0, $default=null)
Get an argument.
__construct()
Default constructor.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling output() to send it all. It could be easily changed to send incrementally if that becomes useful
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults error
Definition hooks.txt:2581
returning false will NOT prevent logging $e
Definition hooks.txt:2146
require_once RUN_MAINTENANCE_IF_MAIN