MediaWiki  master
InstallerOverrides.php
Go to the documentation of this file.
1 <?php
24 
29  private static function getOverrides() {
30  static $overrides;
31 
32  if ( !$overrides ) {
33  $overrides = [
34  'LocalSettingsGenerator' => LocalSettingsGenerator::class,
35  'WebInstaller' => WebInstaller::class,
36  'CliInstaller' => CliInstaller::class,
37  ];
38  foreach ( glob( MW_INSTALL_PATH . '/mw-config/overrides/*.php' ) as $file ) {
39  require $file;
40  }
41  }
42 
43  return $overrides;
44  }
45 
51  public static function getLocalSettingsGenerator( Installer $installer ) {
52  $className = self::getOverrides()['LocalSettingsGenerator'];
53  return new $className( $installer );
54  }
55 
61  public static function getWebInstaller( WebRequest $request ) {
62  $className = self::getOverrides()['WebInstaller'];
63  return new $className( $request );
64  }
65 
73  public static function getCliInstaller( $siteName, $admin = null, array $options = [] ) {
74  $className = self::getOverrides()['CliInstaller'];
75  return new $className( $siteName, $admin, $options );
76  }
77 }
static getCliInstaller( $siteName, $admin=null, array $options=[])
Instantiates and returns an instance of CliInstaller or its descendant classes.
static getWebInstaller(WebRequest $request)
Instantiates and returns an instance of WebInstaller 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:66
The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form stripping il...
Definition: WebRequest.php:50
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42