Versioning the extension.json schema will allow us to make breaking changes to the schema in a non-breaking manner. Extensiosn and skins will set a 'manifest_version' value, stating which version of the schema the file is written for. Processor::extractInfo() will be passed the version number, and can switch behavior depending upon it. For backwards-compatability, a version number of 1 is assumed if none is set. The validateRegistrationFile.php script will emit a warning if this is the case. Bug: T99344 Change-Id: I2086a1465ceaeedd1ccc6804fda2c304ad16ffa0
33 lines
868 B
PHP
33 lines
868 B
PHP
<?php
|
|
|
|
/**
|
|
* Processors read associated arrays and register
|
|
* whatever is required
|
|
*
|
|
* @since 1.25
|
|
*/
|
|
interface Processor {
|
|
|
|
/**
|
|
* Main entry point, processes the information
|
|
* provided.
|
|
* Callers should call "callback" after calling
|
|
* this function.
|
|
*
|
|
* @param string $path Absolute path of JSON file
|
|
* @param array $info
|
|
* @param int $version manifest_version for info
|
|
* @return array "credits" information to store
|
|
*/
|
|
public function extractInfo( $path, array $info, $version );
|
|
|
|
/**
|
|
* @return array With following keys:
|
|
* 'globals' - variables to be set to $GLOBALS
|
|
* 'defines' - constants to define
|
|
* 'callbacks' - functions to be executed by the registry
|
|
* 'credits' - metadata to be stored by registry
|
|
* 'attributes' - registration info which isn't a global variable
|
|
*/
|
|
public function getExtractedInfo();
|
|
}
|