MediaWiki master
MediaWiki\Installer\Task\ITaskContext Interface Reference

Dependency bundle and execution context for installer tasks. More...

Inherited by MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.

Public Member Functions

 getConfigVar (string $name)
 Get a MediaWiki configuration value for the wiki being created.
 
 getConnection ( $type=self::CONN_DONT_KNOW)
 Connect to the database for a specified purpose.
 
 getDbType ()
 Get the selected database type name.
 
 getOption (string $name)
 Get a named installer option.
 
 getProvision (string $name)
 Get the object stored by provide()
 
 getSchemaVars ()
 Get schema variables.
 
 provide (string $name, $value)
 Store an object to be used by a later task.
 

Public Attributes

const CONN_CREATE_DATABASE = 'create-database'
 A connection for creating DBs, suitable for pre-installation.
 
const CONN_CREATE_SCHEMA = 'create-schema'
 A connection to the new DB, for creating schemas and other similar objects in the new DB.
 
const CONN_CREATE_TABLES = 'create-tables'
 A connection with a role suitable for creating tables.
 
const CONN_DONT_KNOW = 'dont-know'
 Legacy default connection type.
 

Detailed Description

Dependency bundle and execution context for installer tasks.

For most things in here, the Task base class provides more convenient access.

Since
1.44

Definition at line 14 of file ITaskContext.php.

Member Function Documentation

◆ getConfigVar()

MediaWiki\Installer\Task\ITaskContext::getConfigVar ( string $name)

Get a MediaWiki configuration value for the wiki being created.

The name should not have a "wg" prefix.

Parameters
string$name
Returns
mixed

Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.

Referenced by MediaWiki\Installer\SqliteDatabaseCreator\__construct().

◆ getConnection()

MediaWiki\Installer\Task\ITaskContext::getConnection ( $type = self::CONN_DONT_KNOW)

Connect to the database for a specified purpose.

Parameters
string$typeOne of the self::CONN_* constants. Using CONN_DONT_KNOW is deprecated and will cause an exception to be thrown in a future release.
Returns
ConnectionStatus

Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.

◆ getDbType()

MediaWiki\Installer\Task\ITaskContext::getDbType ( )

Get the selected database type name.

Returns
string

Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.

◆ getOption()

MediaWiki\Installer\Task\ITaskContext::getOption ( string $name)

Get a named installer option.

Parameters
string$name
Returns
mixed

Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.

◆ getProvision()

MediaWiki\Installer\Task\ITaskContext::getProvision ( string $name)

Get the object stored by provide()

Parameters
string$name
Returns
mixed

Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.

◆ getSchemaVars()

MediaWiki\Installer\Task\ITaskContext::getSchemaVars ( )

◆ provide()

MediaWiki\Installer\Task\ITaskContext::provide ( string $name,
$value )

Store an object to be used by a later task.

Parameters
string$name
mixed$value

Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.

Member Data Documentation

◆ CONN_CREATE_DATABASE

const MediaWiki\Installer\Task\ITaskContext::CONN_CREATE_DATABASE = 'create-database'

◆ CONN_CREATE_SCHEMA

const MediaWiki\Installer\Task\ITaskContext::CONN_CREATE_SCHEMA = 'create-schema'

A connection to the new DB, for creating schemas and other similar objects in the new DB.

Definition at line 24 of file ITaskContext.php.

◆ CONN_CREATE_TABLES

const MediaWiki\Installer\Task\ITaskContext::CONN_CREATE_TABLES = 'create-tables'

A connection with a role suitable for creating tables.

Definition at line 29 of file ITaskContext.php.

Referenced by MediaWiki\Installer\WebInstaller\doUpgrade().

◆ CONN_DONT_KNOW

const MediaWiki\Installer\Task\ITaskContext::CONN_DONT_KNOW = 'dont-know'

Legacy default connection type.

Before MW 1.43, getConnection() with no parameters would return the cached connection. The state (especially the selected domain) would depend on the previously executed install steps. Using this constant tries to reproduce this behaviour.

Deprecated
since 1.43

Definition at line 39 of file ITaskContext.php.


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