WebInstaller: Don't call getSoftwareLink()
authorKevin Israel <pleasestand@live.com>
Thu, 9 Jan 2014 01:50:21 +0000 (20:50 -0500)
committerKevin Israel <pleasestand@live.com>
Fri, 10 Jan 2014 08:38:44 +0000 (03:38 -0500)
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

12 files changed:
RELEASE-NOTES-1.23
includes/db/DatabaseMssql.php
includes/db/DatabaseMysqlBase.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/db/DatabaseSqlite.php
includes/installer/Installer.i18n.php
includes/installer/WebInstallerPage.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messageTypes.inc
maintenance/language/messages.inc

index e017a62..1b0a4b7 100644 (file)
@@ -102,6 +102,8 @@ production.
   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
index 3a89cd5..7fc655f 100644 (file)
@@ -729,7 +729,7 @@ class DatabaseMssql extends DatabaseBase {
         * @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]";
        }
 
        /**
index 12fee94..1e29e1b 100644 (file)
@@ -763,7 +763,14 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
         * @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]';
+               }
        }
 
        /**
index 3336d1e..9761639 100644 (file)
@@ -939,7 +939,7 @@ class DatabaseOracle extends DatabaseBase {
         * @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]';
        }
 
        /**
index 21a7bcf..536e464 100644 (file)
@@ -1140,7 +1140,7 @@ __INDEXATTR__;
         * @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]';
        }
 
        /**
index ea35391..12eca7b 100644 (file)
@@ -655,7 +655,7 @@ class DatabaseSqlite extends DatabaseBase {
         * @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]";
        }
 
        /**
index 68dd216..3ba91d4 100644 (file)
@@ -100,9 +100,8 @@ You should [//www.mediawiki.org/wiki/Unicode_normalization_considerations upgrad
        '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 @@ That includes raw user data (email addresses, hashed passwords) as well as delet
 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 @@ Consider putting the database somewhere else altogether, for example in <code>/v
 $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 @@ See also:
 * {{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 @@ Message shown when PHP parameter <code>suhosin.get.max_value_length</code> is be
 * $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 @@ Used in help box.',
 * $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:
index aa324de..200e4cd 100644 (file)
@@ -481,12 +481,11 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                $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() ) );
index 0cbeacc..0728d28 100644 (file)
@@ -4850,6 +4850,13 @@ You should have received [{{SERVER}}{{SCRIPTPATH}}/COPYING a copy of the GNU Gen
 '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',
index acc2ff4..d337b23 100644 (file)
@@ -10008,6 +10008,20 @@ This message is followed by the list of installed software (MediaWiki, PHP and M
 '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}}',
index d3c70d6..a7d1ceb 100644 (file)
@@ -246,6 +246,13 @@ $wgIgnoredMessages = array(
        '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',
index d304425..3534810 100644 (file)
@@ -3685,6 +3685,13 @@ $wgMessageStructure = array(
                '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',