jenkins-bot has submitted this change and it was merged.

Change subject: installer: Allow specifying where LocalSettings.php should be 
saved
......................................................................


installer: Allow specifying where LocalSettings.php should be saved

This allows software packages to specify where the LocalSettings.php
file should be saved to when the user is downloading it from the web
installer.

Bug: T123151
Change-Id: I06ded602be9aac0a10773e9d85c4d1585a70933b
(cherry picked from commit 4dba618ae0eae04ef8902be45fa98fd55ef73483)
---
M includes/installer/WebInstaller.php
M includes/installer/WebInstallerComplete.php
M includes/installer/i18n/en.json
M includes/installer/i18n/qqq.json
4 files changed, 25 insertions(+), 2 deletions(-)

Approvals:
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/installer/WebInstaller.php 
b/includes/installer/WebInstaller.php
index 4c4e6b7..c08212e 100644
--- a/includes/installer/WebInstaller.php
+++ b/includes/installer/WebInstaller.php
@@ -1157,6 +1157,20 @@
        }
 
        /**
+        * If the software package wants the LocalSettings.php file
+        * to be placed in a specific location, override this function
+        * (see mw-config/overrides/README) to return the path of
+        * where the file should be saved, or false for a generic
+        * "in the base of your install"
+        *
+        * @since 1.27
+        * @return string|bool
+        */
+       public function getLocalSettingsLocation() {
+               return false;
+       }
+
+       /**
         * @return bool
         */
        public function envCheckPath() {
diff --git a/includes/installer/WebInstallerComplete.php 
b/includes/installer/WebInstallerComplete.php
index 11a1833..456058e 100644
--- a/includes/installer/WebInstallerComplete.php
+++ b/includes/installer/WebInstallerComplete.php
@@ -37,13 +37,20 @@
 
                $this->startForm();
                $this->parent->disableLinkPopups();
+               $location = $this->parent->getLocalSettingsLocation();
+               $msg = 'config-install-done';
+               if ( $location !== false ) {
+                       // config-install-done-path
+                       $msg .= '-path';
+               }
                $this->addHTML(
                        $this->parent->getInfoBox(
-                               wfMessage( 'config-install-done',
+                               wfMessage( $msg,
                                        $lsUrl,
                                        $this->getVar( 'wgServer' ) .
                                        $this->getVar( 'wgScriptPath' ) . 
'/index.php',
-                                       '<downloadlink/>'
+                                       '<downloadlink/>',
+                                       $location ?: ''
                                )->plain(), 'tick-32.png'
                        )
                );
diff --git a/includes/installer/i18n/en.json b/includes/installer/i18n/en.json
index 8a66ad9..2d9b991 100644
--- a/includes/installer/i18n/en.json
+++ b/includes/installer/i18n/en.json
@@ -303,6 +303,7 @@
        "config-install-extension-tables": "Creating tables for enabled 
extensions",
        "config-install-mainpage-failed": "Could not insert main page: $1",
        "config-install-done": "<strong>Congratulations!</strong>\nYou have 
installed MediaWiki.\n\nThe installer has generated a 
<code>LocalSettings.php</code> file.\nIt contains all your 
configuration.\n\nYou will need to download it and put it in the base of your 
wiki installation (the same directory as index.php). The download should have 
started automatically.\n\nIf the download was not offered, or if you cancelled 
it, you can restart the download by clicking the link 
below:\n\n$3\n\n<strong>Note:</strong> If you do not do this now, this 
generated configuration file will not be available to you later if you exit the 
installation without downloading it.\n\nWhen that has been done, you can 
<strong>[$2 enter your wiki]</strong>.",
+       "config-install-done-path": "<strong>Congratulations!</strong>\nYou 
have installed MediaWiki.\n\nThe installer has generated a 
<code>LocalSettings.php</code> file.\nIt contains all your 
configuration.\n\nYou will need to download it and put it at <code>$4</code>. 
The download should have started automatically.\n\nIf the download was not 
offered, or if you cancelled it, you can restart the download by clicking the 
link below:\n\n$3\n\n<strong>Note:</strong> If you do not do this now, this 
generated configuration file will not be available to you later if you exit the 
installation without downloading it.\n\nWhen that has been done, you can 
<strong>[$2 enter your wiki]</strong>.",
        "config-download-localsettings": "Download 
<code>LocalSettings.php</code>",
        "config-help": "help",
        "config-help-tooltip": "click to expand",
diff --git a/includes/installer/i18n/qqq.json b/includes/installer/i18n/qqq.json
index 77d4569..307cf4d 100644
--- a/includes/installer/i18n/qqq.json
+++ b/includes/installer/i18n/qqq.json
@@ -321,6 +321,7 @@
        "config-install-extension-tables": "Notice shown to the user during the 
install about progress.",
        "config-install-mainpage-failed": "Used as error message. 
Parameters:\n* $1 - detailed error message",
        "config-install-done": "Parameters:\n* $1 is the URL to LocalSettings 
download\n* $2 is a link to the wiki.\n* $3 is a download link with attached 
download icon. The config-download-localsettings message will be used as the 
link text.",
+       "config-install-done-path": "Parameters:\n* $1 is the URL to 
LocalSettings download\n* $2 is a link to the wiki.\n* $3 is a download link 
with attached download icon. The config-download-localsettings message will be 
used as the link text.\n* $4 is the filesystem location of where the 
LocalSettings.php file should be saved to.",
        "config-download-localsettings": "The link text used in the download 
link in config-install-done.",
        "config-help": "This is used in help boxes.\n{{Identical|Help}}",
        "config-help-tooltip": "Tooltip for the 'help' links 
({{msg-mw|config-help}}), to make it clear they'll expand in place rather than 
open a new page",

-- 
To view, visit https://gerrit.wikimedia.org/r/295852
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I06ded602be9aac0a10773e9d85c4d1585a70933b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: REL1_27
Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@kitano.nl>
Gerrit-Reviewer: Waldir <wal...@email.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to