MediaWiki master
BootstrapHelperFunctions.php File Reference

Functions that need to be available during bootstrapping. More...

Go to the source code of this file.

Functions

 wfDetectInstallPath ()
 Decide and remember where mediawiki is installed.
 
 wfDetectLocalSettingsFile (?string $installationPath=null)
 Decide and remember where to load LocalSettings from.
 
 wfIsCLI ()
 Check if we are running from the commandline.
 
 wfIsWindows ()
 Check if the operating system is Windows.
 

Detailed Description

Functions that need to be available during bootstrapping.

Code in this file cannot expect MediaWiki to have been initialized.

Definition in file BootstrapHelperFunctions.php.

Function Documentation

◆ wfDetectInstallPath()

wfDetectInstallPath ( )

Decide and remember where mediawiki is installed.

This is used by Setup.php and will (if not already) store the result in the MW_INSTALL_PATH constant.

The install path is detected based on the location of this file, but can be overwritten using the MW_INSTALL_PATH environment variable.

Access: internal
Only for use by Setup.php and Installer.
Since
1.39
Returns
string The path to the mediawiki installation

Definition at line 68 of file BootstrapHelperFunctions.php.

References $IP.

Referenced by MediaWiki\Installer\Installer\getExistingLocalSettings().

◆ wfDetectLocalSettingsFile()

wfDetectLocalSettingsFile ( ?string $installationPath = null)

Decide and remember where to load LocalSettings from.

This is used by Setup.php and will (if not already) store the result in the MW_CONFIG_FILE constant.

The primary settings file is traditionally LocalSettings.php under the MediaWiki installation path, but can also be placed differently and specified via the MW_CONFIG_FILE constant (from an entrypoint wrapper) or via a MW_CONFIG_FILE environment variable (from the web server).

Experimental: The settings file can use the .yaml or .json extension, which must use the format described on https://www.mediawiki.org/wiki/Manual:YAML_settings_file_format.

Access: internal
Only for use by Setup.php and Installer.
Since
1.38
Parameters
string | null$installationPathThe installation's base path, as returned by wfDetectInstallPath().
Returns
string The path to the settings file

Definition at line 30 of file BootstrapHelperFunctions.php.

Referenced by MediaWiki\Maintenance\MaintenanceRunner\defineSettings(), and MediaWiki\Installer\Installer\getExistingLocalSettings().

◆ wfIsCLI()

wfIsCLI ( )

◆ wfIsWindows()