MediaWiki  1.28.0
Installer Class Reference

Base installer class. More...

Inheritance diagram for Installer:
Collaboration diagram for Installer:

Public Member Functions

 __construct ()
 Constructor, always call this from child classes. More...
 
 addInstallStep ($callback, $findStep= 'BEGINNING')
 Add an installation step following the given step. More...
 
 dirIsExecutable ($dir, $url)
 Checks if scripts located in the given directory can be executed via the given URL. More...
 
 disableLinkPopups ()
 
 doEnvironmentChecks ()
 Do initial checks of the PHP environment. More...
 
 doEnvironmentPreps ()
 
 findExtensions ($directory= 'extensions')
 Finds extensions that follow the format /$directory/Name/Name.php, and returns an array containing the value for 'Name' for each found extension. More...
 
 generateKeys ()
 Generate $wgSecretKey. More...
 
 getCompiledDBs ()
 Get a list of DBs supported by current PHP setup. More...
 
 getDBInstaller ($type=false)
 Get an instance of DatabaseInstaller for the specified DB type. More...
 
 getDefaultSkin (array $skinNames)
 Returns a default value to be used for $wgDefaultSkin: normally the one set in DefaultSettings, but will fall back to another if the default skin is missing and some other one is present instead. More...
 
 getFakePassword ($realPassword)
 Get a fake password for sending back to the user in HTML. More...
 
 getParserOptions ()
 
 getVar ($name, $default=null)
 Get an MW configuration variable, or internal installer configuration variable. More...
 
 parse ($text, $lineStart=false)
 Convert wikitext $text to HTML. More...
 
 performInstallation ($startCB, $endCB)
 Actually perform the installation. More...
 
 populateSiteStats (DatabaseInstaller $installer)
 Install step which adds a row to the site_stats table with appropriate initial values. More...
 
 restoreLinkPopups ()
 
 setParserLanguage ($lang)
 ParserOptions are constructed before we determined the language, so fix it. More...
 
 setPassword ($name, $value)
 Set a variable which stores a password, except if the new value is a fake password in which case leave it as it is. More...
 
 setVar ($name, $value)
 Set a MW configuration variable, or internal installer configuration variable. More...
 
 showError ($msg)
 Same as showMessage(), but for displaying errors. More...
 
 showMessage ($msg)
 UI interface for displaying a short message The parameters are like parameters to wfMessage(). More...
 
 showStatusMessage (Status $status)
 Show a message to the installing user by using a Status object. More...
 

Static Public Member Functions

static apacheModulePresent ($moduleName)
 Checks for presence of an Apache module. More...
 
static getDBTypes ()
 Get a list of known DB types. More...
 
static getExistingLocalSettings ()
 Determine if LocalSettings.php exists. More...
 
static getInstallerConfig (Config $baseConfig)
 Constructs a Config object that contains configuration settings that should be overwritten for the installation process. More...
 
static locateExecutable ($path, $names, $versionInfo=false)
 Search a path for any of the given executable names. More...
 
static locateExecutableInDefaultPaths ($names, $versionInfo=false)
 Same as locateExecutable(), but checks in getPossibleBinPaths() by default. More...
 
static maybeGetWebserverPrimaryGroup ()
 On POSIX systems return the primary group of the webserver we're running under. More...
 
static overrideConfig ()
 Override the necessary bits of the config to run an installation. More...
 

Public Attributes

array array array $licenses
 License types. More...
 
array array $rightsProfiles
 User rights profiles. More...
 
const MINIMUM_PCRE_VERSION = '7.2'
 The oldest version of PCRE we can support. More...
 

Protected Member Functions

 createMainpage (DatabaseInstaller $installer)
 Insert Main Page with default content. More...
 
 createSysop ()
 Create the first user account, grant it sysop and bureaucrat rights. More...
 
 disableTimeLimit ()
 Disable the time limit for execution. More...
 
 doGenerateKeys ($keys)
 Generate a secret value for variables using our CryptRand generator. More...
 
 envCheckBrokenXML ()
 Some versions of libxml+PHP break < and > encoding horribly. More...
 
 envCheckCache ()
 Environment check for compiled object cache types. More...
 
 envCheckDB ()
 Environment check for DB types. More...
 
 envCheckDiff3 ()
 Search for GNU diff3. More...
 
 envCheckGit ()
 Search for git. More...
 
 envCheckGraphics ()
 Environment check for ImageMagick and GD. More...
 
 envCheckLibicu ()
 Check the libicu version. More...
 
 envCheckMemory ()
 Environment check for available memory. More...
 
 envCheckModSecurity ()
 Scare user to death if they have mod_security or mod_security2. More...
 
 envCheckPath ()
 Environment check to inform user which paths we've assumed. More...
 
 envCheckPCRE ()
 Environment check for the PCRE module. More...
 
 envCheckServer ()
 Environment check to inform user which server we've assumed. More...
 
 envCheckShellLocale ()
 Environment check for preferred locale in shell. More...
 
 envCheckSuhosinMaxValueLength ()
 Checks if suhosin.get.max_value_length is set, and if so generate a warning because it decreases ResourceLoader performance. More...
 
 envCheckUploadsDirectory ()
 Environment check for the permissions of the uploads directory. More...
 
 envGetDefaultServer ()
 Helper function to be called from envPrepServer() More...
 
 envPrepPath ()
 Environment prep for setting $IP and $wgScriptPath. More...
 
 envPrepServer ()
 Environment prep for the server hostname. More...
 
 getDocUrl ($page)
 Overridden by WebInstaller to provide lastPage parameters. More...
 
 getInstallSteps (DatabaseInstaller $installer)
 Get an array of install steps. More...
 
 includeExtensions ()
 Installs the auto-detected extensions. More...
 
 unicodeChar ($c)
 Convert a hex string representing a Unicode code point to that code point. More...
 

Static Protected Member Functions

static getPossibleBinPaths ()
 Get an array of likely places we can find executables. More...
 

Protected Attributes

array $compiledDBs
 List of detected DBs, access using getCompiledDBs(). More...
 
array $dbInstallers = []
 Cached DB installer instances, access using getDBInstaller(). More...
 
array $defaultVarNames
 MediaWiki configuration globals that will eventually be passed through to LocalSettings.php. More...
 
array $envChecks
 A list of environment check methods called by doEnvironmentChecks(). More...
 
array $envPreps
 A list of environment preparation methods called by doEnvironmentPreps(). More...
 
array $extraInstallSteps = []
 Extra steps for installation, for things like DatabaseInstallers to modify. More...
 
array $internalDefaults
 Variables that are stored alongside globals, and are used for any configuration of the installation process aside from the MediaWiki configuration. More...
 
 $mediaWikiAnnounceLanguages
 Supported language codes for Mailman. More...
 
array array array $mediaWikiAnnounceUrl
 URL to mediawiki-announce subscription. More...
 
int $minMemorySize = 50
 Minimum memory size in MB. More...
 
array $objectCaches
 Known object cache types and the functions used to test for their existence. More...
 
ParserOptions $parserOptions
 Cached ParserOptions, used by parse(). More...
 
Title $parserTitle
 Cached Title, used by parse(). More...
 
array $settings
 

Static Protected Attributes

static array $dbTypes
 Known database types. More...
 

Private Member Functions

 subscribeToMediaWikiAnnounce (Status $s)
 

Private Attributes

array array $installSteps = []
 The actual list of installation steps. More...
 

Detailed Description

Base installer class.

This class provides the base for installation and update functionality for both MediaWiki core and extensions.

Since
1.17

Definition at line 43 of file Installer.php.

Constructor & Destructor Documentation

Member Function Documentation

Installer::addInstallStep (   $callback,
  $findStep = 'BEGINNING' 
)

Add an installation step following the given step.

Parameters
callable$callbackA valid installation callback array, in this form: [ 'name' => 'some-unique-name', 'callback' => [ $obj, 'function' ] ];
string$findStepThe step to find. Omit to put the step at the beginning

Definition at line 1731 of file Installer.php.

static Installer::apacheModulePresent (   $moduleName)
static

Checks for presence of an Apache module.

Works only if PHP is running as an Apache module, too.

Parameters
string$moduleNameName of module to check.
Returns
bool

Definition at line 1301 of file Installer.php.

Installer::createMainpage ( DatabaseInstaller  $installer)
protected

Insert Main Page with default content.

Parameters
DatabaseInstaller$installer
Returns
Status

Definition at line 1656 of file Installer.php.

References $content, $e, $page, $status, EDIT_NEW, WikiPage\factory(), User\newFromName(), StatusValue\newGood(), Title\newMainPage(), text, and wfMessage().

Installer::createSysop ( )
protected

Create the first user account, grant it sysop and bureaucrat rights.

Returns
Status

Definition at line 1583 of file Installer.php.

References $name, $status, $user, getVar(), StatusValue\newFatal(), User\newFromName(), StatusValue\newGood(), and subscribeToMediaWikiAnnounce().

Installer::dirIsExecutable (   $dir,
  $url 
)

Checks if scripts located in the given directory can be executed via the given URL.

Used only by environment checks.

Parameters
string$dir
string$url
Returns
bool|int|string

Definition at line 1254 of file Installer.php.

References $dir, $e, $ext, $source, as, and Http\get().

Referenced by envCheckUploadsDirectory().

Installer::disableLinkPopups ( )

Definition at line 695 of file Installer.php.

Installer::disableTimeLimit ( )
protected

Disable the time limit for execution.

Some long-running pages (Install, Upgrade) will want to do this

Definition at line 1739 of file Installer.php.

Referenced by WebInstaller\execute().

Installer::doEnvironmentChecks ( )

Do initial checks of the PHP environment.

Set variables according to the observed environment.

It's possible that this may be called under the CLI SAPI, not the SAPI that the wiki will primarily run under. In that case, the subclass should initialise variables such as wgScriptPath, before calling this function.

Under the web subclass, it can already be assumed that PHP 5+ is in use and that sessions are working.

Returns
Status

Definition at line 473 of file Installer.php.

References $status, as, list, StatusValue\newFatal(), StatusValue\newGood(), setVar(), showError(), showMessage(), and wfIsHHVM().

Installer::doEnvironmentPreps ( )

Definition at line 502 of file Installer.php.

References as.

Referenced by __construct().

Installer::doGenerateKeys (   $keys)
protected

Generate a secret value for variables using our CryptRand generator.

Produce a warning if the random source was insecure.

Parameters
array$keys
Returns
Status

Definition at line 1555 of file Installer.php.

References $keys, $name, $status, $wgLang, as, MWCryptRand\generateHex(), global, StatusValue\newGood(), setVar(), and MWCryptRand\wasStrong().

Referenced by generateKeys().

Installer::envCheckBrokenXML ( )
protected

Some versions of libxml+PHP break < and > encoding horribly.

Returns
bool

Definition at line 776 of file Installer.php.

References showError().

Installer::envCheckCache ( )
protected

Environment check for compiled object cache types.

Definition at line 843 of file Installer.php.

References $name, as, setVar(), showMessage(), and wfIniGetBool().

Installer::envCheckDB ( )
protected

Environment check for DB types.

Returns
bool

Definition at line 737 of file Installer.php.

References $name, $status, $wgLang, as, getCompiledDBs(), getDBInstaller(), global, showError(), showStatusMessage(), and wfMessage().

Installer::envCheckDiff3 ( )
protected

Search for GNU diff3.

Returns
bool

Definition at line 879 of file Installer.php.

References setVar(), and showMessage().

Installer::envCheckGit ( )
protected

Search for git.

Since
1.22
Returns
bool

Definition at line 925 of file Installer.php.

References setVar(), showMessage(), and wfIsWindows().

Installer::envCheckGraphics ( )
protected

Environment check for ImageMagick and GD.

Returns
bool

Definition at line 899 of file Installer.php.

References setVar(), showMessage(), and wfIsWindows().

Installer::envCheckLibicu ( )
protected

Check the libicu version.

Definition at line 1106 of file Installer.php.

References showMessage(), and unicodeChar().

Installer::envCheckMemory ( )
protected

Environment check for available memory.

Returns
bool

Definition at line 817 of file Installer.php.

References $limit, setVar(), showMessage(), and wfShorthandToInteger().

Installer::envCheckModSecurity ( )
protected

Scare user to death if they have mod_security or mod_security2.

Returns
bool

Definition at line 866 of file Installer.php.

References showMessage().

Installer::envCheckPath ( )
protected

Environment check to inform user which paths we've assumed.

Returns
bool

Definition at line 960 of file Installer.php.

References getVar(), and showMessage().

Installer::envCheckPCRE ( )
protected

Environment check for the PCRE module.

Note
If this check were to fail, the parser would probably throw an exception before the result of this check is shown to the user.
Returns
bool

Definition at line 795 of file Installer.php.

References showError().

Installer::envCheckServer ( )
protected

Environment check to inform user which server we've assumed.

Returns
bool

Definition at line 947 of file Installer.php.

References envGetDefaultServer(), and showMessage().

Installer::envCheckShellLocale ( )
protected

Environment check for preferred locale in shell.

Returns
bool

Definition at line 973 of file Installer.php.

References $lang, $line, $lines, $ret, as, getVar(), list, setVar(), and wfShellExec().

Installer::envCheckSuhosinMaxValueLength ( )
protected

Checks if suhosin.get.max_value_length is set, and if so generate a warning because it decreases ResourceLoader performance.

Returns
bool

Definition at line 1070 of file Installer.php.

References showMessage().

Installer::envCheckUploadsDirectory ( )
protected

Environment check for the permissions of the uploads directory.

Returns
bool

Definition at line 1051 of file Installer.php.

References $dir, $IP, dirIsExecutable(), getVar(), global, and showMessage().

Installer::envGetDefaultServer ( )
abstractprotected

Helper function to be called from envPrepServer()

Returns
string

Referenced by envCheckServer(), and envPrepServer().

Installer::envPrepPath ( )
protected

Environment prep for setting $IP and $wgScriptPath.

Definition at line 1158 of file Installer.php.

References $IP, global, and setVar().

Installer::envPrepServer ( )
protected

Environment prep for the server hostname.

Definition at line 1142 of file Installer.php.

References envGetDefaultServer(), and setVar().

Installer::findExtensions (   $directory = 'extensions')

Finds extensions that follow the format /$directory/Name/Name.php, and returns an array containing the value for 'Name' for each found extension.

Reasonable values for $directory include 'extensions' (the default) and 'skins'.

Parameters
string$directoryDirectory to search in
Returns
array

Definition at line 1341 of file Installer.php.

References getVar().

Referenced by CliInstaller\__construct().

Installer::generateKeys ( )

Generate $wgSecretKey.

Will warn if we had to use an insecure random source.

Returns
Status

Definition at line 1539 of file Installer.php.

References $keys, doGenerateKeys(), and getVar().

Installer::getCompiledDBs ( )

Get a list of DBs supported by current PHP setup.

Returns
array

Definition at line 541 of file Installer.php.

References $compiledDBs.

Referenced by envCheckDB().

Installer::getDBInstaller (   $type = false)

Get an instance of DatabaseInstaller for the specified DB type.

Parameters
mixed$typeDB installer for which is needed, false to use default.
Returns
DatabaseInstaller

Definition at line 552 of file Installer.php.

References $type, and getVar().

Referenced by LocalSettingsGenerator\__construct(), __construct(), envCheckDB(), and performInstallation().

static Installer::getDBTypes ( )
static

Get a list of known DB types.

Returns
array

Definition at line 456 of file Installer.php.

Referenced by WebInstallerDBConnect\execute(), WebInstallerExistingWiki\handleExistingUpgrade(), and DatabaseUpdater\newForDB().

Installer::getDefaultSkin ( array  $skinNames)

Returns a default value to be used for $wgDefaultSkin: normally the one set in DefaultSettings, but will fall back to another if the default skin is missing and some other one is present instead.

Parameters
string[]$skinNames Names of installed skins.
Returns
string

Definition at line 1378 of file Installer.php.

References $GLOBALS.

Referenced by CliInstaller\__construct().

Installer::getDocUrl (   $page)
protected

Overridden by WebInstaller to provide lastPage parameters.

Parameters
string$page
Returns
string

Definition at line 1328 of file Installer.php.

References $page.

static Installer::getExistingLocalSettings ( )
static

Determine if LocalSettings.php exists.

If it does, return its variables.

Returns
array

Definition at line 572 of file Installer.php.

References $IP, $wgAutoloadClasses, $wgExtensionDirectory, $wgStyleDirectory, and global.

Referenced by WebInstallerExistingWiki\execute(), CliInstaller\execute(), and DatabaseUpdater\loadExtensions().

Installer::getFakePassword (   $realPassword)

Get a fake password for sending back to the user in HTML.

This is a security mechanism to avoid compromise of the password in the event of session ID compromise.

Parameters
string$realPassword
Returns
string

Definition at line 613 of file Installer.php.

Referenced by WebInstaller\getPasswordBox().

static Installer::getInstallerConfig ( Config  $baseConfig)
static

Constructs a Config object that contains configuration settings that should be overwritten for the installation process.

Since
1.27
Parameters
Config$baseConfig
Returns
Config The config to use during installation.

Definition at line 361 of file Installer.php.

References CACHE_ANYTHING, CACHE_DB, CACHE_MEMCACHED, CACHE_NONE, Config\get(), and use.

Installer::getInstallSteps ( DatabaseInstaller  $installer)
protected

Get an array of install steps.

Should always be in the format of [ 'name' => 'someuniquename', 'callback' => [ $obj, 'method' ], ] There must be a config-install-$name message defined per step, which will be shown on install.

Parameters
DatabaseInstaller$installerDatabaseInstaller so we can make callbacks
Returns
array

Definition at line 1451 of file Installer.php.

References $installSteps, as, and getVar().

Referenced by performInstallation().

Installer::getParserOptions ( )
Returns
ParserOptions

Definition at line 691 of file Installer.php.

References $parserOptions.

static Installer::getPossibleBinPaths ( )
staticprotected

Get an array of likely places we can find executables.

Check a bunch of known Unix-like defaults, as well as the PATH environment variable (which should maybe make it work for Windows?)

Returns
array

Definition at line 1171 of file Installer.php.

Installer::getVar (   $name,
  $default = null 
)

Get an MW configuration variable, or internal installer configuration variable.

The defaults come from $GLOBALS (ultimately DefaultSettings.php). Installer variables are typically prefixed by an underscore.

Parameters
string$name
mixed$default
Returns
mixed

Definition at line 528 of file Installer.php.

References $name, and settings.

Referenced by LocalSettingsGenerator\__construct(), CliInstaller\__construct(), createSysop(), CliInstaller\envCheckPath(), envCheckPath(), envCheckShellLocale(), envCheckUploadsDirectory(), WebInstaller\execute(), findExtensions(), generateKeys(), WebInstaller\getCheckBox(), getDBInstaller(), getInstallSteps(), WebInstaller\getPasswordBox(), WebInstaller\getRadioElements(), WebInstaller\getTextArea(), WebInstaller\getTextBox(), includeExtensions(), WebInstaller\setupLanguage(), and subscribeToMediaWikiAnnounce().

Installer::includeExtensions ( )
protected

Installs the auto-detected extensions.

Returns
Status

Definition at line 1392 of file Installer.php.

References $e, $GLOBALS, $IP, $queue, $wgAutoloadClasses, $wgHooks, as, getVar(), global, and StatusValue\newGood().

static Installer::locateExecutable (   $path,
  $names,
  $versionInfo = false 
)
static

Search a path for any of the given executable names.

Returns the executable name if found. Also checks the version string returned by each executable.

Used only by environment checks.

Parameters
string$pathPath to search
array$namesArray of executable names
array | bool$versionInfoFalse or array with two members: 0 => Command to run for version check, with $1 for the full executable name 1 => String to compare the output with

If $versionInfo is not false, only executables with a version matching $versionInfo[1] will be returned.

Returns
bool|string

Definition at line 1196 of file Installer.php.

References $command, $name, $path, as, wfEscapeShellArg(), and wfShellExec().

static Installer::locateExecutableInDefaultPaths (   $names,
  $versionInfo = false 
)
static

Same as locateExecutable(), but checks in getPossibleBinPaths() by default.

See also
locateExecutable()
Parameters
array$namesArray of possible names.
array | bool$versionInfoDefault: false or array with two members: 0 => Command to run for version check, with $1 for the full executable name 1 => String to compare the output with

If $versionInfo is not false, only executables with a version matching $versionInfo[1] will be returned.

Returns
bool|string

Definition at line 1235 of file Installer.php.

References $path, and as.

Referenced by TidySupport\__construct(), DumpTestCase\checkHasGzip(), and Maintenance\readlineEmulation().

static Installer::maybeGetWebserverPrimaryGroup ( )
static

On POSIX systems return the primary group of the webserver we're running under.

On other systems just returns null.

This is used to advice the user that he should chgrp his mw-config/data/images directory as the webserver user before he can install.

Public because SqliteInstaller needs it, and doesn't subclass Installer.

Returns
mixed

Definition at line 641 of file Installer.php.

Referenced by SqliteInstaller\dataDirOKmaybeCreate().

static Installer::overrideConfig ( )
static

Override the necessary bits of the config to run an installation.

Definition at line 1682 of file Installer.php.

References $GLOBALS, and CACHE_NONE.

Installer::parse (   $text,
  $lineStart = false 
)

Convert wikitext $text to HTML.

This is potentially error prone since many parser features require a complete installed MW database. The solution is to just not use those features when you write your messages. This appears to work well enough. Basic formatting and external links work just fine.

But in case a translator decides to throw in a "#ifexist" or internal link or whatever, this function is guarded to catch the attempted DB access and to present some fallback text.

Parameters
string$text
bool$lineStart
Returns
string

Definition at line 671 of file Installer.php.

References $e, $html, $out, $wgParser, and global.

Referenced by WebInstaller\downloadLinkHook(), WebInstaller\getCheckBox(), WebInstaller\getHelpBox(), WebInstaller\getInfoBox(), WebInstaller\getRadioElements(), and WebInstaller\showMessage().

Installer::performInstallation (   $startCB,
  $endCB 
)

Actually perform the installation.

Parameters
callable$startCBA callback array for the beginning of each step
callable$endCBA callback array for the end of each step
Returns
array Array of Status objects

Definition at line 1505 of file Installer.php.

References $name, $status, as, getDBInstaller(), getInstallSteps(), and setVar().

Referenced by CliInstaller\execute().

Installer::populateSiteStats ( DatabaseInstaller  $installer)

Install step which adds a row to the site_stats table with appropriate initial values.

Parameters
DatabaseInstaller$installer
Returns
Status

Definition at line 712 of file Installer.php.

References $status, DatabaseInstaller\getConnection(), and StatusValue\newGood().

Installer::restoreLinkPopups ( )

Definition at line 699 of file Installer.php.

References global.

Installer::setParserLanguage (   $lang)

ParserOptions are constructed before we determined the language, so fix it.

Parameters
Language$lang

Definition at line 1318 of file Installer.php.

References $lang.

Installer::setPassword (   $name,
  $value 
)

Set a variable which stores a password, except if the new value is a fake password in which case leave it as it is.

Parameters
string$name
mixed$value

Definition at line 624 of file Installer.php.

References $name, $value, and setVar().

Referenced by WebInstaller\setVarsFromRequest().

Installer::setVar (   $name,
  $value 
)
Installer::showError (   $msg)
abstract

Same as showMessage(), but for displaying errors.

Parameters
string$msg

Referenced by doEnvironmentChecks(), envCheckBrokenXML(), envCheckDB(), and envCheckPCRE().

Installer::showMessage (   $msg)
abstract

UI interface for displaying a short message The parameters are like parameters to wfMessage().

The messages will be in wikitext format, which will be converted to an output format such as HTML or text before being sent to the user.

Parameters
string$msg

Referenced by doEnvironmentChecks(), envCheckCache(), envCheckDiff3(), envCheckGit(), envCheckGraphics(), envCheckLibicu(), envCheckMemory(), envCheckModSecurity(), envCheckPath(), envCheckServer(), envCheckSuhosinMaxValueLength(), and envCheckUploadsDirectory().

Installer::showStatusMessage ( Status  $status)
abstract

Show a message to the installing user by using a Status object.

Parameters
Status$status

Referenced by envCheckDB().

Installer::subscribeToMediaWikiAnnounce ( Status  $s)
private
Parameters
Status$s

Definition at line 1624 of file Installer.php.

References $params, $res, MWHttpRequest\canMakeRequests(), MWHttpRequest\factory(), getVar(), and StatusValue\warning().

Referenced by createSysop().

Installer::unicodeChar (   $c)
protected

Convert a hex string representing a Unicode code point to that code point.

Parameters
string$c
Returns
string

Definition at line 1085 of file Installer.php.

Referenced by envCheckLibicu().

Member Data Documentation

array Installer::$compiledDBs
protected

List of detected DBs, access using getCompiledDBs().

Definition at line 63 of file Installer.php.

Referenced by getCompiledDBs().

array Installer::$dbInstallers = []
protected

Cached DB installer instances, access using getDBInstaller().

Definition at line 70 of file Installer.php.

array Installer::$dbTypes
staticprotected
Initial value:
= [
'mysql',
'postgres',
'oracle',
'mssql',
'sqlite',
]

Known database types.

These correspond to the class names <type>Installer, and are also MediaWiki database types valid for $wgDBtype.

To add a new type, create a <type>Installer class and a Database<type> class, and add a config-type-<type> message to MessagesEn.php.

Definition at line 102 of file Installer.php.

array Installer::$defaultVarNames
protected
Initial value:
= [
'wgSitename',
'wgPasswordSender',
'wgLanguageCode',
'wgRightsIcon',
'wgRightsText',
'wgRightsUrl',
'wgEnableEmail',
'wgEnableUserEmail',
'wgEnotifUserTalk',
'wgEnotifWatchlist',
'wgEmailAuthentication',
'wgDBname',
'wgDBtype',
'wgDiff3',
'wgImageMagickConvertCommand',
'wgGitBin',
'IP',
'wgScriptPath',
'wgMetaNamespace',
'wgDeletedDirectory',
'wgEnableUploads',
'wgShellLocale',
'wgSecretKey',
'wgUseInstantCommons',
'wgUpgradeKey',
'wgDefaultSkin',
'wgPingback',
]

MediaWiki configuration globals that will eventually be passed through to LocalSettings.php.

The names only are given here, the defaults typically come from DefaultSettings.php.

Definition at line 156 of file Installer.php.

array Installer::$envChecks
protected
Initial value:
= [
'envCheckDB',
'envCheckBrokenXML',
'envCheckPCRE',
'envCheckMemory',
'envCheckCache',
'envCheckModSecurity',
'envCheckDiff3',
'envCheckGraphics',
'envCheckGit',
'envCheckServer',
'envCheckPath',
'envCheckShellLocale',
'envCheckUploadsDirectory',
'envCheckLibicu',
'envCheckSuhosinMaxValueLength',
]

A list of environment check methods called by doEnvironmentChecks().

These may output warnings using showMessage(), and/or abort the installation process by returning false.

For the WebInstaller these are only called on the Welcome page, if these methods have side-effects that should affect later page loads (as well as the generated stylesheet), use envPreps instead.

Definition at line 121 of file Installer.php.

array Installer::$envPreps
protected
Initial value:
= [
'envPrepServer',
'envPrepPath',
]

A list of environment preparation methods called by doEnvironmentPreps().

Definition at line 144 of file Installer.php.

array Installer::$extraInstallSteps = []
protected

Extra steps for installation, for things like DatabaseInstallers to modify.

Definition at line 237 of file Installer.php.

array array Installer::$installSteps = []
private

The actual list of installation steps.

This will be initialized by getInstallSteps()

Definition at line 230 of file Installer.php.

Referenced by getInstallSteps().

array Installer::$internalDefaults
protected
Initial value:
= [
'_UserLang' => 'en'

Variables that are stored alongside globals, and are used for any configuration of the installation process aside from the MediaWiki configuration.

Map of names to defaults.

Definition at line 193 of file Installer.php.

Referenced by __construct().

array array array Installer::$licenses
Initial value:
= [
'cc-by' => [
'url' => 'https://creativecommons.org/licenses/by/4.0/'

License types.

Definition at line 281 of file Installer.php.

Installer::$mediaWikiAnnounceLanguages
protected
Initial value:
= [
'ca', 'cs', 'da', 'de', 'en', 'es', 'et', 'eu', 'fi', 'fr', 'hr', 'hu',
'it', 'ja', 'ko', 'lt', 'nl', 'no', 'pl', 'pt', 'pt-br', 'ro', 'ru',
'sl', 'sr', 'sv', 'tr', 'uk'
]

Supported language codes for Mailman.

Definition at line 324 of file Installer.php.

array array array Installer::$mediaWikiAnnounceUrl
protected
Initial value:
=
'https://lists.wikimedia.org/mailman/subscribe/mediawiki-announce'

URL to mediawiki-announce subscription.

Definition at line 318 of file Installer.php.

int Installer::$minMemorySize = 50
protected

Minimum memory size in MB.

Definition at line 77 of file Installer.php.

array Installer::$objectCaches
protected
Initial value:
= [
'xcache' => 'xcache_get'

Known object cache types and the functions used to test for their existence.

Definition at line 244 of file Installer.php.

ParserOptions Installer::$parserOptions
protected

Cached ParserOptions, used by parse().

Definition at line 91 of file Installer.php.

Referenced by getParserOptions().

Title Installer::$parserTitle
protected

Cached Title, used by parse().

Definition at line 84 of file Installer.php.

array array Installer::$rightsProfiles
Initial value:
= [
'wiki' => []

User rights profiles.

Definition at line 256 of file Installer.php.

array Installer::$settings
protected

Definition at line 56 of file Installer.php.

Referenced by WebInstaller\execute(), and WebInstaller\finish().

const Installer::MINIMUM_PCRE_VERSION = '7.2'

The oldest version of PCRE we can support.

Defining this is necessary because PHP may be linked with a system version of PCRE, which may be older than that bundled with the minimum PHP version.

Definition at line 51 of file Installer.php.

Referenced by UpdateMediaWiki\compatChecks().


The documentation for this class was generated from the following file: