MediaWiki  master
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 $options=[])
 
 dirIsExecutable ( $dir, $url)
 
 endStage ( $step, $status)
 
 envCheckPath ()
 
 execute ()
 Main entry point. More...
 
 showError ( $msg,... $params)
 
 showHelpBox ( $msg)
 Dummy. More...
 
 showMessage ( $msg,... $params)
 
 showStatusMessage (Status $status)
 
 startStage ( $step)
 
 writeConfigurationFile ( $path)
 Write LocalSettings.php to a given path. More...
 
- Public Member Functions inherited from Installer
 __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')
 Find extensions or skins in a subdirectory of $IP. 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,... $params)
 Same as showMessage(), but for displaying errors. More...
 
 showMessage ( $msg,... $params)
 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...
 

Protected Member Functions

 envGetDefaultServer ()
 
 getMessageText ( $msg, $params)
 
- Protected Member Functions inherited from Installer
 createMainpage (DatabaseInstaller $installer)
 Insert Main Page with default content. More...
 
 createSysop ()
 Create the first user account, grant it sysop, bureaucrat and interface-admin rights. More...
 
 disableTimeLimit ()
 Disable the time limit for execution. More...
 
 doGenerateKeys ( $keys)
 Generate a secret value for variables using a secure generator. More...
 
 envCheck64Bit ()
 Checks if we're running on 64 bit or not. 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...
 
 findExtensionsByType ( $type='extension', $directory='extensions')
 Find extensions or skins, and return an array containing the value for 'Name' for each found extension. More...
 
 getDocUrl ( $page)
 Overridden by WebInstaller to provide lastPage parameters. More...
 
 getExtensionInfo ( $type, $parentRelPath, $name)
 
 getInstallSteps (DatabaseInstaller $installer)
 Get an array of install steps. More...
 
 includeExtensions ()
 Installs the auto-detected extensions. More...
 

Private Member Functions

 validateExtensions ( $type, $directory, $nameLists)
 

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. More...
 
static getDBInstallerClass ( $type)
 Get the DatabaseInstaller class name for this type. 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 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 inherited from Installer
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 Attributes inherited from Installer
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 inherited from Installer
static array $dbTypes
 Known database types. More...
 

Detailed Description

Class for the core installer command line interface.

Since
1.17

Definition at line 33 of file CliInstaller.php.

Constructor & Destructor Documentation

◆ __construct()

CliInstaller::__construct (   $siteName,
  $admin = null,
array  $options = [] 
)
Parameters
string$siteName
string | null$admin
array$options
Exceptions
InstallException

Definition at line 57 of file CliInstaller.php.

References $GLOBALS, $opt, $options, $wgContLang, $wgLang, $wgLanguageCode, as, Language\factory(), Installer\findExtensions(), Installer\getDefaultSkin(), RequestContext\getMain(), Installer\getVar(), Installer\setVar(), and validateExtensions().

Member Function Documentation

◆ dirIsExecutable()

CliInstaller::dirIsExecutable (   $dir,
  $url 
)

Definition at line 275 of file CliInstaller.php.

References showMessage().

◆ endStage()

CliInstaller::endStage (   $step,
  $status 
)

Definition at line 217 of file CliInstaller.php.

References showMessage(), and showStatusMessage().

◆ envCheckPath()

CliInstaller::envCheckPath ( )

Definition at line 263 of file CliInstaller.php.

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

◆ envGetDefaultServer()

CliInstaller::envGetDefaultServer ( )
protected

Definition at line 271 of file CliInstaller.php.

References null.

◆ execute()

◆ getMessageText()

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

Definition at line 238 of file CliInstaller.php.

References $params, Sanitizer\stripAllTags(), and wfMessage().

Referenced by showMessage().

◆ showError()

CliInstaller::showError (   $msg,
  $params 
)

Definition at line 227 of file CliInstaller.php.

◆ showHelpBox()

CliInstaller::showHelpBox (   $msg)

Dummy.

Definition at line 249 of file CliInstaller.php.

◆ showMessage()

CliInstaller::showMessage (   $msg,
  $params 
)

Definition at line 222 of file CliInstaller.php.

References $params, and getMessageText().

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

◆ showStatusMessage()

CliInstaller::showStatusMessage ( Status  $status)

Definition at line 252 of file CliInstaller.php.

References as, Status\getErrorsArray(), Status\getWarningsArray(), and showMessage().

Referenced by endStage(), and execute().

◆ startStage()

CliInstaller::startStage (   $step)

Definition at line 210 of file CliInstaller.php.

References showMessage().

◆ validateExtensions()

CliInstaller::validateExtensions (   $type,
  $directory,
  $nameLists 
)
private

Definition at line 144 of file CliInstaller.php.

References $name, $type, as, and Installer\getExtensionInfo().

Referenced by __construct().

◆ writeConfigurationFile()

CliInstaller::writeConfigurationFile (   $path)

Write LocalSettings.php to a given path.

Parameters
string$pathFull path to write LocalSettings.php to

Definition at line 205 of file CliInstaller.php.

References InstallerOverrides\getLocalSettingsGenerator().

Member Data Documentation

◆ $optionMap

CliInstaller::$optionMap
private
Initial value:
= [
'dbtype' => 'wgDBtype'

Definition at line 36 of file CliInstaller.php.

◆ $specifiedScriptPath

CliInstaller::$specifiedScriptPath = false
private

Definition at line 34 of file CliInstaller.php.


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