Merge "Only show config-install-success on command line installer where it makes...
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 28 Mar 2019 04:00:53 +0000 (04:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 28 Mar 2019 04:00:53 +0000 (04:00 +0000)
1  2 
includes/installer/Installer.php
includes/installer/i18n/en.json

@@@ -686,15 -686,15 +686,15 @@@ abstract class Installer 
         * @return string
         */
        public function parse( $text, $lineStart = false ) {
 -              global $wgParser;
 +              $parser = MediaWikiServices::getInstance()->getParser();
  
                try {
 -                      $out = $wgParser->parse( $text, $this->parserTitle, $this->parserOptions, $lineStart );
 +                      $out = $parser->parse( $text, $this->parserTitle, $this->parserOptions, $lineStart );
                        $html = $out->getText( [
                                'enableSectionEditLinks' => false,
                                'unwrap' => true,
                        ] );
 -              } catch ( MediaWiki\Services\ServiceDisabledException $e ) {
 +              } catch ( Wikimedia\Services\ServiceDisabledException $e ) {
                        $html = '<!--DB access attempted during parse-->  ' . htmlspecialchars( $text );
                }
  
                }
  
                if ( !$caches ) {
 -                      $key = 'config-no-cache-apcu';
 -                      $this->showMessage( $key );
 +                      $this->showMessage( 'config-no-cache-apcu' );
                }
  
                $this->setVar( '_Caches', $caches );
        public function dirIsExecutable( $dir, $url ) {
                $scriptTypes = [
                        'php' => [
 -                              "<?php echo 'ex' . 'ec';",
 -                              "#!/var/env php\n<?php echo 'ex' . 'ec';",
 +                              "<?php echo 'exec';",
 +                              "#!/var/env php\n<?php echo 'exec';",
                        ],
                ];
  
        /**
         * Installs the auto-detected extensions.
         *
 +       * @suppress SecurityCheck-OTHER It thinks $exts/$IP is user controlled but they are not.
         * @return Status
         */
        protected function includeExtensions() {
                $data = $registry->readFromQueue( $queue );
                $wgAutoloadClasses += $data['autoload'];
  
 -              /** @suppress PhanUndeclaredVariable $wgHooks is set by DefaultSettings */
 +              // @phan-suppress-next-line PhanUndeclaredVariable $wgHooks is set by DefaultSettings
                $hooksWeWant = $wgHooks['LoadExtensionSchemaUpdates'] ?? [];
  
                if ( isset( $data['globals']['wgHooks']['LoadExtensionSchemaUpdates'] ) ) {
                }
                if ( $status->isOk() ) {
                        $this->showMessage(
-                               'config-install-success',
-                               $this->getVar( 'wgServer' ),
-                               $this->getVar( 'wgScriptPath' )
+                               'config-install-db-success'
                        );
                        $this->setVar( '_InstallDone', true );
                }
        }
  
        /**
 -       * Generate a secret value for variables using our CryptRand generator.
 -       * Produce a warning if the random source was insecure.
 +       * Generate a secret value for variables using a secure generator.
         *
         * @param array $keys
         * @return Status
@@@ -61,9 -61,9 +61,9 @@@
        "config-no-cache-apcu": "<strong>Warning:</strong> Could not find [https://secure.php.net/apcu APCu] or [https://www.iis.net/downloads/microsoft/wincache-extension WinCache].\nObject caching is not enabled.",
        "config-mod-security": "<strong>Warning:</strong> Your web server has [https://modsecurity.org/ mod_security]/mod_security2 enabled. Many common configurations of this will cause problems for MediaWiki and other software that allows users to post arbitrary content.\nIf possible, this should be disabled. Otherwise, refer to [https://modsecurity.org/documentation/ mod_security documentation] or contact your host's support if you encounter random errors.",
  
 -      "config-diff3-bad": "GNU diff3 not found.",
 +      "config-diff3-bad": "GNU diff3 text comparison utility not found. You can ignore this for now, but might run into edit conflicts more frequently.",
        "config-git": "Found the Git version control software: <code>$1</code>.",
 -      "config-git-bad": "Git version control software not found.",
 +      "config-git-bad": "Git version control software not found. You can ignore this for now. Note Special:Version will not display commit hashes.",
        "config-imagemagick": "Found ImageMagick: <code>$1</code>.\nImage thumbnailing will be enabled if you enable uploads.",
        "config-gd": "Found GD graphics library built-in.\nImage thumbnailing will be enabled if you enable uploads.",
        "config-no-scaling": "Could not find GD library or ImageMagick.\nImage thumbnailing will be disabled.",
@@@ -78,7 -78,7 +78,7 @@@
        "config-using-32bit": "<strong>Warning:</strong> your system appears to be running with 32-bit integers. This is [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:32-bit not advised].",
        "config-db-type": "Database type:",
        "config-db-host": "Database host:",
 -      "config-db-host-help": "If your database server is on different server, enter the host name or IP address here.\n\nIf you are using shared web hosting, your hosting provider should give you the correct host name in their documentation.\n\nIf you are installing on a Windows server and using MySQL, using \"localhost\" may not work for the server name. If it does not, try \"127.0.0.1\" for the local IP address.\n\nIf you are using PostgreSQL, leave this field blank to connect via a Unix socket.",
 +      "config-db-host-help": "If your database server is on a different server, enter the host name or IP address here.\n\nIf you are using shared web hosting, your hosting provider should give you the correct host name in their documentation.\n\nIf you are using MySQL, using \"localhost\" may not work for the server name. If it does not, try \"127.0.0.1\" for the local IP address.\n\nIf you are using PostgreSQL, leave this field blank to connect via a Unix socket.",
        "config-db-host-oracle": "Database TNS:",
        "config-db-host-oracle-help": "Enter a valid [http://download.oracle.com/docs/cd/B28359_01/network.111/b28317/tnsnames.htm Local Connect Name]; a tnsnames.ora file must be visible to this installation.<br />If you are using client libraries 10g or newer you can also use the [http://download.oracle.com/docs/cd/E11882_01/network.112/e10836/naming.htm Easy Connect] naming method.",
        "config-db-wiki-settings": "Identify this wiki",
        "config-invalid-db-server-oracle": "Invalid database TNS \"$1\".\nUse either \"TNS Name\" or an \"Easy Connect\" string ([http://docs.oracle.com/cd/E11882_01/network.112/e10836/naming.htm Oracle Naming Methods]).",
        "config-invalid-db-name": "Invalid database name \"$1\".\nUse only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and hyphens (-).",
        "config-invalid-db-prefix": "Invalid database prefix \"$1\".\nUse only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and hyphens (-).",
 -      "config-connection-error": "$1.\n\nCheck the host, username and password and try again.",
 +      "config-connection-error": "$1.\n\nCheck the host, username and password and try again. If using \"localhost\" as the database host, try using \"127.0.0.1\" instead (or vice versa).",
        "config-invalid-schema": "Invalid schema for MediaWiki \"$1\".\nUse only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).",
        "config-db-sys-create-oracle": "Installer only supports using a SYSDBA account for creating a new account.",
        "config-db-sys-user-exists-oracle": "User account \"$1\" already exists. SYSDBA can only be used for creating of a new account!",
        "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-install-success": "MediaWiki has been successfully installed. You can now visit <$1$2> to view your wiki.\nIf you have questions, check out our frequently asked questions list:\n<https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ> or use one of the\nsupport forums linked on that page.",
+       "config-install-db-success": "Database was successfully set up",
        "config-download-localsettings": "Download <code>LocalSettings.php</code>",
        "config-help": "help",
        "config-help-tooltip": "click to expand",