MediaWiki  REL1_19
MysqlInstaller Class Reference

Class for setting up the MediaWiki database using MySQL. More...

Inheritance diagram for MysqlInstaller:
Collaboration diagram for MysqlInstaller:

List of all members.

Public Member Functions

 __construct ($parent)
 Construct and initialise parent.
 canCreateAccounts ()
 Return true if the install user can create accounts.
 getCharsets ()
 Get a list of character sets that are available and supported.
 getConnectForm ()
 getEngines ()
 Get a list of storage engines that are available and supported.
 getGlobalDefaults ()
 getLocalSettings ()
 Get the DBMS-specific options for LocalSettings.php generation.
 getName ()
 getSchemaVars ()
 Get variables to substitute into tables.sql and the SQL patch files.
 getSettingsForm ()
 isCompiled ()
 openConnection ()
 preInstall ()
 Allow DB installers a chance to make last-minute changes before installation occurs.
 preUpgrade ()
 Allow DB installers a chance to make checks before upgrade.
 setupDatabase ()
 setupUser ()
 submitConnectForm ()
 Set variables based on the request array, assuming it was submitted via the form returned by getConnectForm().
 submitSettingsForm ()

Public Attributes

 $minimumVersion = '5.0.2'
 $supportedEngines = array( 'InnoDB', 'MyISAM' )
 $webUserPrivs

Protected Member Functions

 getTableOptions ()
 Return any table options to be applied to all tables that don't override them.

Protected Attributes

 $globalNames
 $internalDefaults

Private Member Functions

 buildFullUserName ($name, $host)
 Return a formal 'User'@'Host' username for use in queries.
 userDefinitelyExists ($host, $user)
 Try to see if the user account exists.

Detailed Description

Class for setting up the MediaWiki database using MySQL.

Since:
1.17

Definition at line 15 of file MysqlInstaller.php.


Constructor & Destructor Documentation

Construct and initialise parent.

This is typically only called from Installer::getDBInstaller()

Parameters:
$parent

Reimplemented from DatabaseInstaller.

Definition at line 52 of file MysqlInstaller.php.

References DatabaseInstaller\$parent.


Member Function Documentation

MysqlInstaller::buildFullUserName ( name,
host 
) [private]

Return a formal 'User'@'Host' username for use in queries.

Parameters:
$nameString Username, quotes will be added
$hostString Hostname, quotes will be added
Returns:
String

Definition at line 565 of file MysqlInstaller.php.

Referenced by setupUser().

Here is the caller graph for this function:

Return true if the install user can create accounts.

Returns:
bool

Definition at line 248 of file MysqlInstaller.php.

References $res, DatabaseInstaller\getConnection(), and DatabaseInstaller\getVar().

Referenced by getSettingsForm(), and submitSettingsForm().

Here is the call graph for this function:

Here is the caller graph for this function:

Get a list of character sets that are available and supported.

Returns:
array

Definition at line 239 of file MysqlInstaller.php.

Referenced by getSettingsForm(), and submitSettingsForm().

Here is the caller graph for this function:

Returns:
string

Reimplemented from DatabaseInstaller.

Definition at line 73 of file MysqlInstaller.php.

References Html\closeElement(), Html\element(), DatabaseInstaller\getInstallUserBox(), DatabaseInstaller\getTextBox(), Html\openElement(), and wfMsg().

Here is the call graph for this function:

Get a list of storage engines that are available and supported.

Returns:
array

Definition at line 215 of file MysqlInstaller.php.

References $res, and DatabaseInstaller\getConnection().

Referenced by getSettingsForm(), and submitSettingsForm().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
array

Reimplemented from DatabaseInstaller.

Definition at line 66 of file MysqlInstaller.php.

Get the DBMS-specific options for LocalSettings.php generation.

Returns:
String

Reimplemented from DatabaseInstaller.

Definition at line 618 of file MysqlInstaller.php.

References LocalSettingsGenerator\escapePhpString(), getTableOptions(), DatabaseInstaller\getVar(), and wfBoolToStr().

Here is the call graph for this function:

Returns:
string

Reimplemented from DatabaseInstaller.

Definition at line 48 of file MysqlInstaller.php.

Get variables to substitute into tables.sql and the SQL patch files.

Returns:
array

Reimplemented from DatabaseInstaller.

Definition at line 609 of file MysqlInstaller.php.

References getTableOptions(), and DatabaseInstaller\getVar().

Here is the call graph for this function:

Return any table options to be applied to all tables that don't override them.

Returns:
String

Definition at line 593 of file MysqlInstaller.php.

References $options, and DatabaseInstaller\getVar().

Referenced by getLocalSettings(), and getSchemaVars().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
Bool

Reimplemented from DatabaseInstaller.

Definition at line 59 of file MysqlInstaller.php.

References DatabaseInstaller\checkExtension().

Here is the call graph for this function:

Returns:
Status

Reimplemented from DatabaseInstaller.

Definition at line 133 of file MysqlInstaller.php.

References DatabaseInstaller\$db, DatabaseInstaller\getVar(), and Status\newGood().

Here is the call graph for this function:

Allow DB installers a chance to make last-minute changes before installation occurs.

This happens before setupDatabase() or createTables() is called, but long after the constructor. Helpful for things like modifying setup steps :)

Reimplemented from DatabaseInstaller.

Definition at line 434 of file MysqlInstaller.php.

Allow DB installers a chance to make checks before upgrade.

Reimplemented from DatabaseInstaller.

Definition at line 152 of file MysqlInstaller.php.

References $res, $wgDBpassword, $wgDBuser, DatabaseInstaller\getConnection(), DatabaseInstaller\getVar(), and DatabaseInstaller\setVar().

Here is the call graph for this function:

Returns:
Status

Reimplemented from DatabaseInstaller.

Definition at line 446 of file MysqlInstaller.php.

References DatabaseInstaller\getConnection(), DatabaseInstaller\getVar(), and DatabaseInstaller\setupSchemaVars().

Here is the call graph for this function:

Set variables based on the request array, assuming it was submitted via the form returned by getConnectForm().

Validate the connection settings by attempting to connect with them.

If this is called, $this->parent can be assumed to be a WebInstaller.

Returns:
Status

Reimplemented from DatabaseInstaller.

Definition at line 84 of file MysqlInstaller.php.

References $version, DatabaseInstaller\getConnection(), Status\newFatal(), Status\newGood(), DatabaseInstaller\setVarsFromRequest(), and DatabaseInstaller\submitInstallUserBox().

Here is the call graph for this function:

MysqlInstaller::userDefinitelyExists ( host,
user 
) [private]

Try to see if the user account exists.

Our "superuser" may not have access to mysql.user, so false means "no" or "maybe"

Parameters:
$hostString Hostname to check
$userString Username to check
Returns:
boolean

Definition at line 576 of file MysqlInstaller.php.

References $res, and $user.

Referenced by setupUser().

Here is the caller graph for this function:


Member Data Documentation

MysqlInstaller::$globalNames [protected]
Initial value:
 array(
                'wgDBserver',
                'wgDBname',
                'wgDBuser',
                'wgDBpassword',
                'wgDBprefix',
                'wgDBTableOptions',
                'wgDBmysql5',
        )

Reimplemented from DatabaseInstaller.

Definition at line 17 of file MysqlInstaller.php.

MysqlInstaller::$internalDefaults [protected]
Initial value:
 array(
                '_MysqlEngine' => 'InnoDB',
                '_MysqlCharset' => 'binary',
                '_InstallUser' => 'root',
        )

Reimplemented from DatabaseInstaller.

Definition at line 27 of file MysqlInstaller.php.

MysqlInstaller::$minimumVersion = '5.0.2'

Definition at line 35 of file MysqlInstaller.php.

MysqlInstaller::$supportedEngines = array( 'InnoDB', 'MyISAM' )

Definition at line 33 of file MysqlInstaller.php.

MysqlInstaller::$webUserPrivs
Initial value:
 array(
                'DELETE',
                'INSERT',
                'SELECT',
                'UPDATE',
                'CREATE TEMPORARY TABLES',
        )

Definition at line 37 of file MysqlInstaller.php.


The documentation for this class was generated from the following file: