diff options
Diffstat (limited to 'includes/installer')
-rw-r--r-- | includes/installer/Installer.php | 29 | ||||
-rw-r--r-- | includes/installer/MysqlUpdater.php | 2 | ||||
-rw-r--r-- | includes/installer/WebInstallerPage.php | 2 |
3 files changed, 21 insertions, 12 deletions
diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index 4d8e5f0d..9fd67c93 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -46,6 +46,14 @@ abstract class Installer { */ protected $settings; + + /** + * List of detected DBs, access using getCompiledDBs(). + * + * @var array + */ + protected $compiledDBs; + /** * Cached DB installer instances, access using getDBInstaller(). * @@ -173,7 +181,6 @@ abstract class Installer { protected $internalDefaults = array( '_UserLang' => 'en', '_Environment' => false, - '_CompiledDBs' => array(), '_SafeMode' => false, '_RaiseMemory' => false, '_UpgradeDone' => false, @@ -368,7 +375,7 @@ abstract class Installer { } } } - $this->setVar( '_CompiledDBs', $compiledDBs ); + $this->compiledDBs = $compiledDBs; $this->parserTitle = Title::newFromText( 'Installer' ); $this->parserOptions = new ParserOptions; // language will be wrong :( @@ -450,6 +457,15 @@ abstract class Installer { } /** + * Get a list of DBs supported by current PHP setup + * + * @return array + */ + public function getCompiledDBs() { + return $this->compiledDBs; + } + + /** * Get an instance of DatabaseInstaller for the specified DB type. * * @param $type Mixed: DB installer for which is needed, false to use default. @@ -647,13 +663,7 @@ abstract class Installer { $allNames[] = wfMessage( "config-type-$name" )->text(); } - // cache initially available databases to make sure that everything will be displayed correctly - // after a refresh on env checks page - $databases = $this->getVar( '_CompiledDBs-preFilter' ); - if ( !$databases ) { - $databases = $this->getVar( '_CompiledDBs' ); - $this->setVar( '_CompiledDBs-preFilter', $databases ); - } + $databases = $this->getCompiledDBs(); $databases = array_flip ( $databases ); foreach ( array_keys( $databases ) as $db ) { @@ -672,7 +682,6 @@ abstract class Installer { // @todo FIXME: This only works for the web installer! return false; } - $this->setVar( '_CompiledDBs', $databases ); return true; } diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 9d73e629..030c57fc 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -200,9 +200,9 @@ class MysqlUpdater extends DatabaseUpdater { // 1.19 array( 'addIndex', 'logging', 'type_action', 'patch-logging-type-action-index.sql'), + array( 'addField', 'revision', 'rev_sha1', 'patch-rev_sha1.sql' ), array( 'doMigrateUserOptions' ), array( 'dropField', 'user', 'user_options', 'patch-drop-user_options.sql' ), - array( 'addField', 'revision', 'rev_sha1', 'patch-rev_sha1.sql' ), array( 'addField', 'archive', 'ar_sha1', 'patch-ar_sha1.sql' ), array( 'addIndex', 'page', 'page_redirect_namespace_len', 'patch-page_redirect_namespace_len.sql' ), array( 'addField', 'uploadstash', 'us_chunk_inx', 'patch-uploadstash_chunk.sql' ), diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 78830293..06d16a5a 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -462,7 +462,7 @@ class WebInstaller_DBConnect extends WebInstallerPage { // It's possible that the library for the default DB type is not compiled in. // In that case, instead select the first supported DB type in the list. - $compiledDBs = $this->parent->getVar( '_CompiledDBs' ); + $compiledDBs = $this->parent->getCompiledDBs(); if ( !in_array( $defaultType, $compiledDBs ) ) { $defaultType = $compiledDBs[0]; } |