X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fregistration%2FExtensionRegistry.php;h=768b4883234db0dceac000772f1be79859523c6e;hb=5074ec954b4ce3890a27562163d3a7a7c7bc3495;hp=2607e5ab29ea0233c1935a9cef0ba6c1afa52c9d;hpb=61702397aa04572251869935245c07a0821f6c4a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/registration/ExtensionRegistry.php b/includes/registration/ExtensionRegistry.php index 2607e5ab29..768b488323 100644 --- a/includes/registration/ExtensionRegistry.php +++ b/includes/registration/ExtensionRegistry.php @@ -86,6 +86,13 @@ class ExtensionRegistry { */ protected $testAttributes = []; + /** + * Whether to check dev-requires + * + * @var bool + */ + protected $checkDev = false; + /** * @var ExtensionRegistry */ @@ -103,6 +110,14 @@ class ExtensionRegistry { return self::$instance; } + /** + * @since 1.34 + * @param bool $check + */ + public function setCheckDevRequires( $check ) { + $this->checkDev = $check; + } + /** * @param string $path Absolute path to the JSON file */ @@ -148,6 +163,7 @@ class ExtensionRegistry { 'registration' => self::CACHE_VERSION, 'mediawiki' => $wgVersion, 'abilities' => $this->getAbilities(), + 'checkDev' => $this->checkDev, ]; // We use a try/catch because we don't want to fail here @@ -295,7 +311,7 @@ class ExtensionRegistry { } // get all requirements/dependencies for this extension - $requires = $processor->getRequirements( $info ); + $requires = $processor->getRequirements( $info, $this->checkDev ); // validate the information needed and add the requirements if ( is_array( $requires ) && $requires && isset( $info['name'] ) ) { @@ -413,10 +429,12 @@ class ExtensionRegistry { * * If some extensions are already queued, this will load * those as well. - * + * TODO: Remove in MediaWiki 1.35 + * @deprecated since 1.34, use ExtensionRegistry->queue() instead * @param string $path Absolute path to the JSON file */ public function load( $path ) { + wfDeprecated( __METHOD__, '1.34' ); $this->loadFromQueue(); // First clear the queue $this->queue( $path ); $this->loadFromQueue();