diff options
-rw-r--r-- | includes/db/DatabaseOracle.php | 7 | ||||
-rw-r--r-- | includes/installer/CoreInstaller.php | 1 | ||||
-rw-r--r-- | includes/installer/DatabaseInstaller.php | 21 | ||||
-rw-r--r-- | includes/installer/Installer.i18n.php | 2 | ||||
-rw-r--r-- | includes/installer/Installer.php | 13 | ||||
-rw-r--r-- | includes/installer/OracleInstaller.php | 2 |
6 files changed, 40 insertions, 6 deletions
diff --git a/includes/db/DatabaseOracle.php b/includes/db/DatabaseOracle.php index 3ea3728a9bf8..e91e2c3a0edc 100644 --- a/includes/db/DatabaseOracle.php +++ b/includes/db/DatabaseOracle.php @@ -268,10 +268,7 @@ class DatabaseOracle extends DatabaseBase { } if ( !$this->mConn ) { - wfDebug( "DB connection error\n" ); - wfDebug( "Server: $server, Database: $dbName, User: $user, Password: " . substr( $password, 0, 3 ) . "...\n" ); - wfDebug( $this->lastError() . "\n" ); - return false; + throw new DBConnectionError( $this, $this->lastError() ); } $this->mOpened = true; @@ -1198,6 +1195,8 @@ class DatabaseOracle extends DatabaseBase { } function update( $table, $values, $conds, $fname = 'DatabaseOracle::update', $options = array() ) { + global $wgContLang; + $table = $this->tableName( $table ); $opts = $this->makeUpdateOptions( $options ); $sql = "UPDATE $opts $table SET "; diff --git a/includes/installer/CoreInstaller.php b/includes/installer/CoreInstaller.php index 60d5acc6919a..2024418fe280 100644 --- a/includes/installer/CoreInstaller.php +++ b/includes/installer/CoreInstaller.php @@ -96,6 +96,7 @@ abstract class CoreInstaller extends Installer { 'interwiki', 'secretkey', 'sysop', + 'mainpage', ); /** diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index b63749520e06..a1f9c9332f12 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -137,6 +137,27 @@ abstract class DatabaseInstaller { } /** + * Insert Main Page with default content. + * + * @return Status + */ + public function createMainpage() { + $status = Status::newGood(); + try { + $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) ); + $article = new Article( $titleobj ); + $article->doEdit( wfMsg( 'mainpagetext' ) . "\n\n" . wfMsgNoTrans( 'mainpagedocfooter' ), + '', + EDIT_NEW ); + } catch (MWException $e) { + //using raw, because $wgShowExceptionDetails can not be set yet + $status->fatal( 'config-install-mainpage-failed', $e->getMessage() ); + } + + return $status; + } + + /** * Get the DBMS-specific options for LocalSettings.php generation. * * @return String diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index eb0755be0cc4..099526ad9ed3 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -481,6 +481,8 @@ Skipping default list.", 'config-insecure-secretkey' => "'''Warning:''' Unable to create secure <code>\$wgSecretKey</code>. Consider changing it manually.", 'config-install-sysop' => 'Creating administrator user account', + 'config-install-mainpage' => 'Creating main page with default content', + 'config-install-mainpage-failed' => 'Could not insert main page.', 'config-install-done' => "'''Congratulations!''' You have successfully installed MediaWiki. diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index be5d85faceed..f11f091443a0 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -357,6 +357,8 @@ abstract class Installer { if( $status->isOK() ) { LBFactory::enableBackend(); } + + return $status; } /** @@ -371,6 +373,17 @@ abstract class Installer { } /** + * TODO: document + * + * @param $installer DatabaseInstaller + * + * @return Status + */ + public function installMainpage( DatabaseInstaller &$installer ) { + return $installer->createMainpage(); + } + + /** * Exports all wg* variables stored by the installer into global scope. */ public function exportVars() { diff --git a/includes/installer/OracleInstaller.php b/includes/installer/OracleInstaller.php index 8146776bec8d..5c3ec18aec9f 100644 --- a/includes/installer/OracleInstaller.php +++ b/includes/installer/OracleInstaller.php @@ -120,7 +120,6 @@ class OracleInstaller extends DatabaseInstaller { $this->getVar( '_InstallUser' ), $this->getVar( '_InstallPassword' ), $this->getVar( 'wgDBname' ), - false, DBO_SYSDBA, $this->getVar( 'wgDBprefix' ) ); @@ -130,7 +129,6 @@ class OracleInstaller extends DatabaseInstaller { $this->getVar( 'wgDBuser' ), $this->getVar( 'wgDBpassword' ), $this->getVar( 'wgDBname' ), - false, 0, $this->getVar( 'wgDBprefix' ) ); |