MediaWiki  master
ExtensionJsonValidator Class Reference

Validate extension.json files against their JSON schema. More...

Public Member Functions

 __construct (callable $missingDepCallback)
 
 checkDependencies ()
 
 validate ( $path)
 

Private Attributes

callable $missingDepCallback
 

Detailed Description

Validate extension.json files against their JSON schema.

This is used for static validation from the command-line via validateRegistrationFile.php, and the PHPUnit structure test suite (ExtensionJsonValidationTest).

The files are normally read by the ExtensionRegistry and ExtensionProcessor classes.

Since
1.29

Definition at line 39 of file ExtensionJsonValidator.php.

Constructor & Destructor Documentation

◆ __construct()

ExtensionJsonValidator::__construct ( callable  $missingDepCallback)
Parameters
callable$missingDepCallback

Definition at line 49 of file ExtensionJsonValidator.php.

References $missingDepCallback.

Member Function Documentation

◆ checkDependencies()

ExtensionJsonValidator::checkDependencies ( )
Returns
bool

Definition at line 57 of file ExtensionJsonValidator.php.

Referenced by ValidateRegistrationFile\execute().

◆ validate()

ExtensionJsonValidator::validate (   $path)
Parameters
string$pathfile to validate
Returns
bool true if passes validation
Exceptions
ExtensionJsonValidationErroron any failure

Definition at line 86 of file ExtensionJsonValidator.php.

References $path, ExtensionRegistry\MANIFEST_VERSION, ExtensionRegistry\OLDEST_MANIFEST_VERSION, and wfParseUrl().

Member Data Documentation

◆ $missingDepCallback

callable ExtensionJsonValidator::$missingDepCallback
private

Definition at line 44 of file ExtensionJsonValidator.php.

Referenced by __construct().


The documentation for this class was generated from the following file: