* Base class for DBMS-specific installation helper classes.
*/
abstract class DatabaseInstaller {
+
/** The Installer object */
- var $parent;
+ public $parent;
/* Database connection */
- var $db;
+ public $db;
/** Internal variables for installation */
protected $internalDefaults = array();
protected $globalNames = array();
/**
- * Return the internal name, e.g. 'mysql', or 'sqlite'
+ * Return the internal name, e.g. 'mysql', or 'sqlite'.
*/
- abstract function getName();
+ public abstract function getName();
/**
- * @return true if the client library is compiled in
+ * @return true if the client library is compiled in.
*/
- abstract public function isCompiled();
+ public abstract function isCompiled();
/**
* Get an array of MW configuration globals that will be configured by this class.
*
* If this is called, $this->parent can be assumed to be a WebInstaller
*/
- abstract function getConnectForm();
+ public abstract function getConnectForm();
/**
* Set variables based on the request array, assuming it was submitted
*
* @return Status
*/
- abstract function submitConnectForm();
+ public abstract function submitConnectForm();
/**
* Get HTML for a web form that retrieves settings used for installation.
* If the DB type has no settings beyond those already configured with
* getConnectForm(), this should return false.
*/
- abstract function getSettingsForm();
+ public abstract function getSettingsForm();
/**
* Set variables based on the request array, assuming it was submitted via
* the form return by getSettingsForm().
* @return Status
*/
- abstract function submitSettingsForm();
+ public abstract function submitSettingsForm();
/**
* Connect to the database using the administrative user/password currently
*
* This may be called multiple times, so the result should be cached.
*/
- abstract function getConnection();
+ public abstract function getConnection();
/**
* Allow DB installers a chance to make last-minute changes before installation
*
* @return Status
*/
- abstract function setupDatabase();
+ public abstract function setupDatabase();
/**
* Create database tables from scratch
* @return \type Status
*/
- abstract function createTables();
+ public abstract function createTables();
/**
* Perform database upgrades
* override them
* @return Array
*/
- function getTableOptions() {
+ public function getTableOptions() {
return array();
}
* Get the DBMS-specific options for LocalSettings.php generation.
* @return String
*/
- abstract function getLocalSettings();
+ public abstract function getLocalSettings();
/**
* Construct and initialise parent.
* This is typically only called from Installer::getDBInstaller()
*/
- function __construct( $parent ) {
+ public function __construct( $parent ) {
$this->parent = $parent;
}
/**
* Get the internationalised name for this DBMS
*/
- function getReadableName() {
+ public function getReadableName() {
return wfMsg( 'config-type-' . $this->getName() );
}
* Get a name=>value map of MW configuration globals that overrides
* DefaultSettings.php
*/
- function getGlobalDefaults() {
+ public function getGlobalDefaults() {
return array();
}
/**
* Get a variable, taking local defaults into account
*/
- function getVar( $var, $default = null ) {
+ public function getVar( $var, $default = null ) {
$defaults = $this->getGlobalDefaults();
$internal = $this->getInternalDefaults();
if ( isset( $defaults[$var] ) ) {
/**
* Convenience alias for $this->parent->setVar()
*/
- function setVar( $name, $value ) {
+ public function setVar( $name, $value ) {
$this->parent->setVar( $name, $value );
}
/**
* Get a labelled text box to configure a local variable
*/
- function getTextBox( $var, $label, $attribs = array() ) {
+ public function getTextBox( $var, $label, $attribs = array() ) {
$name = $this->getName() . '_' . $var;
$value = $this->getVar( $var );
return $this->parent->getTextBox( array(
* Get a labelled password box to configure a local variable
* Implements password hiding
*/
- function getPasswordBox( $var, $label, $attribs = array() ) {
+ public function getPasswordBox( $var, $label, $attribs = array() ) {
$name = $this->getName() . '_' . $var;
$value = $this->getVar( $var );
return $this->parent->getPasswordBox( array(
/**
* Get a labelled checkbox to configure a local boolean variable
*/
- function getCheckBox( $var, $label, $attribs = array() ) {
+ public function getCheckBox( $var, $label, $attribs = array() ) {
$name = $this->getName() . '_' . $var;
$value = $this->getVar( $var );
return $this->parent->getCheckBox( array(
* itemAttribs Array of attribute arrays, outer key is the value name (optional)
*
*/
- function getRadioSet( $params ) {
+ public function getRadioSet( $params ) {
$params['controlName'] = $this->getName() . '_' . $params['var'];
$params['value'] = $this->getVar( $params['var'] );
return $this->parent->getRadioSet( $params );
* fake) passwords.
* @param $varNames Array
*/
- function setVarsFromRequest( $varNames ) {
+ public function setVarsFromRequest( $varNames ) {
return $this->parent->setVarsFromRequest( $varNames, $this->getName() . '_' );
}
*
* @return Boolean
*/
- function needsUpgrade() {
+ public function needsUpgrade() {
$status = $this->getConnection();
if ( !$status->isOK() ) {
return false;
/**
* Get a standard install-user fieldset
*/
- function getInstallUserBox() {
+ public function getInstallUserBox() {
return
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', array(), wfMsg( 'config-db-install-account' ) ) .
/**
* Submit a standard install user fieldset
*/
- function submitInstallUserBox() {
+ public function submitInstallUserBox() {
$this->setVarsFromRequest( array( '_InstallUser', '_InstallPassword' ) );
return Status::newGood();
}
* @param $noCreateMsg String: Message to display instead of the creation checkbox.
* Set this to false to show a creation checkbox.
*/
- function getWebUserBox( $noCreateMsg = false ) {
+ public function getWebUserBox( $noCreateMsg = false ) {
$name = $this->getName();
$s = Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) .
* Submit the form from getWebUserBox().
* @return Status
*/
- function submitWebUserBox() {
+ public function submitWebUserBox() {
$this->setVarsFromRequest( array( 'wgDBuser', 'wgDBpassword',
'_SameAccount', '_CreateDBAccount' ) );
if ( $this->getVar( '_SameAccount' ) ) {
return Status::newGood();
}
-}
-
+}
\ No newline at end of file