MediaWiki  1.30.0
PHPVersionCheck Class Reference
Collaboration diagram for PHPVersionCheck:

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)
 Returns the version of the installed php implementation. More...
 
 outputHTMLHeader ()
 Output headers that prevents error pages to be cached. More...
 
 setEntryPoint ( $entryPoint)
 
 triggerError ( $title, $shortText, $longText, $longHtml)
 Display something vaguely comprehensible in the event of a totally unrecoverable error. More...
 

Public Attributes

string $entryPoint = null
 Which entry point we are protecting. More...
 
 $functionsExtensionsMapping
 
 $mwVersion = '1.30'
 

Detailed Description

Definition at line 30 of file PHPVersionCheck.php.

Member Function Documentation

◆ checkExtensionExistence()

PHPVersionCheck::checkExtensionExistence ( )

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

Returns
$this

Definition at line 183 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.

Returns
$this

Definition at line 110 of file PHPVersionCheck.php.

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

◆ checkVendorExistence()

PHPVersionCheck::checkVendorExistence ( )

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

Returns
$this

Definition at line 157 of file PHPVersionCheck.php.

References a, from, captcha-old\help, href, on, or, see, some, 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 239 of file PHPVersionCheck.php.

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

Referenced by triggerError().

◆ getPHPInfo()

PHPVersionCheck::getPHPInfo (   $impl = false)

Returns 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 MediWiki
  • 'upgradeURL': The URL to the website of the implementation that contains upgrade/installation instructions.

Definition at line 81 of file PHPVersionCheck.php.

References array().

Referenced by checkRequiredPHPVersion().

◆ outputHTMLHeader()

PHPVersionCheck::outputHTMLHeader ( )

Output headers that prevents error pages to be cached.

Definition at line 222 of file PHPVersionCheck.php.

Referenced by triggerError().

◆ setEntryPoint()

PHPVersionCheck::setEntryPoint (   $entryPoint)
Parameters
string$entryPointWhich entry point we are protecting. One of:
  • index.php
  • load.php
  • api.php
  • mw-config/index.php
  • cli
Returns
$this

Definition at line 61 of file PHPVersionCheck.php.

References $entryPoint.

◆ 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 311 of file PHPVersionCheck.php.

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

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

Member Data Documentation

◆ $entryPoint

string PHPVersionCheck::$entryPoint = null

Which entry point we are protecting.

One of:

  • index.php
  • load.php
  • api.php
  • mw-config/index.php
  • cli

Definition at line 50 of file PHPVersionCheck.php.

Referenced by setEntryPoint().

◆ $functionsExtensionsMapping

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

Definition at line 33 of file PHPVersionCheck.php.

◆ $mwVersion

PHPVersionCheck::$mwVersion = '1.30'

Definition at line 32 of file PHPVersionCheck.php.


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