MediaWiki  1.33.0
PHPVersionCheck Class Reference

Public Member Functions

 checkExtensionExistence ()
 Displays an error, if a PHP extension does not exist. More...
 
 checkRequiredPHPVersion ()
 Displays an error, if the installed PHP version does not meet the minimum requirement. More...
 
 checkVendorExistence ()
 Displays an error, if the vendor/autoload.php file could not be found. More...
 
 getIndexErrorOutput ( $title, $longHtml, $shortText)
 Returns an error page, which is suitable for output to the end user via a web browser. More...
 
 getPHPInfo ( $impl=false)
 Return the version of the installed PHP implementation. More...
 
 outputHTMLHeader ()
 Output headers that prevents error pages to be cached. More...
 
 setFormat ( $format)
 Set the format used for errors. More...
 
 setScriptPath ( $scriptPath)
 Set the script path used for images in HTML-formatted errors. More...
 
 triggerError ( $title, $shortText, $longText, $longHtml)
 Display something vaguely comprehensible in the event of a totally unrecoverable error. More...
 

Public Attributes

 $format = 'text'
 
 $functionsExtensionsMapping
 
 $mwVersion = '1.33'
 
 $scriptPath = '/'
 

Detailed Description

Definition at line 37 of file PHPVersionCheck.php.

Member Function Documentation

◆ checkExtensionExistence()

PHPVersionCheck::checkExtensionExistence ( )

Displays an error, if a PHP extension does not exist.

Definition at line 196 of file PHPVersionCheck.php.

References $ext, a, are, array(), as, PHP, run, that, and triggerError().

◆ checkRequiredPHPVersion()

PHPVersionCheck::checkRequiredPHPVersion ( )

Displays an error, if the installed PHP version does not meet the minimum requirement.

Definition at line 122 of file PHPVersionCheck.php.

References a, and(), are, by, copy, Makefile\download(), from, getPHPInfo(), href, If, not, of, or, captcha-old\p, page, reason(), triggerError(), updates(), version, will, and you.

◆ checkVendorExistence()

PHPVersionCheck::checkVendorExistence ( )

Displays an error, if the vendor/autoload.php file could not be found.

Definition at line 170 of file PHPVersionCheck.php.

References a, from, captcha-old\help, href, on, or, see, that, and triggerError().

◆ getIndexErrorOutput()

PHPVersionCheck::getIndexErrorOutput (   $title,
  $longHtml,
  $shortText 
)

Returns an error page, which is suitable for output to the end user via a web browser.

Parameters
string$title
string$longHtml
string$shortText
Returns
string

Definition at line 252 of file PHPVersionCheck.php.

References color, captcha-old\font, captcha-old\p, style, text, and title.

Referenced by triggerError().

◆ getPHPInfo()

PHPVersionCheck::getPHPInfo (   $impl = false)

Return the version of the installed PHP implementation.

Parameters
string$implBy default, the function returns the info of the currently installed PHP implementation. Using this parameter the caller can decide, what version info will be returned. Valid values: HHVM, PHP
Returns
array An array of information about the PHP implementation, containing:
  • 'version': The version of the PHP implementation (specific to the implementation, not the version of the implemented PHP version)
  • 'implementation': The name of the implementation used
  • 'vendor': The development group, vendor or developer of the implementation.
  • 'upstreamSupported': The minimum version of the implementation supported by the named vendor.
  • 'minSupported': The minimum version supported by MediaWiki
  • 'upgradeURL': The URL to the website of the implementation that contains upgrade/installation instructions.

Definition at line 95 of file PHPVersionCheck.php.

References array().

Referenced by checkRequiredPHPVersion().

◆ outputHTMLHeader()

PHPVersionCheck::outputHTMLHeader ( )

Output headers that prevents error pages to be cached.

Definition at line 235 of file PHPVersionCheck.php.

Referenced by triggerError().

◆ setFormat()

PHPVersionCheck::setFormat (   $format)

Set the format used for errors.

Parameters
string$formatOne of "text" or "html"

Definition at line 66 of file PHPVersionCheck.php.

References $format, and format.

◆ setScriptPath()

PHPVersionCheck::setScriptPath (   $scriptPath)

Set the script path used for images in HTML-formatted errors.

Parameters
string$scriptPath

Definition at line 75 of file PHPVersionCheck.php.

References $scriptPath.

◆ triggerError()

PHPVersionCheck::triggerError (   $title,
  $shortText,
  $longText,
  $longHtml 
)

Display something vaguely comprehensible in the event of a totally unrecoverable error.

Does not assume access to anything; no globals, no autoloader, no database, no localisation. Safe for PHP4 (and putting this here means that WebStart.php and GlobalSettings.php no longer need to be).

Calling this function kills execution immediately.

Parameters
string$titleHTML code to be put within an

tag @param string $shortText @param string $longText @param string $longHtml

Definition at line 318 of file PHPVersionCheck.php.

References $title, format, getIndexErrorOutput(), and outputHTMLHeader().

Referenced by checkExtensionExistence(), checkRequiredPHPVersion(), and checkVendorExistence().

Member Data Documentation

◆ $format

PHPVersionCheck::$format = 'text'

Definition at line 54 of file PHPVersionCheck.php.

Referenced by setFormat().

◆ $functionsExtensionsMapping

PHPVersionCheck::$functionsExtensionsMapping
Initial value:
'mb_substr' => 'mbstring',
'xml_parser_create' => 'xml',
'ctype_digit' => 'ctype',
'json_decode' => 'json',
'iconv' => 'iconv',
'mime_content_type' => 'fileinfo',
)

Definition at line 42 of file PHPVersionCheck.php.

◆ $mwVersion

PHPVersionCheck::$mwVersion = '1.33'

Definition at line 39 of file PHPVersionCheck.php.

◆ $scriptPath

string PHPVersionCheck::$scriptPath = '/'

Definition at line 59 of file PHPVersionCheck.php.

Referenced by setScriptPath().


The documentation for this class was generated from the following file:
array
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))