MediaWiki
master
CannedProvider.php
Go to the documentation of this file.
1
<?php
2
3
namespace
MediaWiki\Installer\Task
;
4
5
use
MediaWiki\Status\Status
;
6
18
class
CannedProvider
extends
Task
{
20
private
$name;
22
private
$provisions;
23
28
public
function
__construct
( $name, $provisions ) {
29
$this->name = $name;
30
$this->provisions = $provisions;
31
}
32
33
public
function
getName
() {
34
return
$this->name;
35
}
36
37
public
function
getProvidedNames
() {
38
return
array_keys( $this->provisions );
39
}
40
41
public
function
execute
():
Status
{
42
foreach ( $this->provisions as $name => $value ) {
43
$this->
getContext
()->provide( $name, $value );
44
}
45
return
Status::newGood();
46
}
47
}
MediaWiki\Installer\Task\CannedProvider
A scheduled provider which simply provides data given to it through its constructor.
Definition
CannedProvider.php:18
MediaWiki\Installer\Task\CannedProvider\getName
getName()
Get the symbolic name of the task.
Definition
CannedProvider.php:33
MediaWiki\Installer\Task\CannedProvider\execute
execute()
Execute the task.
Definition
CannedProvider.php:41
MediaWiki\Installer\Task\CannedProvider\__construct
__construct( $name, $provisions)
Definition
CannedProvider.php:28
MediaWiki\Installer\Task\CannedProvider\getProvidedNames
getProvidedNames()
Get a list of names of objects that this task promises to provide via $this->getContext()->provide().
Definition
CannedProvider.php:37
MediaWiki\Installer\Task\Task
Base class for installer tasks.
Definition
Task.php:24
MediaWiki\Installer\Task\Task\getContext
getContext()
Get the execution context.
Definition
Task.php:171
MediaWiki\Status\Status
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition
Status.php:54
MediaWiki\Installer\Task
Definition
AddWikiRestoredServicesProvider.php:3
includes
installer
Task
CannedProvider.php
Generated on Thu Jan 2 2025 14:24:08 for MediaWiki by
1.10.0