MediaWiki master
InstallerOverrides.php
Go to the documentation of this file.
1<?php
2
10namespace MediaWiki\Installer;
11
13
19 private static function getOverrides(): array {
20 static $overrides;
21
22 if ( !$overrides ) {
23 $overrides = [
24 'LocalSettingsGenerator' => LocalSettingsGenerator::class,
25 'WebInstaller' => WebInstaller::class,
26 'CliInstaller' => CliInstaller::class,
27 ];
28 foreach ( glob( MW_INSTALL_PATH . '/mw-config/overrides/*.php' ) as $file ) {
29 require $file;
30 }
31 }
32
33 return $overrides;
34 }
35
41 public static function getLocalSettingsGenerator( Installer $installer ) {
42 $className = self::getOverrides()['LocalSettingsGenerator'];
43 return new $className( $installer );
44 }
45
51 public static function getWebInstaller( WebRequest $request ) {
52 $className = self::getOverrides()['WebInstaller'];
53 return new $className( $request );
54 }
55
63 public static function getCliInstaller( $siteName, $admin = null, array $options = [] ) {
64 $className = self::getOverrides()['CliInstaller'];
65 return new $className( $siteName, $admin, $options );
66 }
67}
static getWebInstaller(WebRequest $request)
Instantiates and returns an instance of WebInstaller or its descendant classes.
static getCliInstaller( $siteName, $admin=null, array $options=[])
Instantiates and returns an instance of CliInstaller or its descendant classes.
static getLocalSettingsGenerator(Installer $installer)
Instantiates and returns an instance of LocalSettingsGenerator or its descendant classes.
Base installer class.
Definition Installer.php:70
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form,...