MediaWiki REL1_28
CliInstaller Class Reference

Class for the core installer command line interface. More...

Inheritance diagram for CliInstaller:
Collaboration diagram for CliInstaller:

Public Member Functions

 __construct ( $siteName, $admin=null, array $option=[])
 Constructor.
 
 dirIsExecutable ( $dir, $url)
 Checks if scripts located in the given directory can be executed via the given URL.
 
 endStage ( $step, $status)
 
 envCheckPath ()
 Environment check to inform user which paths we've assumed.
 
 execute ()
 Main entry point.
 
 showError ( $msg)
 Same as showMessage(), but for displaying errors.
 
 showHelpBox ( $msg)
 Dummy.
 
 showMessage ( $msg)
 UI interface for displaying a short message The parameters are like parameters to wfMessage().
 
 showStatusMessage (Status $status)
 Show a message to the installing user by using a Status object.
 
 startStage ( $step)
 
 writeConfigurationFile ( $path)
 Write LocalSettings.php to a given path.
 
- Public Member Functions inherited from Installer
 __construct ()
 Constructor, always call this from child classes.
 
 addInstallStep ( $callback, $findStep='BEGINNING')
 Add an installation step following the given step.
 
 disableLinkPopups ()
 
 doEnvironmentChecks ()
 Do initial checks of the PHP environment.
 
 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.
 
 generateKeys ()
 Generate $wgSecretKey.
 
 getCompiledDBs ()
 Get a list of DBs supported by current PHP setup.
 
 getDBInstaller ( $type=false)
 Get an instance of DatabaseInstaller for the specified DB type.
 
 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.
 
 getFakePassword ( $realPassword)
 Get a fake password for sending back to the user in HTML.
 
 getParserOptions ()
 
 getVar ( $name, $default=null)
 Get an MW configuration variable, or internal installer configuration variable.
 
 parse ( $text, $lineStart=false)
 Convert wikitext $text to HTML.
 
 performInstallation ( $startCB, $endCB)
 Actually perform the installation.
 
 populateSiteStats (DatabaseInstaller $installer)
 Install step which adds a row to the site_stats table with appropriate initial values.
 
 restoreLinkPopups ()
 
 setParserLanguage ( $lang)
 ParserOptions are constructed before we determined the language, so fix it.
 
 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.
 
 setVar ( $name, $value)
 Set a MW configuration variable, or internal installer configuration variable.
 

Protected Member Functions

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

Private Attributes

 $optionMap
 
 $specifiedScriptPath = false
 

Additional Inherited Members

- Static Public Member Functions inherited from Installer
static apacheModulePresent ( $moduleName)
 Checks for presence of an Apache module.
 
static getDBTypes ()
 Get a list of known DB types.
 
static getExistingLocalSettings ()
 Determine if LocalSettings.php exists.
 
static getInstallerConfig (Config $baseConfig)
 Constructs a Config object that contains configuration settings that should be overwritten for the installation process.
 
static locateExecutable ( $path, $names, $versionInfo=false)
 Search a path for any of the given executable names.
 
static locateExecutableInDefaultPaths ( $names, $versionInfo=false)
 Same as locateExecutable(), but checks in getPossibleBinPaths() by default.
 
static maybeGetWebserverPrimaryGroup ()
 On POSIX systems return the primary group of the webserver we're running under.
 
static overrideConfig ()
 Override the necessary bits of the config to run an installation.
 
- Public Attributes inherited from Installer
array $licenses
 License types.
 
array $rightsProfiles
 User rights profiles.
 
const MINIMUM_PCRE_VERSION = '7.2'
 The oldest version of PCRE we can support.
 
- Static Protected Member Functions inherited from Installer
static getPossibleBinPaths ()
 Get an array of likely places we can find executables.
 
- Protected Attributes inherited from Installer
array $compiledDBs
 List of detected DBs, access using getCompiledDBs().
 
array $dbInstallers = []
 Cached DB installer instances, access using getDBInstaller().
 
array $defaultVarNames
 MediaWiki configuration globals that will eventually be passed through to LocalSettings.php.
 
array $envChecks
 A list of environment check methods called by doEnvironmentChecks().
 
array $envPreps
 A list of environment preparation methods called by doEnvironmentPreps().
 
array $extraInstallSteps = []
 Extra steps for installation, for things like DatabaseInstallers to modify.
 
array $internalDefaults
 Variables that are stored alongside globals, and are used for any configuration of the installation process aside from the MediaWiki configuration.
 
 $mediaWikiAnnounceLanguages
 Supported language codes for Mailman.
 
 $mediaWikiAnnounceUrl
 URL to mediawiki-announce subscription.
 
int $minMemorySize = 50
 Minimum memory size in MB.
 
array $objectCaches
 Known object cache types and the functions used to test for their existence.
 
ParserOptions $parserOptions
 Cached ParserOptions, used by parse().
 
Title $parserTitle
 Cached Title, used by parse().
 
array $settings
 
- Static Protected Attributes inherited from Installer
static array $dbTypes
 Known database types.
 

Detailed Description

Class for the core installer command line interface.

Since
1.17

Definition at line 30 of file CliInstaller.php.

Constructor & Destructor Documentation

◆ __construct()

CliInstaller::__construct (   $siteName,
  $admin = null,
array  $option = [] 
)

Constructor.

Parameters
string$siteName
string$admin
array$option

Definition at line 56 of file CliInstaller.php.

References $GLOBALS, $wgContLang, $wgLang, $wgLanguageCode, as, Installer\findExtensions(), Installer\getDefaultSkin(), RequestContext\getMain(), Installer\getVar(), global, and Installer\setVar().

Member Function Documentation

◆ dirIsExecutable()

CliInstaller::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

Reimplemented from Installer.

Definition at line 220 of file CliInstaller.php.

References $dir, and showMessage().

◆ endStage()

CliInstaller::endStage (   $step,
  $status 
)

Definition at line 156 of file CliInstaller.php.

References $status, showMessage(), and showStatusMessage().

◆ envCheckPath()

CliInstaller::envCheckPath ( )

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

Returns
bool

Reimplemented from Installer.

Definition at line 208 of file CliInstaller.php.

References Installer\getVar(), and showMessage().

◆ envGetDefaultServer()

CliInstaller::envGetDefaultServer ( )
protected

Helper function to be called from envPrepServer()

Returns
string

Reimplemented from Installer.

Definition at line 216 of file CliInstaller.php.

◆ execute()

CliInstaller::execute ( )

◆ getMessageText()

CliInstaller::getMessageText (   $params)
protected
Parameters
array$params
Returns
string

Definition at line 176 of file CliInstaller.php.

References $params, and wfMessage().

Referenced by showMessage().

◆ showError()

CliInstaller::showError (   $msg)

Same as showMessage(), but for displaying errors.

Parameters
string$msg

Reimplemented from Installer.

Definition at line 166 of file CliInstaller.php.

◆ showHelpBox()

CliInstaller::showHelpBox (   $msg)

Dummy.

Definition at line 189 of file CliInstaller.php.

◆ showMessage()

CliInstaller::showMessage (   $msg)

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

Reimplemented from Installer.

Definition at line 161 of file CliInstaller.php.

References getMessageText().

Referenced by dirIsExecutable(), endStage(), envCheckPath(), and startStage().

◆ showStatusMessage()

CliInstaller::showStatusMessage ( Status  $status)

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

Parameters
Status$status

Reimplemented from Installer.

Definition at line 192 of file CliInstaller.php.

References $status, and as.

Referenced by endStage(), and execute().

◆ startStage()

CliInstaller::startStage (   $step)

Definition at line 149 of file CliInstaller.php.

References showMessage().

◆ writeConfigurationFile()

CliInstaller::writeConfigurationFile (   $path)

Write LocalSettings.php to a given path.

Parameters
string$pathFull path to write LocalSettings.php to

Definition at line 144 of file CliInstaller.php.

References InstallerOverrides\getLocalSettingsGenerator().

Member Data Documentation

◆ $optionMap

CliInstaller::$optionMap
private
Initial value:
= [
'dbtype' => 'wgDBtype',
'dbserver' => 'wgDBserver',
'dbname' => 'wgDBname',
'dbuser' => 'wgDBuser',
'dbpass' => 'wgDBpassword',
'dbprefix' => 'wgDBprefix',
'dbtableoptions' => 'wgDBTableOptions',
'dbmysql5' => 'wgDBmysql5',
'dbport' => 'wgDBport',
'dbschema' => 'wgDBmwschema',
'dbpath' => 'wgSQLiteDataDir',
'server' => 'wgServer',
'scriptpath' => 'wgScriptPath',
]

Definition at line 33 of file CliInstaller.php.

◆ $specifiedScriptPath

CliInstaller::$specifiedScriptPath = false
private

Definition at line 31 of file CliInstaller.php.


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