MediaWiki master
InstallerOverrides.php
Go to the documentation of this file.
1<?php
2
24namespace MediaWiki\Installer;
25
27
32 private static function getOverrides() {
33 static $overrides;
34
35 if ( !$overrides ) {
36 $overrides = [
37 'LocalSettingsGenerator' => LocalSettingsGenerator::class,
38 'WebInstaller' => WebInstaller::class,
39 'CliInstaller' => CliInstaller::class,
40 ];
41 foreach ( glob( MW_INSTALL_PATH . '/mw-config/overrides/*.php' ) as $file ) {
42 require $file;
43 }
44 }
45
46 return $overrides;
47 }
48
54 public static function getLocalSettingsGenerator( Installer $installer ) {
55 $className = self::getOverrides()['LocalSettingsGenerator'];
56 return new $className( $installer );
57 }
58
64 public static function getWebInstaller( WebRequest $request ) {
65 $className = self::getOverrides()['WebInstaller'];
66 return new $className( $request );
67 }
68
76 public static function getCliInstaller( $siteName, $admin = null, array $options = [] ) {
77 $className = self::getOverrides()['CliInstaller'];
78 return new $className( $siteName, $admin, $options );
79 }
80}
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:87
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...