MediaWiki master
|
Base class for installer tasks. More...
Inherited by MediaWiki\Installer\Task\AddWikiRestoredServicesProvider, MediaWiki\Installer\Task\CallbackTask, MediaWiki\Installer\Task\CannedProvider, MediaWiki\Installer\Task\CreateDatabaseTask, MediaWiki\Installer\Task\CreateExternalDomainsTask, MediaWiki\Installer\Task\CreateSysopTask, MediaWiki\Installer\Task\CreateTablesTask, MediaWiki\Installer\Task\ExtensionTablesTask, MediaWiki\Installer\Task\ExtensionsProvider, MediaWiki\Installer\Task\InitialContentTask, MediaWiki\Installer\Task\InsertUpdateKeysTask, MediaWiki\Installer\Task\MailingListSubscribeTask, MediaWiki\Installer\Task\MysqlCreateUserTask, MediaWiki\Installer\Task\PopulateInterwikiTask, MediaWiki\Installer\Task\PopulateSiteStatsTask, MediaWiki\Installer\Task\PostgresCreateSchemaTask, MediaWiki\Installer\Task\PostgresCreateUserTask, MediaWiki\Installer\Task\PostgresPlTask, MediaWiki\Installer\Task\RestoredServicesProvider, MediaWiki\Installer\Task\SqliteCreateDatabaseTask, and MediaWiki\Installer\Task\SqliteCreateSearchIndexTask.
Public Member Functions | |
execute () | |
Execute the task. | |
getAliases () | |
Get alternative names of this task. | |
getDependencies () | |
Get a list of names or aliases of tasks that must be done prior to this task. | |
getDescription () | |
Get a human-readable description of what this task does, for use as a progress message. | |
getDescriptionMessage () | |
Get the description as a Message object. | |
getHookContainer () | |
Get a HookContainer suitable for calling LoadExtensionSchemaUpdates. | |
getName () | |
Get the symbolic name of the task. | |
getProvidedNames () | |
Get a list of names of objects that this task promises to provide via $this->getContext()->provide(). | |
getServices () | |
Get the restored services. | |
getVirtualDomains () | |
initBase (ITaskContext $context, string $schemaBasePath) | |
Inject the base class dependencies and configuration. | |
isPostInstall () | |
If this returns true, the task will be scheduled after tasks for which it returns false. | |
isSkipped () | |
Override this to return true to skip the task. | |
Protected Member Functions | |
applySourceFile (IMaintainableDatabase $conn, string $relPath) | |
Apply a SQL source file to the database as part of running an installation step. | |
definitelyGetConnection (string $type) | |
Get a database connection, and throw if a connection could not be obtained. | |
getConfigVar (string $name) | |
Get a configuration variable for the wiki being created. | |
getConnection (string $type) | |
Connect to the database for a specified purpose. | |
getContext () | |
Get the execution context. | |
getDatabaseCreator () | |
Get a helper for creating databases. | |
getOption (string $name) | |
Get an installer option value. | |
getSchemaBasePath () | |
Get the absolute base path for SQL schema files. | |
getSqlFilePath (string $filename) | |
Return a path to the DBMS-specific SQL file if it exists, otherwise default SQL file. | |
Base class for installer tasks.
|
protected |
Apply a SQL source file to the database as part of running an installation step.
IMaintainableDatabase | $conn | |
string | $relPath |
Definition at line 229 of file Task.php.
References $path, Wikimedia\Rdbms\IDatabase\doAtomicSection(), and Wikimedia\Rdbms\IMaintainableDatabase\sourceFile().
|
protected |
|
abstract |
Execute the task.
Notes for implementors:
Reimplemented in MediaWiki\Installer\Task\AddWikiRestoredServicesProvider, MediaWiki\Installer\Task\CallbackTask, MediaWiki\Installer\Task\CannedProvider, MediaWiki\Installer\Task\CreateDatabaseTask, MediaWiki\Installer\Task\CreateExternalDomainsTask, MediaWiki\Installer\Task\CreateSysopTask, MediaWiki\Installer\Task\CreateTablesTask, MediaWiki\Installer\Task\ExtensionsProvider, MediaWiki\Installer\Task\ExtensionTablesTask, MediaWiki\Installer\Task\InitialContentTask, MediaWiki\Installer\Task\InsertUpdateKeysTask, MediaWiki\Installer\Task\MailingListSubscribeTask, MediaWiki\Installer\Task\MysqlCreateUserTask, MediaWiki\Installer\Task\PopulateInterwikiTask, MediaWiki\Installer\Task\PopulateSiteStatsTask, MediaWiki\Installer\Task\PostgresCreateSchemaTask, MediaWiki\Installer\Task\PostgresCreateUserTask, MediaWiki\Installer\Task\PostgresPlTask, MediaWiki\Installer\Task\RestoredServicesProvider, MediaWiki\Installer\Task\SqliteCreateDatabaseTask, and MediaWiki\Installer\Task\SqliteCreateSearchIndexTask.
MediaWiki\Installer\Task\Task::getAliases | ( | ) |
Get alternative names of this task.
These aliases can be used to fulfill dependencies of other tasks.
Reimplemented in MediaWiki\Installer\Task\CallbackTask, MediaWiki\Installer\Task\CreateDatabaseTask, and MediaWiki\Installer\Task\SqliteCreateDatabaseTask.
|
protected |
|
protected |
|
protected |
Get the execution context.
This will throw if initBase() has not been called.
Definition at line 171 of file Task.php.
Referenced by MediaWiki\Installer\Task\CannedProvider\execute(), and MediaWiki\Installer\Task\ExtensionsProvider\execute().
|
protected |
MediaWiki\Installer\Task\Task::getDependencies | ( | ) |
Get a list of names or aliases of tasks that must be done prior to this task.
Reimplemented in MediaWiki\Installer\Task\AddWikiRestoredServicesProvider, MediaWiki\Installer\Task\CallbackTask, MediaWiki\Installer\Task\CreateExternalDomainsTask, MediaWiki\Installer\Task\CreateSysopTask, MediaWiki\Installer\Task\CreateTablesTask, MediaWiki\Installer\Task\ExtensionTablesTask, MediaWiki\Installer\Task\InitialContentTask, MediaWiki\Installer\Task\InsertUpdateKeysTask, MediaWiki\Installer\Task\MailingListSubscribeTask, MediaWiki\Installer\Task\MysqlCreateUserTask, MediaWiki\Installer\Task\PopulateInterwikiTask, MediaWiki\Installer\Task\PopulateSiteStatsTask, MediaWiki\Installer\Task\PostgresCreateSchemaTask, MediaWiki\Installer\Task\PostgresCreateUserTask, and MediaWiki\Installer\Task\RestoredServicesProvider.
MediaWiki\Installer\Task\Task::getDescription | ( | ) |
Get a human-readable description of what this task does, for use as a progress message.
This may either be English text or a MessageSpecifier. It is unsafe to use an extension message.
Reimplemented in MediaWiki\Installer\Task\CallbackTask.
Definition at line 63 of file Task.php.
References MediaWiki\Installer\Task\Task\getName(), and wfMessage().
Referenced by MediaWiki\Installer\Task\Task\getDescriptionMessage().
|
final |
Get the description as a Message object.
Definition at line 81 of file Task.php.
References MediaWiki\Installer\Task\Task\getDescription().
MediaWiki\Installer\Task\Task::getHookContainer | ( | ) |
|
abstract |
Get the symbolic name of the task.
Reimplemented in MediaWiki\Installer\Task\AddWikiRestoredServicesProvider, MediaWiki\Installer\Task\CallbackTask, MediaWiki\Installer\Task\CannedProvider, MediaWiki\Installer\Task\CreateDatabaseTask, MediaWiki\Installer\Task\CreateExternalDomainsTask, MediaWiki\Installer\Task\CreateSysopTask, MediaWiki\Installer\Task\CreateTablesTask, MediaWiki\Installer\Task\ExtensionsProvider, MediaWiki\Installer\Task\ExtensionTablesTask, MediaWiki\Installer\Task\InitialContentTask, MediaWiki\Installer\Task\InsertUpdateKeysTask, MediaWiki\Installer\Task\MailingListSubscribeTask, MediaWiki\Installer\Task\MysqlCreateUserTask, MediaWiki\Installer\Task\PopulateInterwikiTask, MediaWiki\Installer\Task\PopulateSiteStatsTask, MediaWiki\Installer\Task\PostgresCreateSchemaTask, MediaWiki\Installer\Task\PostgresCreateUserTask, MediaWiki\Installer\Task\PostgresPlTask, MediaWiki\Installer\Task\RestoredServicesProvider, MediaWiki\Installer\Task\SqliteCreateDatabaseTask, and MediaWiki\Installer\Task\SqliteCreateSearchIndexTask.
Referenced by MediaWiki\Installer\Task\Task\getDescription().
|
protected |
MediaWiki\Installer\Task\Task::getProvidedNames | ( | ) |
Get a list of names of objects that this task promises to provide via $this->getContext()->provide().
If this is non-empty, the task is a scheduled provider, which means that it is not persistently complete after it has been run. If installation is interrupted, it might need to be run again.
Reimplemented in MediaWiki\Installer\Task\AddWikiRestoredServicesProvider, MediaWiki\Installer\Task\CannedProvider, MediaWiki\Installer\Task\CreateSysopTask, MediaWiki\Installer\Task\ExtensionsProvider, and MediaWiki\Installer\Task\RestoredServicesProvider.
|
protected |
Get the absolute base path for SQL schema files.
For core tasks, this is $IP/sql. For extension tasks, this will be sql/ under the extension directory.
It would be possible to make the extension path be configurable, but it is currently not needed since extensions typically do not create their tables by this mechanism.
MediaWiki\Installer\Task\Task::getServices | ( | ) |
|
protected |
|
final |
MediaWiki\Installer\Task\Task::isPostInstall | ( | ) |
If this returns true, the task will be scheduled after tasks for which it returns false.
Subclasses can override this to return true for tasks that respond to the successful complete installation of the wiki.
Reimplemented in MediaWiki\Installer\Task\CallbackTask.
MediaWiki\Installer\Task\Task::isSkipped | ( | ) |
Override this to return true to skip the task.
If this returns true, execute() will not be called, and start/end messages will not be produced.
Reimplemented in MediaWiki\Installer\Task\ExtensionTablesTask, MediaWiki\Installer\Task\MailingListSubscribeTask, MediaWiki\Installer\Task\MysqlCreateUserTask, and MediaWiki\Installer\Task\PostgresCreateUserTask.