Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Installer\Task; |
4 | |
5 | use MediaWiki\Installer\ConnectionStatus; |
6 | |
7 | /** |
8 | * Dependency bundle and execution context for installer tasks. |
9 | * |
10 | * For most things in here, the Task base class provides more convenient access. |
11 | * |
12 | * @since 1.44 |
13 | */ |
14 | interface ITaskContext { |
15 | /** |
16 | * A connection for creating DBs, suitable for pre-installation. |
17 | */ |
18 | public const CONN_CREATE_DATABASE = 'create-database'; |
19 | |
20 | /** |
21 | * A connection to the new DB, for creating schemas and other similar |
22 | * objects in the new DB. |
23 | */ |
24 | public const CONN_CREATE_SCHEMA = 'create-schema'; |
25 | |
26 | /** |
27 | * A connection with a role suitable for creating tables. |
28 | */ |
29 | public const CONN_CREATE_TABLES = 'create-tables'; |
30 | |
31 | /** |
32 | * Legacy default connection type. Before MW 1.43, getConnection() with no |
33 | * parameters would return the cached connection. The state (especially the |
34 | * selected domain) would depend on the previously executed install steps. |
35 | * Using this constant tries to reproduce this behaviour. |
36 | * |
37 | * @deprecated since 1.43 |
38 | */ |
39 | public const CONN_DONT_KNOW = 'dont-know'; |
40 | |
41 | /** |
42 | * Get a MediaWiki configuration value for the wiki being created. |
43 | * The name should not have a "wg" prefix. |
44 | * |
45 | * @param string $name |
46 | * @return mixed |
47 | */ |
48 | public function getConfigVar( string $name ); |
49 | |
50 | /** |
51 | * Get a named installer option |
52 | * |
53 | * @param string $name |
54 | * @return mixed |
55 | */ |
56 | public function getOption( string $name ); |
57 | |
58 | /** |
59 | * Connect to the database for a specified purpose |
60 | * |
61 | * @param string $type One of the self::CONN_* constants. Using CONN_DONT_KNOW |
62 | * is deprecated and will cause an exception to be thrown in a future release. |
63 | * @return ConnectionStatus |
64 | */ |
65 | public function getConnection( $type = self::CONN_DONT_KNOW ): ConnectionStatus; |
66 | |
67 | /** |
68 | * Get the selected database type name. |
69 | * |
70 | * @return string |
71 | */ |
72 | public function getDbType(): string; |
73 | |
74 | /** |
75 | * Store an object to be used by a later task |
76 | * |
77 | * @param string $name |
78 | * @param mixed $value |
79 | */ |
80 | public function provide( string $name, $value ); |
81 | |
82 | /** |
83 | * Get the object stored by provide() |
84 | * |
85 | * @param string $name |
86 | * @return mixed |
87 | */ |
88 | public function getProvision( string $name ); |
89 | } |