Extensions can specify development dependencies in extension.json under the "dev-requires" key. It's identical to the "requires" field. Any requirement that is needed to pass tests, including but not limited to, PHPUnit, QUnit, structure, phan, should be documented in this new field. The main intention is that CI will ensure that all of these dependencies are satisfied before running tests. At standard runtime, the development requirements will be ignored by MediaWiki, since it only checks for real requirements. Scripts can manually check development requirements by calling ExtensionRegistry::setCheckDevRequires( true ) before trying to load things. If both "requires" and "dev-requires" are present, MediaWiki will merge the two together, so the environment will need to satisfy both before proceeding. Bug: T193824 Change-Id: I9b2936666ee3c96f5c976c7a17f11c437c2c7f48
54 lines
1.4 KiB
PHP
54 lines
1.4 KiB
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
|
|
*/
|
|
public function extractInfo( $path, array $info, $version );
|
|
|
|
/**
|
|
* @return array With following keys:
|
|
* 'globals' - variables to be set to $GLOBALS
|
|
* 'defines' - constants to define
|
|
* 'config' - configuration information
|
|
* '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();
|
|
|
|
/**
|
|
* Get the requirements for the provided info
|
|
*
|
|
* @since 1.26
|
|
* @param array $info
|
|
* @param bool $includeDev
|
|
* @return array Where keys are the name to have a constraint on,
|
|
* like 'MediaWiki'. Values are a constraint string like "1.26.1".
|
|
*/
|
|
public function getRequirements( array $info, $includeDev );
|
|
|
|
/**
|
|
* Get the path for additional autoloaders, e.g. the one of Composer.
|
|
*
|
|
* @param string $dir
|
|
* @param array $info
|
|
* @return array Containing the paths for autoloader file(s).
|
|
* @since 1.27
|
|
*/
|
|
public function getExtraAutoloaderPaths( $dir, array $info );
|
|
}
|