From: Kevin Israel Date: Thu, 9 Jan 2014 01:50:21 +0000 (-0500) Subject: WebInstaller: Don't call getSoftwareLink() X-Git-Tag: 1.31.0-rc.0~17283^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=0eab1ace67e70d6b8be341f691493597e4b71a90;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/RELEASE-NOTES-1.23 b/RELEASE-NOTES-1.23 index e017a629ea..1b0a4b7e8c 100644 --- a/RELEASE-NOTES-1.23 +++ b/RELEASE-NOTES-1.23 @@ -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 diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 3a89cd50c8..7fc655fdb6 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -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]"; } /** diff --git a/includes/db/DatabaseMysqlBase.php b/includes/db/DatabaseMysqlBase.php index 12fee941c3..1e29e1b885 100644 --- a/includes/db/DatabaseMysqlBase.php +++ b/includes/db/DatabaseMysqlBase.php @@ -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]'; + } } /** diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 3336d1efd3..9761639222 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -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]'; } /** diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 21a7bcf1e4..536e464f31 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -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]'; } /** diff --git a/includes/db/DatabaseSqlite.php b/includes/db/DatabaseSqlite.php index ea35391d21..12eca7befd 100644 --- a/includes/db/DatabaseSqlite.php +++ b/includes/db/DatabaseSqlite.php @@ -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]"; } /** diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index 68dd216287..3ba91d4cb9 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -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 ./configure --with-mysql. -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 ./configure --with-mysqli. +If you installed PHP from a Debian or Ubuntu package, then you also need to install, for example, the php5-mysql 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 [http://php.net/register_globals register_globals] 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 /var/lib/mediawiki/yourwiki.", '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 /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 "./configure --with-mysql" and "php5-mysql".}} + 'config-no-db' => '{{doc-important|Do not translate "./configure --with-mysqli" and "php5-mysql".}} 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 suhosin.get.max_value_length is be * $2 - error message', 'config-sqlite-dir-help' => '{{doc-important|Do not translate .htaccess and /var/lib/mediawiki/yourwiki.}} 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: diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index aa324de720..200e4cd8fc 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -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() ) ); diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 0cbeacc4c1..0728d281ca 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -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', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index acc2ff4c87..d337b23d62 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -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}}', diff --git a/maintenance/language/messageTypes.inc b/maintenance/language/messageTypes.inc index d3c70d6fe7..a7d1ceb67c 100644 --- a/maintenance/language/messageTypes.inc +++ b/maintenance/language/messageTypes.inc @@ -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', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index d304425571..3534810ccd 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -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',