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

Change subject: WebInstaller: Don't call getSoftwareLink()
......................................................................


WebInstaller: Don't call getSoftwareLink()

This gets the web installer working without the mysql or mysqli
PHP extension, which is not needed for other database systems.

* Avoid "lego" construction: put link text directly in the messages,
  which because the messages are parsed as wikitext, is easy to do.
* Put URLs in separate, ignored messages to avoid duplication in
  Database*::getSoftwareLink().
* Because I had to touch a MySQL-related i18n message, I figured
  this would be a good time to address bug 28281 (regarding MySQL
  forks and Special:Version).
* Other miscellaneous message changes, such as recommending the
  mysqli PHP extension over the old, deprecated mysql extension.

Bug: 28281
Bug: 58167
Change-Id: I6dbc9d32c8c2d8f233a67d574229b80444885aea
---
M RELEASE-NOTES-1.23
M includes/db/DatabaseMssql.php
M includes/db/DatabaseMysqlBase.php
M includes/db/DatabaseOracle.php
M includes/db/DatabasePostgres.php
M includes/db/DatabaseSqlite.php
M includes/installer/Installer.i18n.php
M includes/installer/WebInstallerPage.php
M languages/messages/MessagesEn.php
M languages/messages/MessagesQqq.php
M maintenance/language/messageTypes.inc
M maintenance/language/messages.inc
12 files changed, 66 insertions(+), 20 deletions(-)

Approvals:
  Parent5446: Looks good to me, but someone else must approve
  MarkAHershberger: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23
index e017a62..1b0a4b7 100644
--- a/RELEASE-NOTES-1.23
+++ b/RELEASE-NOTES-1.23
@@ -102,6 +102,8 @@
   remaining page content.
 * (bug 23542) imagelinks now stores both the redirect and target (as
   templatelinks does).
+* (bug 58167) The web installer no longer throws an exception when PHP is
+  compiled without support for MySQL yet with support for another DBMS.
 
 === Web API changes in 1.23 ===
 * (bug 54884) action=parse&prop=categories now indicates hidden and missing
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 3a89cd5..7fc655f 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -729,7 +729,7 @@
         * @return string wikitext of a link to the server software's web site
         */
        public function getSoftwareLink() {
-               return "[http://www.microsoft.com/sql/ MS SQL Server]";
+               return "[{{int:version-db-mssql-url}} MS SQL Server]";
        }
 
        /**
diff --git a/includes/db/DatabaseMysqlBase.php 
b/includes/db/DatabaseMysqlBase.php
index 12fee94..1e29e1b 100644
--- a/includes/db/DatabaseMysqlBase.php
+++ b/includes/db/DatabaseMysqlBase.php
@@ -763,7 +763,14 @@
         * @return string
         */
        public function getSoftwareLink() {
-               return '[http://www.mysql.com/ MySQL]';
+               $version = $this->getServerVersion();
+               if ( strpos( $version, 'MariaDB' ) !== false ) {
+                       return '[{{int:version-db-mariadb-url}} MariaDB]';
+               } elseif ( strpos( $version, 'percona' ) !== false ) {
+                       return '[{{int:version-db-percona-url}} Percona 
Server]';
+               } else {
+                       return '[{{int:version-db-mysql-url}} MySQL]';
+               }
        }
 
        /**
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php
index 3336d1e..9761639 100644
--- a/includes/db/DatabaseOracle.php
+++ b/includes/db/DatabaseOracle.php
@@ -939,7 +939,7 @@
         * @return string wikitext of a link to the server software's web site
         */
        public function getSoftwareLink() {
-               return '[http://www.oracle.com/ Oracle]';
+               return '[{{int:version-db-oracle-url}} Oracle]';
        }
 
        /**
diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php
index 21a7bcf..536e464 100644
--- a/includes/db/DatabasePostgres.php
+++ b/includes/db/DatabasePostgres.php
@@ -1140,7 +1140,7 @@
         * @return string wikitext of a link to the server software's web site
         */
        public function getSoftwareLink() {
-               return '[http://www.postgresql.org/ PostgreSQL]';
+               return '[{{int:version-db-postgres-url}} PostgreSQL]';
        }
 
        /**
diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php
index ea35391..12eca7b 100644
--- a/includes/db/DatabaseSqlite.php
+++ b/includes/db/DatabaseSqlite.php
@@ -655,7 +655,7 @@
         * @return string wikitext of a link to the server software's web site
         */
        public function getSoftwareLink() {
-               return "[http://sqlite.org/ SQLite]";
+               return "[{{int:version-db-sqlite-url}} SQLite]";
        }
 
        /**
diff --git a/includes/installer/Installer.i18n.php 
b/includes/installer/Installer.i18n.php
index 68dd216..3ba91d4 100644
--- a/includes/installer/Installer.i18n.php
+++ b/includes/installer/Installer.i18n.php
@@ -100,9 +100,8 @@
        'config-no-db'                    => 'Could not find a suitable 
database driver! You need to install a database driver for PHP.
 The following database types are supported: $1.
 
-If you are on shared hosting, ask your hosting provider to install a suitable 
database driver.
-If you compiled PHP yourself, reconfigure it with a database client enabled, 
for example using <code>./configure --with-mysql</code>.
-If you installed PHP from a Debian or Ubuntu package, then you also need 
install the php5-mysql module.',
+If you compiled PHP yourself, reconfigure it with a database client enabled, 
for example, using <code>./configure --with-mysqli</code>.
+If you installed PHP from a Debian or Ubuntu package, then you also need to 
install, for example, the <code>php5-mysql</code> package.',
        'config-outdated-sqlite'          => "'''Warning:''' you have SQLite 
$1, which is lower than minimum required version $2. SQLite will be 
unavailable.",
        'config-no-fts3'                  => "'''Warning:''' SQLite is compiled 
without the [//sqlite.org/fts3.html FTS3 module], search features will be 
unavailable on this backend.",
        'config-register-globals'         => "'''Warning: PHP's 
<code>[http://php.net/register_globals register_globals]</code> option is 
enabled.'''
@@ -243,7 +242,7 @@
 Consider putting the database somewhere else altogether, for example in 
<code>/var/lib/mediawiki/yourwiki</code>.",
        'config-oracle-def-ts'            => 'Default tablespace:',
        'config-oracle-temp-ts'           => 'Temporary tablespace:',
-       'config-type-mysql'               => 'MySQL',
+       'config-type-mysql'               => 'MySQL (or compatible)',
        'config-type-postgres'            => 'PostgreSQL',
        'config-type-sqlite'              => 'SQLite',
        'config-type-oracle'              => 'Oracle',
@@ -252,10 +251,10 @@
 $1
 
 If you do not see the database system you are trying to use listed below, then 
follow the instructions linked above to enable support.',
-       'config-support-mysql'            => '* $1 is the primary target for 
MediaWiki and is best supported 
([http://www.php.net/manual/en/mysql.installation.php how to compile PHP with 
MySQL support])',
-       'config-support-postgres'         => '* $1 is a popular open source 
database system as an alternative to MySQL 
([http://www.php.net/manual/en/pgsql.installation.php how to compile PHP with 
PostgreSQL support]). There may be some minor outstanding bugs, and it is not 
recommended for use in a production environment.',
-       'config-support-sqlite'           => '* $1 is a lightweight database 
system which is very well supported. 
([http://www.php.net/manual/en/pdo.installation.php How to compile PHP with 
SQLite support], uses PDO)',
-       'config-support-oracle'           => '* $1 is a commercial enterprise 
database. ([http://www.php.net/manual/en/oci8.installation.php How to compile 
PHP with OCI8 support])',
+       'config-dbsupport-mysql'          => '* [{{int:version-db-mysql-url}} 
MySQL] is the primary target for MediaWiki and is best supported. MediaWiki 
also works with [{{int:version-db-mariadb-url}} MariaDB] and 
[{{int:version-db-percona-url}} Percona Server], which are MySQL compatible. 
([http://www.php.net/manual/en/mysqli.installation.php How to compile PHP with 
MySQL support])',
+       'config-dbsupport-postgres'       => '* 
[{{int:version-db-postgres-url}} PostgreSQL] is a popular open source database 
system as an alternative to MySQL. There may be some minor outstanding bugs, 
and it is not recommended for use in a production environment. 
([http://www.php.net/manual/en/pgsql.installation.php How to compile PHP with 
PostgreSQL support])',
+       'config-dbsupport-sqlite'         => '* [{{int:version-db-sqlite-url}} 
SQLite] is a lightweight database system that is very well supported. 
([http://www.php.net/manual/en/pdo.installation.php How to compile PHP with 
SQLite support], uses PDO)',
+       'config-dbsupport-oracle'         => '* [{{int:version-db-oracle-url}} 
Oracle] is a commercial enterprise database. 
([http://www.php.net/manual/en/oci8.installation.php How to compile PHP with 
OCI8 support])',
        'config-header-mysql'             => 'MySQL settings',
        'config-header-postgres'          => 'PostgreSQL settings',
        'config-header-sqlite'            => 'SQLite settings',
@@ -640,7 +639,7 @@
 * {{msg-mw|config-env-php}}',
        'config-unicode-pure-php-warning' => 'PECL is the name of a group 
producing standard pieces of software for PHP, and intl is the name of their 
library handling some aspects of internationalization.',
        'config-unicode-update-warning' => "ICU is a body producing standard 
software tools for support of Unicode and other internationalization aspects. 
This message warns the system administrator installing MediaWiki that the 
server's software is not up-to-date and MediaWiki will have problems handling 
some characters.",
-       'config-no-db' => '{{doc-important|Do not translate "<code>./configure 
--with-mysql</code>" and "<code>php5-mysql</code>".}}
+       'config-no-db' => '{{doc-important|Do not translate "<code>./configure 
--with-mysqli</code>" and "<code>php5-mysql</code>".}}
 Parameters:
 * $1 is comma separated list of database types supported by MediaWiki.',
        'config-outdated-sqlite' => 'Used as warning. Parameters:
@@ -704,12 +703,12 @@
 * $2 - error message',
        'config-sqlite-dir-help' => '{{doc-important|Do not translate 
<code>.htaccess</code> and <code>/var/lib/mediawiki/yourwiki</code>.}}
 Used in help box.',
-       'config-type-mysql' => '{{optional}}',
+       'config-type-mysql' => '"Or compatible" refers to several database 
systems that are compatible with MySQL, as explained in 
{{msg-mw|config-dbsupport-mysql}}, and thus also work with this choice of 
database type.',
        'config-type-postgres' => '{{optional}}',
        'config-type-sqlite' => '{{optional}}',
        'config-type-oracle' => '{{optional}}',
        'config-support-info' => 'Parameters:
-* $1 - a list of DBMSs that MediaWiki supports, composed with other 
config-type-* and config-support-* messages.',
+* $1 - a list of DBMSs that MediaWiki supports, composed with 
config-dbsupport-* messages.',
        'config-support-mysql' => 'Parameters:
 * $1 - a link to the MySQL home page having the anchor text "MySQL".',
        'config-support-postgres' => 'Parameters:
@@ -718,6 +717,10 @@
 * $1 - a link to the SQLite home page having the anchor text "SQLite".',
        'config-support-oracle' => 'Parameters:
 * $1 - a link to the Oracle home page, the anchor text of which is "Oracle".',
+       'config-dbsupport-mysql' => 'Used in {{msg-mw|config-support-info}}.',
+       'config-dbsupport-postgres' => 'Used in 
{{msg-mw|config-support-info}}.',
+       'config-dbsupport-sqlite' => 'Used in {{msg-mw|config-support-info}}.',
+       'config-dbsupport-oracle' => 'Used in {{msg-mw|config-support-info}}.',
        'config-invalid-db-server-oracle' => 'Used as error message. Parameters:
 * $1 - database server name
 See also:
diff --git a/includes/installer/WebInstallerPage.php 
b/includes/installer/WebInstallerPage.php
index aa324de..200e4cd 100644
--- a/includes/installer/WebInstallerPage.php
+++ b/includes/installer/WebInstallerPage.php
@@ -481,12 +481,11 @@
                $settings = '';
                $defaultType = $this->getVar( 'wgDBtype' );
 
-               // Messages: config-support-mysql, config-support-postgres, 
config-support-oracle,
-               // config-support-sqlite
+               // Messages: config-dbsupport-mysql, config-dbsupport-postgres, 
config-dbsupport-oracle,
+               // config-dbsupport-sqlite
                $dbSupport = '';
                foreach ( $this->parent->getDBTypes() as $type ) {
-                       $link = DatabaseBase::factory( $type 
)->getSoftwareLink();
-                       $dbSupport .= wfMessage( "config-support-$type", $link 
)->plain() . "\n";
+                       $dbSupport .= wfMessage( "config-dbsupport-$type" 
)->plain() . "\n";
                }
                $this->addHTML( $this->parent->getInfoBox(
                        wfMessage( 'config-support-info', trim( $dbSupport ) 
)->text() ) );
diff --git a/languages/messages/MessagesEn.php 
b/languages/messages/MessagesEn.php
index 0cbeacc..0728d28 100644
--- a/languages/messages/MessagesEn.php
+++ b/languages/messages/MessagesEn.php
@@ -4850,6 +4850,13 @@
 'version-software'                      => 'Installed software',
 'version-software-product'              => 'Product',
 'version-software-version'              => 'Version',
+'version-db-mysql-url'                  => 'http://www.mysql.com/', # do not 
translate or duplicate this message to other languages
+'version-db-mariadb-url'                => 'http://mariadb.org/', # do not 
translate or duplicate this message to other languages
+'version-db-percona-url'                => 
'http://www.percona.com/software/percona-server', # do not translate or 
duplicate this message to other languages
+'version-db-postgres-url'               => 'http://www.postgresql.org/', # do 
not translate or duplicate this message to other languages
+'version-db-oracle-url'                 => 'http://www.oracle.com/database/', 
# do not translate or duplicate this message to other languages
+'version-db-sqlite-url'                 => 'http://www.sqlite.org/', # do not 
translate or duplicate this message to other languages
+'version-db-mssql-url'                  => 'http://www.microsoft.com/sql/', # 
do not translate or duplicate this message to other languages
 'version-entrypoints'                   => 'Entry point URLs',
 'version-entrypoints-header-entrypoint' => 'Entry point',
 'version-entrypoints-header-url'        => 'URL',
diff --git a/languages/messages/MessagesQqq.php 
b/languages/messages/MessagesQqq.php
index acc2ff4..d337b23 100644
--- a/languages/messages/MessagesQqq.php
+++ b/languages/messages/MessagesQqq.php
@@ -10008,6 +10008,20 @@
 'version-software-product' => 'Shown in [[Special:Version]].
 {{Identical|Product}}',
 'version-software-version' => '{{Identical|Version}}',
+'version-db-mysql-url' => '{{notranslate}}
+URL of the website for [[wikipedia:MySQL|MySQL]].',
+'version-db-mariadb-url' => '{{notranslate}}
+URL of the website for [[wikipedia:MariaDB|MariaDB]].',
+'version-db-percona-url' => '{{notranslate}}
+URL of the website for Percona Server.',
+'version-db-postgres-url' => '{{notranslate}}
+URL of the website for [[wikipedia:PostgreSQL|PostgreSQL]].',
+'version-db-oracle-url' => '{{notranslate}}
+URL of the website for [[wikipedia:Oracle Database|Oracle Database]].',
+'version-db-sqlite-url' => '{{notranslate}}
+URL of the website for [[wikipedia:SQLite|SQLite]].',
+'version-db-mssql-url' => '{{notranslate}}
+URL of the website for [[wikipedia:Microsoft SQL Server|Microsoft SQL 
Server]].',
 'version-entrypoints' => 'Header on [[Special:Version]] above a table that 
lists the URLs of various entry points in this MediaWiki installation. Entry 
points are the "places" where the wiki\'s content and information can be 
accessed in various ways, for instance the standard index.php which shows 
normal pages, histories etc.',
 'version-entrypoints-header-entrypoint' => 'Header for the first column in the 
entry points table on [[Special:Version]].
 See also {{msg-mw|Version-entrypoints}}',
diff --git a/maintenance/language/messageTypes.inc 
b/maintenance/language/messageTypes.inc
index d3c70d6..a7d1ceb 100644
--- a/maintenance/language/messageTypes.inc
+++ b/maintenance/language/messageTypes.inc
@@ -246,6 +246,13 @@
        'tags-summary',
        'comparepages-summary',
        'resettokens-summary',
+       'version-db-mysql-url',
+       'version-db-mariadb-url',
+       'version-db-percona-url',
+       'version-db-postgres-url',
+       'version-db-oracle-url',
+       'version-db-sqlite-url',
+       'version-db-mssql-url',
        'version-entrypoints-index-php',
        'version-entrypoints-api-php',
        'version-entrypoints-load-php',
diff --git a/maintenance/language/messages.inc 
b/maintenance/language/messages.inc
index d304425..3534810 100644
--- a/maintenance/language/messages.inc
+++ b/maintenance/language/messages.inc
@@ -3685,6 +3685,13 @@
                'version-software',
                'version-software-product',
                'version-software-version',
+               'version-db-mysql-url',
+               'version-db-mariadb-url',
+               'version-db-percona-url',
+               'version-db-postgres-url',
+               'version-db-oracle-url',
+               'version-db-sqlite-url',
+               'version-db-mssql-url',
                'version-entrypoints',
                'version-entrypoints-header-entrypoint',
                'version-entrypoints-header-url',

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6dbc9d32c8c2d8f233a67d574229b80444885aea
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <pleasest...@live.com>
Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org>
Gerrit-Reviewer: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: Daniel Friesen <dan...@nadir-seen-fire.com>
Gerrit-Reviewer: MarkAHershberger <mhershber...@wikimedia.org>
Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com>
Gerrit-Reviewer: PleaseStand <pleasest...@live.com>
Gerrit-Reviewer: Reedy <re...@wikimedia.org>
Gerrit-Reviewer: Siebrand <siebr...@wikimedia.org>
Gerrit-Reviewer: Tim Starling <tstarl...@wikimedia.org>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-Reviewer: saper <sa...@saper.info>

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

Reply via email to