<?php
class MysqlInstaller extends DatabaseInstaller {
+
protected $globalNames = array(
'wgDBserver',
'wgDBname',
'_MysqlCharset' => 'binary',
);
- var $supportedEngines = array( 'InnoDB', 'MyISAM' );
+ public $supportedEngines = array( 'InnoDB', 'MyISAM' );
- var $minimumVersion = '4.0.14';
+ public $minimumVersion = '4.0.14';
- var $webUserPrivs = array(
+ public $webUserPrivs = array(
'DELETE',
'INSERT',
'SELECT',
'CREATE TEMPORARY TABLES',
);
- function getName() {
+ public function getName() {
return 'mysql';
}
- function __construct( $parent ) {
+ public function __construct( $parent ) {
parent::__construct( $parent );
}
return self::checkExtension( 'mysql' );
}
- function getGlobalDefaults() {
+ public function getGlobalDefaults() {
return array();
}
- function getConnectForm() {
+ public function getConnectForm() {
return
$this->getTextBox( 'wgDBserver', 'config-db-host' ) .
$this->parent->getHelpBox( 'config-db-host-help' ) .
$this->getInstallUserBox();
}
- function submitConnectForm() {
+ public function submitConnectForm() {
// Get variables from the request
$newValues = $this->setVarsFromRequest( array( 'wgDBserver', 'wgDBname', 'wgDBprefix' ) );
return $status;
}
- function getConnection() {
+ public function getConnection() {
$status = Status::newGood();
try {
$this->db = new DatabaseMysql(
return $status;
}
- function doUpgrade() {
+ public function doUpgrade() {
$status = $this->getConnection();
if ( !$status->isOK() ) {
$this->parent->showStatusError( $status );
/**
* Get a list of storage engines that are available and supported
*/
- function getEngines() {
+ public function getEngines() {
$engines = array( 'InnoDB', 'MyISAM' );
$status = $this->getConnection();
if ( !$status->isOK() ) {
/**
* Get a list of character sets that are available and supported
*/
- function getCharsets() {
+ public function getCharsets() {
$status = $this->getConnection();
$mysql5 = array( 'binary', 'utf8' );
$mysql4 = array( 'mysql4' );
/**
* Return true if the install user can create accounts
*/
- function canCreateAccounts() {
+ public function canCreateAccounts() {
$status = $this->getConnection();
if ( !$status->isOK() ) {
return false;
return true;
}
- function getSettingsForm() {
+ public function getSettingsForm() {
if ( $this->canCreateAccounts() ) {
$noCreateMsg = false;
} else {
return $s;
}
- function submitSettingsForm() {
+ public function submitSettingsForm() {
$newValues = $this->setVarsFromRequest( array( '_MysqlEngine', '_MysqlCharset' ) );
$status = $this->submitWebUserBox();
if ( !$status->isOK() ) {
$this->parent->addInstallStepFollowing( "tables", $callback );
}
- function setupDatabase() {
+ public function setupDatabase() {
$status = $this->getConnection();
if ( !$status->isOK() ) {
return $status;
return $status;
}
- function setupUser() {
+ public function setupUser() {
global $IP;
if ( !$this->getVar( '_CreateDBAccount' ) ) {
return $status;
}
- function createTables() {
+ public function createTables() {
global $IP;
$status = $this->getConnection();
if ( !$status->isOK() ) {
return $status;
}
- function getTableOptions() {
+ public function getTableOptions() {
return array( 'engine' => $this->getVar( '_MysqlEngine' ),
'default charset' => $this->getVar( '_MysqlCharset' ) );
}
- function getLocalSettings() {
+ public function getLocalSettings() {
$dbmysql5 = wfBoolToStr( $this->getVar( 'wgDBmysql5', true ) );
$prefix = $this->getVar( 'wgDBprefix' );
$opts = $this->getTableOptions();