MediaWiki  1.23.13
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...
 
 exportVars ()
 Exports all wg* variables stored by the installer into global scope. More...
 
 findExtensions ()
 Finds extensions that follow the format /extensions/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...
 
 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 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 $licenses
 License types. More...
 
array $rightsProfiles
 User rights profiles. More...
 
const MINIMUM_PCRE_VERSION = '7.2'
 The oldest version of PCRE we can support. More...
 
const MINIMUM_PHP_VERSION = '5.3.2'
 

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...
 
 envCheckCtype ()
 
 envCheckDB ()
 Environment check for DB types. More...
 
 envCheckDiff3 ()
 Search for GNU diff3. More...
 
 envCheckExtension ()
 Environment check for setting the preferred PHP file extension. More...
 
 envCheckGit ()
 Search for git. More...
 
 envCheckGraphics ()
 Environment check for ImageMagick and GD. More...
 
 envCheckJSON ()
 
 envCheckLibicu ()
 Check the libicu version. More...
 
 envCheckMagicQuotes ()
 Environment check for magic_quotes_runtime. More...
 
 envCheckMagicSybase ()
 Environment check for magic_quotes_sybase. More...
 
 envCheckMbstring ()
 Environment check for mbstring.func_overload. More...
 
 envCheckMemory ()
 Environment check for available memory. More...
 
 envCheckModSecurity ()
 Scare user to death if they have mod_security. More...
 
 envCheckPath ()
 Environment check for setting $IP and $wgScriptPath. More...
 
 envCheckPCRE ()
 Environment check for the PCRE module. More...
 
 envCheckRegisterGlobals ()
 Environment check for register_globals. More...
 
 envCheckSafeMode ()
 Environment check for safe_mode. More...
 
 envCheckServer ()
 Environment check for the server hostname. 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...
 
 envCheckXML ()
 Environment check for the XML module. More...
 
 envGetDefaultServer ()
 Helper function to be called from envCheckServer() 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 = array()
 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 $extraInstallSteps = array()
 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...
 
 $mediaWikiAnnounceUrl
 URL to mediawiki-announce subscription. More...
 
integer $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 $dbTypes
 

Private Member Functions

 subscribeToMediaWikiAnnounce (Status $s)
 

Private Attributes

array $installSteps = array()
 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 39 of file Installer.php.

Constructor & Destructor Documentation

◆ __construct()

Installer::__construct ( )

Member Function Documentation

◆ addInstallStep()

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

Add an installation step following the given step.

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

Definition at line 1734 of file Installer.php.

◆ apacheModulePresent()

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 1354 of file Installer.php.

◆ createMainpage()

Installer::createMainpage ( DatabaseInstaller  $installer)
protected

Insert Main Page with default content.

Parameters
$installerDatabaseInstaller
Returns
Status

Definition at line 1670 of file Installer.php.

References $e, EDIT_NEW, WikiPage\factory(), User\newFromName(), Status\newGood(), Title\newMainPage(), text, and wfMessage().

◆ createSysop()

Installer::createSysop ( )
protected

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

Returns
Status

Definition at line 1597 of file Installer.php.

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

◆ dirIsExecutable()

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
$dirstring
$urlstring
Returns
bool|int|string

Definition at line 1307 of file Installer.php.

References $dir, $e, $ext, $file, $source, array(), as, Http\get(), wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by envCheckUploadsDirectory().

◆ disableLinkPopups()

Installer::disableLinkPopups ( )

Definition at line 618 of file Installer.php.

◆ disableTimeLimit()

Installer::disableTimeLimit ( )
protected

Disable the time limit for execution.

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

Definition at line 1742 of file Installer.php.

References wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by WebInstaller\execute().

◆ doEnvironmentChecks()

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 404 of file Installer.php.

References as, list, Status\newFatal(), Status\newGood(), setVar(), showError(), and showMessage().

◆ doGenerateKeys()

Installer::doGenerateKeys (   $keys)
protected

Generate a secret value for variables using our CryptRand generator.

Produce a warning if the random source was insecure.

Parameters
$keysArray
Returns
Status

Definition at line 1569 of file Installer.php.

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

Referenced by generateKeys().

◆ envCheckBrokenXML()

Installer::envCheckBrokenXML ( )
protected

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

Returns
bool

Definition at line 720 of file Installer.php.

References $test, and showError().

◆ envCheckCache()

Installer::envCheckCache ( )
protected

Environment check for compiled object cache types.

Definition at line 856 of file Installer.php.

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

◆ envCheckCtype()

Installer::envCheckCtype ( )
protected
Returns
bool

Definition at line 1194 of file Installer.php.

References showError().

◆ envCheckDB()

Installer::envCheckDB ( )
protected

Environment check for DB types.

Returns
bool

Definition at line 672 of file Installer.php.

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

◆ envCheckDiff3()

Installer::envCheckDiff3 ( )
protected

Search for GNU diff3.

Returns
bool

Definition at line 890 of file Installer.php.

References array(), locateExecutableInDefaultPaths(), setVar(), and showMessage().

◆ envCheckExtension()

Installer::envCheckExtension ( )
protected

Environment check for setting the preferred PHP file extension.

Returns
bool

Definition at line 994 of file Installer.php.

References $ext, and setVar().

◆ envCheckGit()

Installer::envCheckGit ( )
protected

Search for git.

Since
1.22
Returns
bool

Definition at line 936 of file Installer.php.

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

◆ envCheckGraphics()

Installer::envCheckGraphics ( )
protected

Environment check for ImageMagick and GD.

Returns
bool

Definition at line 910 of file Installer.php.

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

◆ envCheckJSON()

Installer::envCheckJSON ( )
protected
Returns
bool

Definition at line 1207 of file Installer.php.

References showError().

◆ envCheckLibicu()

Installer::envCheckLibicu ( )
protected

Check the libicu version.

Definition at line 1143 of file Installer.php.

References showMessage(), unicodeChar(), and UtfNormal\UNORM_NFC.

◆ envCheckMagicQuotes()

Installer::envCheckMagicQuotes ( )
protected

Environment check for magic_quotes_runtime.

Returns
bool

Definition at line 735 of file Installer.php.

References showError(), and wfIniGetBool().

◆ envCheckMagicSybase()

Installer::envCheckMagicSybase ( )
protected

Environment check for magic_quotes_sybase.

Returns
bool

Definition at line 749 of file Installer.php.

References showError(), and wfIniGetBool().

◆ envCheckMbstring()

Installer::envCheckMbstring ( )
protected

Environment check for mbstring.func_overload.

Returns
bool

Definition at line 763 of file Installer.php.

References showError(), and wfIniGetBool().

◆ envCheckMemory()

Installer::envCheckMemory ( )
protected

Environment check for available memory.

Returns
bool

Definition at line 830 of file Installer.php.

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

◆ envCheckModSecurity()

Installer::envCheckModSecurity ( )
protected

Scare user to death if they have mod_security.

Returns
bool

Definition at line 878 of file Installer.php.

References showMessage().

◆ envCheckPath()

Installer::envCheckPath ( )
protected

Environment check for setting $IP and $wgScriptPath.

Returns
bool

Reimplemented in WebInstaller.

Definition at line 976 of file Installer.php.

References $IP, getVar(), global, setVar(), and showMessage().

◆ envCheckPCRE()

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 808 of file Installer.php.

References showError(), wfRestoreWarnings(), and wfSuppressWarnings().

◆ envCheckRegisterGlobals()

Installer::envCheckRegisterGlobals ( )
protected

Environment check for register_globals.

Definition at line 710 of file Installer.php.

References showMessage(), and wfIniGetBool().

◆ envCheckSafeMode()

Installer::envCheckSafeMode ( )
protected

Environment check for safe_mode.

Returns
bool

Definition at line 777 of file Installer.php.

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

◆ envCheckServer()

Installer::envCheckServer ( )
protected

Environment check for the server hostname.

Definition at line 956 of file Installer.php.

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

◆ envCheckShellLocale()

Installer::envCheckShellLocale ( )
protected

Environment check for preferred locale in shell.

Returns
bool

Definition at line 1010 of file Installer.php.

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

◆ envCheckSuhosinMaxValueLength()

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 1107 of file Installer.php.

References showMessage().

◆ envCheckUploadsDirectory()

Installer::envCheckUploadsDirectory ( )
protected

Environment check for the permissions of the uploads directory.

Returns
bool

Definition at line 1088 of file Installer.php.

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

◆ envCheckXML()

Installer::envCheckXML ( )
protected

Environment check for the XML module.

Returns
bool

Definition at line 790 of file Installer.php.

References showError().

◆ envGetDefaultServer()

Installer::envGetDefaultServer ( )
abstractprotected

Helper function to be called from envCheckServer()

Returns
String

Reimplemented in WebInstaller.

Referenced by envCheckServer().

◆ exportVars()

Installer::exportVars ( )

Exports all wg* variables stored by the installer into global scope.

Definition at line 660 of file Installer.php.

References $GLOBALS, $name, $value, as, and settings.

Referenced by WebInstaller\execute().

◆ findExtensions()

Installer::findExtensions ( )

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

Returns
array

Definition at line 1391 of file Installer.php.

References $file, array(), and getVar().

◆ generateKeys()

Installer::generateKeys ( )

Generate $wgSecretKey.

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

Returns
Status

Definition at line 1553 of file Installer.php.

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

◆ getCompiledDBs()

Installer::getCompiledDBs ( )

Get a list of DBs supported by current PHP setup.

Returns
array

Definition at line 470 of file Installer.php.

References $compiledDBs.

Referenced by envCheckDB().

◆ getDBInstaller()

Installer::getDBInstaller (   $type = false)

Get an instance of DatabaseInstaller for the specified DB type.

Parameters
$typeMixed: DB installer for which is needed, false to use default.
Returns
DatabaseInstaller

Definition at line 481 of file Installer.php.

References $type, and getVar().

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

◆ getDBTypes()

static Installer::getDBTypes ( )
static

Get a list of known DB types.

Returns
array

Definition at line 387 of file Installer.php.

References $dbTypes.

Referenced by DatabaseUpdater\newForDB().

◆ getDocUrl()

Installer::getDocUrl (   $page)
protected

Overridden by WebInstaller to provide lastPage parameters.

Parameters
$pagestring
Returns
string

Reimplemented in WebInstaller.

Definition at line 1381 of file Installer.php.

◆ getExistingLocalSettings()

static Installer::getExistingLocalSettings ( )
static

Determine if LocalSettings.php exists.

If it does, return its variables.

Returns
Array

Definition at line 501 of file Installer.php.

References $IP, $wgAutoloadClasses, global, wfRestoreWarnings(), and wfSuppressWarnings().

Referenced by DatabaseUpdater\loadExtensions().

◆ getFakePassword()

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
$realPasswordString
Returns
string

Definition at line 535 of file Installer.php.

Referenced by WebInstaller\getPasswordBox().

◆ getInstallSteps()

Installer::getInstallSteps ( DatabaseInstaller  $installer)
protected

Get an array of install steps.

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

Parameters
$installerDatabaseInstaller so we can make callbacks
Returns
array

Definition at line 1466 of file Installer.php.

References $installSteps, array(), as, and getVar().

Referenced by performInstallation().

◆ getParserOptions()

Installer::getParserOptions ( )
Returns
ParserOptions

Definition at line 614 of file Installer.php.

References $parserOptions.

◆ getPossibleBinPaths()

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 1224 of file Installer.php.

References array().

◆ getVar()

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
$nameString
$defaultMixed
Returns
mixed

Definition at line 457 of file Installer.php.

References $name, and settings.

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

◆ includeExtensions()

Installer::includeExtensions ( )
protected

Installs the auto-detected extensions.

Returns
Status

Definition at line 1422 of file Installer.php.

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

◆ locateExecutable()

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$namesof executable names
$versionInfoBoolean 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 1249 of file Installer.php.

References $command, $file, $name, $path, array(), as, wfEscapeShellArg(), wfRestoreWarnings(), wfShellExec(), and wfSuppressWarnings().

Referenced by locateExecutableInDefaultPaths().

◆ locateExecutableInDefaultPaths()

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 1288 of file Installer.php.

References $path, as, and locateExecutable().

Referenced by envCheckDiff3(), envCheckGit(), envCheckGraphics(), and Maintenance\readlineEmulation().

◆ maybeGetWebserverPrimaryGroup()

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 563 of file Installer.php.

Referenced by SqliteInstaller\dataDirOKmaybeCreate().

◆ overrideConfig()

static Installer::overrideConfig ( )
static

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

Definition at line 1696 of file Installer.php.

References $GLOBALS, and CACHE_NONE.

◆ parse()

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
$textString
$lineStartBoolean
Returns
String

Definition at line 594 of file Installer.php.

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

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

◆ performInstallation()

Installer::performInstallation (   $startCB,
  $endCB 
)

Actually perform the installation.

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

Definition at line 1519 of file Installer.php.

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

◆ populateSiteStats()

Installer::populateSiteStats ( DatabaseInstaller  $installer)

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

Parameters
$installerDatabaseInstaller
Returns
Status

Definition at line 635 of file Installer.php.

References array(), DatabaseInstaller\getConnection(), and Status\newGood().

◆ restoreLinkPopups()

Installer::restoreLinkPopups ( )

Definition at line 622 of file Installer.php.

References global.

◆ setParserLanguage()

Installer::setParserLanguage (   $lang)

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

Parameters
$langLanguage

Definition at line 1371 of file Installer.php.

◆ setPassword()

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
$nameString
$valueMixed

Definition at line 546 of file Installer.php.

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

Referenced by WebInstaller\setVarsFromRequest().

◆ setVar()

Installer::setVar (   $name,
  $value 
)

◆ showError()

Installer::showError (   $msg)
abstract

◆ showMessage()

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
$msg

Reimplemented in WebInstaller.

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

◆ showStatusMessage()

Installer::showStatusMessage ( Status  $status)
abstract

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

Parameters
$statusStatus

Reimplemented in WebInstaller.

Referenced by envCheckDB().

◆ subscribeToMediaWikiAnnounce()

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

Definition at line 1638 of file Installer.php.

References $params, $res, $s, array(), MWHttpRequest\canMakeRequests(), MWHttpRequest\factory(), and getVar().

Referenced by createSysop().

◆ unicodeChar()

Installer::unicodeChar (   $c)
protected

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

Parameters
$cString
Returns
string

Definition at line 1122 of file Installer.php.

Referenced by envCheckLibicu().

Member Data Documentation

◆ $compiledDBs

array Installer::$compiledDBs
protected

List of detected DBs, access using getCompiledDBs().

Definition at line 60 of file Installer.php.

Referenced by __construct(), and getCompiledDBs().

◆ $dbInstallers

array Installer::$dbInstallers = array()
protected

Cached DB installer instances, access using getDBInstaller().

Definition at line 66 of file Installer.php.

◆ $dbTypes

Installer::$dbTypes
staticprotected
Initial value:
'mysql',
'postgres',
'oracle',
'mssql',
'sqlite',
)

Definition at line 95 of file Installer.php.

Referenced by getDBTypes().

◆ $defaultVarNames

array Installer::$defaultVarNames
protected
Initial value:
'wgSitename',
'wgPasswordSender',
'wgLanguageCode',
'wgRightsIcon',
'wgRightsText',
'wgRightsUrl',
'wgMainCacheType',
'wgEnableEmail',
'wgEnableUserEmail',
'wgEnotifUserTalk',
'wgEnotifWatchlist',
'wgEmailAuthentication',
'wgDBtype',
'wgDiff3',
'wgImageMagickConvertCommand',
'wgGitBin',
'IP',
'wgScriptPath',
'wgScriptExtension',
'wgMetaNamespace',
'wgDeletedDirectory',
'wgEnableUploads',
'wgShellLocale',
'wgSecretKey',
'wgUseInstantCommons',
'wgUpgradeKey',
'wgDefaultSkin',
'wgResourceLoaderMaxQueryLength',
)

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 142 of file Installer.php.

◆ $envChecks

array Installer::$envChecks
protected
Initial value:
'envCheckDB',
'envCheckRegisterGlobals',
'envCheckBrokenXML',
'envCheckMagicQuotes',
'envCheckMagicSybase',
'envCheckMbstring',
'envCheckSafeMode',
'envCheckXML',
'envCheckPCRE',
'envCheckMemory',
'envCheckCache',
'envCheckModSecurity',
'envCheckDiff3',
'envCheckGraphics',
'envCheckGit',
'envCheckServer',
'envCheckPath',
'envCheckExtension',
'envCheckShellLocale',
'envCheckUploadsDirectory',
'envCheckLibicu',
'envCheckSuhosinMaxValueLength',
'envCheckCtype',
'envCheckJSON',
)

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

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

Definition at line 109 of file Installer.php.

◆ $extraInstallSteps

array Installer::$extraInstallSteps = array()
protected

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

Definition at line 220 of file Installer.php.

◆ $installSteps

array Installer::$installSteps = array()
private

The actual list of installation steps.

This will be initialized by getInstallSteps()

Definition at line 214 of file Installer.php.

Referenced by getInstallSteps().

◆ $internalDefaults

array Installer::$internalDefaults
protected
Initial value:
'_UserLang' => 'en',
'_Environment' => false,
'_SafeMode' => false,
'_RaiseMemory' => false,
'_UpgradeDone' => false,
'_InstallDone' => false,
'_Caches' => array(),
'_InstallPassword' => '',
'_SameAccount' => true,
'_CreateDBAccount' => false,
'_NamespaceType' => 'site-name',
'_AdminName' => '',
'_AdminPassword' => '',
'_AdminPassword2' => '',
'_AdminEmail' => '',
'_Subscribe' => false,
'_SkipOptional' => 'continue',
'_RightsProfile' => 'wiki',
'_LicenseCode' => 'none',
'_CCDone' => false,
'_Extensions' => array(),
'_MemCachedServers' => '',
'_UpgradeKeySupplied' => false,
'_ExistingDBSettings' => false,
'wgLogo' => '$wgStylePath/common/images/wiki.png',
)

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 179 of file Installer.php.

Referenced by __construct().

◆ $licenses

array Installer::$licenses

License types.

Definition at line 260 of file Installer.php.

◆ $mediaWikiAnnounceLanguages

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 307 of file Installer.php.

◆ $mediaWikiAnnounceUrl

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

URL to mediawiki-announce subscription.

Definition at line 301 of file Installer.php.

◆ $minMemorySize

integer Installer::$minMemorySize = 50
protected

Minimum memory size in MB.

Definition at line 72 of file Installer.php.

◆ $objectCaches

array Installer::$objectCaches
protected
Initial value:
'xcache' => 'xcache_get',
'apc' => 'apc_fetch',
'wincache' => 'wincache_ucache_get'
)

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

Definition at line 226 of file Installer.php.

◆ $parserOptions

ParserOptions Installer::$parserOptions
protected

Cached ParserOptions, used by parse().

Definition at line 84 of file Installer.php.

Referenced by getParserOptions().

◆ $parserTitle

Title Installer::$parserTitle
protected

Cached Title, used by parse().

Definition at line 78 of file Installer.php.

◆ $rightsProfiles

array Installer::$rightsProfiles
Initial value:
'wiki' => array(),
'no-anon' => array(
'*' => array( 'edit' => false )
),
'fishbowl' => array(
'*' => array(
'createaccount' => false,
'edit' => false,
),
),
'private' => array(
'*' => array(
'createaccount' => false,
'edit' => false,
'read' => false,
),
),
)

User rights profiles.

Definition at line 236 of file Installer.php.

◆ $settings

array Installer::$settings
protected

Definition at line 54 of file Installer.php.

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

◆ MINIMUM_PCRE_VERSION

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 50 of file Installer.php.

◆ MINIMUM_PHP_VERSION

const Installer::MINIMUM_PHP_VERSION = '5.3.2'

Definition at line 42 of file Installer.php.


The documentation for this class was generated from the following file:
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.