From: Antoine Musso Date: Tue, 13 Mar 2018 09:16:15 +0000 (+0100) Subject: Let install.php detect and inject extensions [2] X-Git-Tag: 1.31.0-rc.0~215 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=836890daf0efee8b452e432fcd52d024d21d5db2;p=lhc%2Fweb%2Fwiklou.git Let install.php detect and inject extensions [2] For CI, I went with a dirty trick to find extensions and either wfLoadExtension() or include them. That has since been ported to Installer::findExtensions() and LocalSettingsGenerator::getText(). The WebInstaller() relies on that to detect extensions and let the user tick the ones to be installed. Add --with-extensions to install.php so one can include all extensions from the command line. Note: The CliInstaller always wfLoad() any skin it can find. The original patch 53926d9d was broken and got reverted. This is the proper one. Bug: T189567 Change-Id: I41820fce12e01224d64ab711e016835ef4d4febc --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index 75d7b7ad78..9d9a26be57 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -74,6 +74,8 @@ production. and non-MySQL ::replace() and ::upsert() no longer roll back the whole transaction on failure. * (T189785) Added a monthly heartbeat ping to the pingback feature. +* The CLI installer (maintenance/install.php) learned to detect and include + extensions. Pass --with-extensions to enable that feature. === External library changes in 1.31 === diff --git a/includes/installer/CliInstaller.php b/includes/installer/CliInstaller.php index 32d2634959..715f5dff1f 100644 --- a/includes/installer/CliInstaller.php +++ b/includes/installer/CliInstaller.php @@ -107,6 +107,11 @@ class CliInstaller extends Installer { $this->setVar( '_AdminPassword', $option['pass'] ); } + // Detect and inject any extension found + if ( isset( $option['with-extensions'] ) ) { + $this->setVar( '_Extensions', array_keys( $this->findExtensions() ) ); + } + // Set up the default skins $skins = array_keys( $this->findExtensions( 'skins' ) ); $this->setVar( '_Skins', $skins ); diff --git a/maintenance/install.php b/maintenance/install.php index 624909452a..438e9dc478 100644 --- a/maintenance/install.php +++ b/maintenance/install.php @@ -88,6 +88,8 @@ class CommandLineInstaller extends Maintenance { false, true ); */ $this->addOption( 'env-checks', "Run environment checks only, don't change anything" ); + + $this->addOption( 'with-extensions', "Detect and include extensions" ); } public function getDbType() {