}
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;
}
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 ";
'interwiki',
'secretkey',
'sysop',
+ 'mainpage',
);
/**
return $status;
}
+ /**
+ * 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.
*
'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.
if( $status->isOK() ) {
LBFactory::enableBackend();
}
+
+ return $status;
}
/**
return $installer->populateInterwikiTable();
}
+ /**
+ * 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.
*/
$this->getVar( '_InstallUser' ),
$this->getVar( '_InstallPassword' ),
$this->getVar( 'wgDBname' ),
- false,
DBO_SYSDBA,
$this->getVar( 'wgDBprefix' )
);
$this->getVar( 'wgDBuser' ),
$this->getVar( 'wgDBpassword' ),
$this->getVar( 'wgDBname' ),
- false,
0,
$this->getVar( 'wgDBprefix' )
);