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