MediaWiki master
|
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. | |
Dependency bundle and execution context for installer tasks.
For most things in here, the Task base class provides more convenient access.
Definition at line 14 of file ITaskContext.php.
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.
string | $name |
Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.
Referenced by MediaWiki\Installer\SqliteDatabaseCreator\__construct().
MediaWiki\Installer\Task\ITaskContext::getConnection | ( | $type = self::CONN_DONT_KNOW | ) |
Connect to the database for a specified purpose.
string | $type | One of the self::CONN_* constants. Using CONN_DONT_KNOW is deprecated and will cause an exception to be thrown in a future release. |
Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.
MediaWiki\Installer\Task\ITaskContext::getDbType | ( | ) |
Get the selected database type name.
Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.
MediaWiki\Installer\Task\ITaskContext::getOption | ( | string | $name | ) |
Get a named installer option.
string | $name |
Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.
MediaWiki\Installer\Task\ITaskContext::getProvision | ( | string | $name | ) |
Get the object stored by provide()
string | $name |
Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.
MediaWiki\Installer\Task\ITaskContext::getSchemaVars | ( | ) |
Get schema variables.
Implemented in MediaWiki\Installer\DatabaseInstaller, MediaWiki\Installer\MysqlInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.
MediaWiki\Installer\Task\ITaskContext::provide | ( | string | $name, |
$value ) |
Store an object to be used by a later task.
string | $name | |
mixed | $value |
Implemented in MediaWiki\Installer\DatabaseInstaller, and MediaWiki\Installer\Task\AddWikiTaskContext.
const MediaWiki\Installer\Task\ITaskContext::CONN_CREATE_DATABASE = 'create-database' |
A connection for creating DBs, suitable for pre-installation.
Definition at line 18 of file ITaskContext.php.
Referenced by MediaWiki\Installer\Task\PostgresUtils\canCreateObjectsForWebUser(), MediaWiki\Installer\DatabaseInstaller\getConnection(), MediaWiki\Installer\WebInstallerExistingWiki\handleExistingUpgrade(), MediaWiki\Installer\MysqlConnectForm\submit(), and MediaWiki\Installer\PostgresConnectForm\submit().
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.
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().
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.
Definition at line 39 of file ITaskContext.php.