diff options
author | Tim Starling <tstarling@wikimedia.org> | 2024-12-05 11:16:16 +1100 |
---|---|---|
committer | Tim Starling <tstarling@wikimedia.org> | 2024-12-05 11:26:54 +1100 |
commit | bc65654c8e17436795e05d1925f317ffc9a886d6 (patch) | |
tree | c05e0631b134cd1b112dfb76274951c90a881f6b /maintenance/installPreConfigured.php | |
parent | 944b66f7efcc8dda57da5a9864adcf1773564a44 (diff) | |
download | mediawikicore-bc65654c8e17436795e05d1925f317ffc9a886d6.tar.gz mediawikicore-bc65654c8e17436795e05d1925f317ffc9a886d6.zip |
installer: Allow addWiki.php to add extra tasks
* Add InstallPreConfigured::getExtraTaskSpecs(), which addWiki.php can
override to add WMF-specific tasks.
* Allow tasks to declare themselves as "post-install", so that
addWiki.php's newprojects mailing list notification happens after
Cognate's installer task. Extension tasks are registered after tasks
from getExtraTasks() so it's not enough to rely on registration order.
All tasks get an implicit "install" alias, which post-install tasks
implicitly depend on.
* Allow callback tasks to customise the description string.
* Move the "Installation complete" message from addWiki.php to core.
Bug: T352113
Change-Id: I99368513b3f33c49f690575679450c10b1829105
Diffstat (limited to 'maintenance/installPreConfigured.php')
-rw-r--r-- | maintenance/installPreConfigured.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/maintenance/installPreConfigured.php b/maintenance/installPreConfigured.php index 96b818c32d7d..8aa0f7b33dc2 100644 --- a/maintenance/installPreConfigured.php +++ b/maintenance/installPreConfigured.php @@ -81,6 +81,7 @@ class InstallPreConfigured extends Maintenance { } if ( $status->isOK() ) { + $this->output( "Installation complete.\n" ); return true; } else { $this->error( "Installation failed at task \"" . @@ -174,10 +175,26 @@ class InstallPreConfigured extends Maintenance { ] ] ) ); + foreach ( $this->getExtraTaskSpecs() as $spec ) { + $taskList->add( $taskFactory->create( $spec ) ); + } return $taskList; } /** + * Subclasses can override this to provide specification arrays for extra + * tasks to run during install. + * + * @see TaskFactory::create() + * @stable to override + * + * @return array + */ + protected function getExtraTaskSpecs() { + return []; + } + + /** * Create and configure a TaskRunner * * @param TaskList $taskList |