MediaWiki  1.28.0
PHPVersionCheck.php File Reference

Check PHP Version, as well as for composer dependencies in entry points, and display something vaguely comprehensible in the event of a totally unrecoverable error. More...

Go to the source code of this file.

Functions

 wfEntryPointCheck ($entryPoint)
 Check php version and that external dependencies are installed, and display an informative error if either condition is not satisfied. More...
 
 wfGenericError ($type, $mwVersion, $title, $shortText, $longText, $longHtml)
 Display something vaguely comprehensible in the event of a totally unrecoverable error. More...
 
 wfMissingExtensions ($type, $mwVersion, $missingExts)
 Display an error for a PHP extension not existing. More...
 
 wfMissingVendorError ($type, $mwVersion)
 Display an error for the vendor/autoload.php file not being found. More...
 
 wfPHPVersionError ($type, $mwVersion, $minimumVersionPHP, $phpVersion)
 Display an error for the minimum PHP version requirement not being satisfied. More...
 

Detailed Description

Check PHP Version, as well as for composer dependencies in entry points, and display something vaguely comprehensible in the event of a totally unrecoverable error.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html

Definition in file PHPVersionCheck.php.

Function Documentation

wfEntryPointCheck (   $entryPoint)

Check php version and that external dependencies are installed, and display an informative error if either condition is not satisfied.

Note
Since we can't rely on anything, the minimum PHP versions and MW current version are hardcoded here

Definition at line 32 of file PHPVersionCheck.php.

References $extensions, array(), as, wfMissingExtensions(), wfMissingVendorError(), and wfPHPVersionError().

wfGenericError (   $type,
  $mwVersion,
  $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$typeWhich entry point we are protecting. One of:
  • index.php
  • load.php
  • api.php
  • mw-config/index.php
  • cli
string$mwVersionThe number of the MediaWiki version used
string$titleHTML code to be put within an

tag string $shortText string $longText string $longHtml

Definition at line 93 of file PHPVersionCheck.php.

References $title, $type, color, style, text, and title.

Referenced by wfMissingExtensions(), wfMissingVendorError(), and wfPHPVersionError().

wfMissingExtensions (   $type,
  $mwVersion,
  $missingExts 
)

Display an error for a PHP extension not existing.

Parameters
string$typeSee wfGenericError
string$mwVersionSee wfGenericError
array$missingExtsThe extensions we're missing

Definition at line 235 of file PHPVersionCheck.php.

References $ext, $type, are, as, PHP, run, that, and wfGenericError().

Referenced by wfEntryPointCheck().

wfMissingVendorError (   $type,
  $mwVersion 
)

Display an error for the vendor/autoload.php file not being found.

Parameters
string$typeSee wfGenericError
string$mwVersionSee wfGenericError

Definition at line 207 of file PHPVersionCheck.php.

References $type, from, href, on, or, see, some, that, the, and wfGenericError().

Referenced by wfEntryPointCheck().

wfPHPVersionError (   $type,
  $mwVersion,
  $minimumVersionPHP,
  $phpVersion 
)

Display an error for the minimum PHP version requirement not being satisfied.

Parameters
string$typeSee wfGenericError
string$mwVersionSee wfGenericError
string$minimumVersionPHPThe minimum PHP version supported by MediaWiki
string$phpVersionThe current PHP version

Definition at line 178 of file PHPVersionCheck.php.

References $type, and(), are, by, copy, Makefile\download(), from, href, not, of, or, page, PHP, some, the, updates(), version, wfGenericError(), and will.

Referenced by wfEntryPointCheck().