MediaWiki master
MediaWiki\Installer\SqliteInstaller Class Reference

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

Inherits MediaWiki\Installer\DatabaseInstaller.

Collaboration diagram for MediaWiki\Installer\SqliteInstaller:

Public Member Functions

 checkPrerequisites ()
 
 createManualTables ()
 Create database tables from scratch.
 
 createTables ()
 
 getConnectForm (WebInstaller $webInstaller)
 
 getGlobalDefaults ()
 Get a name=>value map of MW configuration globals for the default values.
 
 getLocalSettings ()
 
 getName ()
 Return the internal name, e.g.
 
 getSettingsForm (WebInstaller $webInstaller)
 
 isCompiled ()
 
 needsUpgrade ()
 
 openConnection ()
 
 setupDatabase ()
 
 setupSearchIndex (&$status)
 
- Public Member Functions inherited from MediaWiki\Installer\DatabaseInstaller
 __construct ( $parent)
 Construct and initialise parent.
 
 createExtensionTables ()
 Create the tables for each extension the user enabled.
 
 doUpgrade ()
 Perform database upgrades.
 
 enableLB ()
 Set up LBFactory so that getPrimaryDatabase() etc.
 
 getConnection ()
 Connect to the database using the administrative user/password currently defined in the session.
 
 getGeneratedSchemaPath ( $db)
 Return a path to the DBMS-specific automatically generated schema file.
 
 getGlobalNames ()
 Get an array of MW configuration globals that will be configured by this class.
 
 getInternalDefaults ()
 Get a name=>value map of internal variables used during installation.
 
 getReadableName ()
 Get the internationalised name for this DBMS.
 
 getSchemaPath ( $db)
 Return a path to the DBMS-specific schema file, otherwise default to tables.sql.
 
 getSchemaVars ()
 Override this to provide DBMS-specific schema variables, to be substituted into tables.sql and other schema files.
 
 getUpdateKeysPath ( $db)
 Return a path to the DBMS-specific update key file, otherwise default to update-keys.sql.
 
 getVar ( $var, $default=null)
 Get a variable, taking local defaults into account.
 
 insertUpdateKeys ()
 Insert update keys into table to prevent running unneeded updates.
 
 outputHandler ( $string)
 
 populateInterwikiTable ()
 Common function for databases that don't understand the MySQLish syntax of interwiki.list.
 
 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.
 
 setupSchemaVars ()
 Set appropriate schema variables in the current database connection.
 
 setVar ( $name, $value)
 Convenience alias for $this->parent->setVar()
 

Static Public Member Functions

static checkDataDir ( $dir)
 Check if the data directory is writable or can be created.
 
static realpath ( $path)
 Safe wrapper for PHP's realpath() that fails gracefully if it's unable to canonicalize the path.
 
- Static Public Member Functions inherited from MediaWiki\Installer\DatabaseInstaller
static meetsMinimumRequirement (IDatabase $conn)
 Whether the provided version meets the necessary requirements for this type.
 

Public Attributes

DatabaseSqlite $db
 
- Public Attributes inherited from MediaWiki\Installer\DatabaseInstaller
Database $db = null
 The database connection.
 
Installer $parent
 The Installer object.
 

Static Public Attributes

static $minimumVersion = '3.8.0'
 
- Static Public Attributes inherited from MediaWiki\Installer\DatabaseInstaller
static string $minimumVersion
 Set by subclasses.
 

Protected Member Functions

 makeStubDBFile ( $dir, $db)
 
- Protected Member Functions inherited from MediaWiki\Installer\DatabaseInstaller
 selectDatabase (Database $conn, string $database)
 

Protected Attributes

 $globalNames
 
- Protected Attributes inherited from MediaWiki\Installer\DatabaseInstaller
array $globalNames = []
 Array of MW configuration globals this class uses.
 
array $internalDefaults = []
 Internal variables for installation.
 

Static Protected Attributes

static $notMinimumVersionMessage = 'config-outdated-sqlite'
 
- Static Protected Attributes inherited from MediaWiki\Installer\DatabaseInstaller
static string $notMinimumVersionMessage
 Set by subclasses.
 

Additional Inherited Members

- Static Protected Member Functions inherited from MediaWiki\Installer\DatabaseInstaller
static checkExtension ( $name)
 Convenience function.
 

Detailed Description

Class for setting up the MediaWiki database using SQLLite.

Since
1.17

Definition at line 40 of file SqliteInstaller.php.

Member Function Documentation

◆ checkDataDir()

static MediaWiki\Installer\SqliteInstaller::checkDataDir ( $dir)
static

Check if the data directory is writable or can be created.

Parameters
string$dirPath to the data directory
Returns
Status Return fatal Status if $dir un-writable or no permission to create a directory

Definition at line 119 of file SqliteInstaller.php.

Referenced by MediaWiki\Installer\SqliteConnectForm\submit().

◆ checkPrerequisites()

MediaWiki\Installer\SqliteInstaller::checkPrerequisites ( )
Returns
Status

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 74 of file SqliteInstaller.php.

◆ createManualTables()

MediaWiki\Installer\SqliteInstaller::createManualTables ( )

Create database tables from scratch.

Returns
Status

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 332 of file SqliteInstaller.php.

◆ createTables()

MediaWiki\Installer\SqliteInstaller::createTables ( )
Returns
Status

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 323 of file SqliteInstaller.php.

◆ getConnectForm()

MediaWiki\Installer\SqliteInstaller::getConnectForm ( WebInstaller $webInstaller)

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 63 of file SqliteInstaller.php.

◆ getGlobalDefaults()

MediaWiki\Installer\SqliteInstaller::getGlobalDefaults ( )

Get a name=>value map of MW configuration globals for the default values.

Returns
array

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 86 of file SqliteInstaller.php.

References $IP, and $path.

◆ getLocalSettings()

MediaWiki\Installer\SqliteInstaller::getLocalSettings ( )
Returns
string

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 365 of file SqliteInstaller.php.

◆ getName()

MediaWiki\Installer\SqliteInstaller::getName ( )

Return the internal name, e.g.

'mysql', or 'sqlite'.

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 55 of file SqliteInstaller.php.

◆ getSettingsForm()

MediaWiki\Installer\SqliteInstaller::getSettingsForm ( WebInstaller $webInstaller)

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 67 of file SqliteInstaller.php.

◆ isCompiled()

MediaWiki\Installer\SqliteInstaller::isCompiled ( )
Returns
bool Returns true if the client library is compiled in.

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 59 of file SqliteInstaller.php.

References MediaWiki\Installer\DatabaseInstaller\checkExtension().

◆ makeStubDBFile()

MediaWiki\Installer\SqliteInstaller::makeStubDBFile ( $dir,
$db )
protected
Parameters
string$dir
string$db
Returns
Status

Definition at line 300 of file SqliteInstaller.php.

◆ needsUpgrade()

MediaWiki\Installer\SqliteInstaller::needsUpgrade ( )
Returns
bool

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 183 of file SqliteInstaller.php.

◆ openConnection()

MediaWiki\Installer\SqliteInstaller::openConnection ( )
Returns
ConnectionStatus

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 164 of file SqliteInstaller.php.

◆ realpath()

static MediaWiki\Installer\SqliteInstaller::realpath ( $path)
static

Safe wrapper for PHP's realpath() that fails gracefully if it's unable to canonicalize the path.

Parameters
string$path
Returns
string

Definition at line 110 of file SqliteInstaller.php.

References $path.

Referenced by MediaWiki\Installer\SqliteConnectForm\submit().

◆ setupDatabase()

MediaWiki\Installer\SqliteInstaller::setupDatabase ( )
Returns
Status

Reimplemented from MediaWiki\Installer\DatabaseInstaller.

Definition at line 198 of file SqliteInstaller.php.

◆ setupSearchIndex()

MediaWiki\Installer\SqliteInstaller::setupSearchIndex ( & $status)
Parameters
Status&$status
Returns
Status

Definition at line 341 of file SqliteInstaller.php.

References $IP.

Member Data Documentation

◆ $db

DatabaseSqlite MediaWiki\Installer\SqliteInstaller::$db

Definition at line 48 of file SqliteInstaller.php.

◆ $globalNames

MediaWiki\Installer\SqliteInstaller::$globalNames
protected
Initial value:
= [
'wgDBname',
'wgSQLiteDataDir',
]

Definition at line 50 of file SqliteInstaller.php.

◆ $minimumVersion

MediaWiki\Installer\SqliteInstaller::$minimumVersion = '3.8.0'
static

Definition at line 42 of file SqliteInstaller.php.

◆ $notMinimumVersionMessage

MediaWiki\Installer\SqliteInstaller::$notMinimumVersionMessage = 'config-outdated-sqlite'
staticprotected

Definition at line 43 of file SqliteInstaller.php.


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