Make getSoftwareLink() static so I can use it without instantiating (and opening...
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 22 Aug 2010 20:55:07 +0000 (20:55 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 22 Aug 2010 20:55:07 +0000 (20:55 +0000)
includes/db/Database.php
includes/db/DatabaseIbm_db2.php
includes/db/DatabaseMssql.php
includes/db/DatabaseMysql.php
includes/db/DatabaseOracle.php
includes/db/DatabasePostgres.php
includes/db/DatabaseSqlite.php
includes/installer/Installer.i18n.php
includes/installer/WebInstallerPage.php

index ce676e8..9cb6b90 100644 (file)
@@ -2077,7 +2077,9 @@ abstract class DatabaseBase {
         *
         * @return String: wikitext of a link to the server software's web site
         */
-       abstract function getSoftwareLink();
+       static function getSoftwareLink() {
+               throw new MWException( "A child class of DatabaseBase didn't implement getSoftwareLink(), shame on them" );
+       }
 
        /**
         * A string describing the current software version, like from
index f43c614..60cd817 100644 (file)
@@ -1436,7 +1436,7 @@ EOF;
         * Returns link to IBM DB2 free download
         * @return string wikitext of a link to the server software's web site
         */
-       public function getSoftwareLink() {
+       public static function getSoftwareLink() {
                return "[http://www.ibm.com/software/data/db2/express/?s_cmp=ECDDWW01&s_tact=MediaWiki IBM DB2]";
        }
        
index a1245e2..c25c4d8 100644 (file)
@@ -731,7 +731,7 @@ class DatabaseMssql extends DatabaseBase {
        /**
         * @return string wikitext of a link to the server software's web site
         */
-       function getSoftwareLink() {
+       public static function getSoftwareLink() {
                return "[http://www.microsoft.com/sql/ MS SQL Server]";
        }
 
index b221893..2391c12 100644 (file)
@@ -362,7 +362,7 @@ class DatabaseMysql extends DatabaseBase {
                return 'LOW_PRIORITY';
        }
 
-       function getSoftwareLink() {
+       public static function getSoftwareLink() {
                return '[http://www.mysql.com/ MySQL]';
        }
 
index eae997c..48e32d4 100644 (file)
@@ -817,7 +817,7 @@ class DatabaseOracle extends DatabaseBase {
        /**
         * @return string wikitext of a link to the server software's web site
         */
-       function getSoftwareLink() {
+       public static function getSoftwareLink() {
                return '[http://www.oracle.com/ Oracle]';
        }
 
index b956a6b..e6c1cc2 100644 (file)
@@ -1143,7 +1143,7 @@ class DatabasePostgres extends DatabaseBase {
        /**
         * @return string wikitext of a link to the server software's web site
         */
-       function getSoftwareLink() {
+       public static function getSoftwareLink() {
                return "[http://www.postgresql.org/ PostgreSQL]";
        }
 
index cee84d6..83182cc 100644 (file)
@@ -434,7 +434,7 @@ class DatabaseSqlite extends DatabaseBase {
        /**
         * @return string wikitext of a link to the server software's web site
         */
-       function getSoftwareLink() {
+       public static function getSoftwareLink() {
                return "[http://sqlite.org/ SQLite]";
        }
 
index f1af514..4ca6090 100644 (file)
@@ -226,6 +226,11 @@ Consider putting the database somewhere else altogether, for example in <code>/v
        'config-type-postgres'            => 'PostgreSQL',
        'config-type-sqlite'              => 'SQLite',
        'config-type-oracle'              => 'Oracle',
+       'config-type-info' => 'Mediawiki supports the following database systems:
+
+* $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])
+* $2 is a popular open souce database system as an alternative to MySQL ([http://www.php.net/manual/en/pgsql.installation.php how to compile PHP with PostgreSQL support])
+* $3 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-header-mysql'             => 'MySQL settings',
        'config-header-postgres'          => 'PostgreSQL settings',
        'config-header-sqlite'            => 'SQLite settings',
index 644ba7d..c075ea0 100644 (file)
@@ -224,6 +224,13 @@ class WebInstaller_DBConnect extends WebInstallerPage {
                $types = "<ul class=\"config-settings-block\">\n";
                $settings = '';
                $defaultType = $this->getVar( 'wgDBtype' );
+
+               $mysql = DatabaseMysql::getSoftwareLink();
+               $postgres = DatabasePostgres::getSoftwareLink();
+               $sqlite = DatabaseSqlite::getSoftwareLink();
+               $this->addHTML( $this->parent->getInfoBox(
+                       wfMsg( 'config-type-info', $mysql, $postgres, $sqlite ) ) );
+
                foreach ( $this->parent->getVar( '_CompiledDBs' ) as $type ) {
                        $installer = $this->parent->getDBInstaller( $type );
                        $types .=