Merge "WatchedItemStore: Remove deprecated Title param to getNextRevision()"
[lhc/web/wiklou.git] / includes / registration / ExtensionRegistry.php
index fb89731..768b488 100644 (file)
@@ -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'] ) ) {