'mbstring', 'utf8_encode' => 'xml', 'ctype_digit' => 'ctype', 'json_decode' => 'json', 'iconv' => 'iconv', ); // List of extensions we're missing $missingExtensions = array(); // @codingStandardsIgnoreEnd foreach ( $extensions as $function => $extension ) { if ( !function_exists( $function ) ) { $missingExtensions[] = $extension; } } if ( $missingExtensions ) { wfMissingExtensions( $entryPoint, $mwVersion, $missingExtensions ); } } /** * 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. * * @param string $type Which entry point we are protecting. One of: * - index.php * - load.php * - api.php * - mw-config/index.php * - cli * @param string $mwVersion The number of the MediaWiki version used * @param string $title HTML code to be put within an
{$shortHtml}
{$longHtml}
If for some reason you are unable to upgrade your PHP version, you will need to download an older version of MediaWiki from our website. See our compatibility page for details of which versions are compatible with prior versions of PHP. HTML; wfGenericError( $type, $mwVersion, 'Supported PHP versions', $shortText, $longText, $longHtml ); } /** * Display an error for the vendor/autoload.php file not being found. * * @param string $type See wfGenericError * @param string $mwVersion See wfGenericError */ function wfMissingVendorError( $type, $mwVersion ) { $shortText = "Installing some external dependencies (e.g. via composer) is required."; $longText = "Error: You are missing some external dependencies. \n" . "MediaWiki now also has some external dependencies that need to be installed\n" . "via composer or from a separate git repo. Please see\n" . "https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n" . "for help on installing the required components."; // @codingStandardsIgnoreStart Generic.Files.LineLength $longHtml = <<mediawiki.org for help on installing the required components. HTML; // @codingStandardsIgnoreEnd wfGenericError( $type, $mwVersion, 'External dependencies', $shortText, $longText, $longHtml ); } /** * Display an error for a PHP extension not existing. * * @param string $type See wfGenericError * @param string $mwVersion See wfGenericError * @param array $missingExts The extensions we're missing */ function wfMissingExtensions( $type, $mwVersion, $missingExts ) { $shortText = "Installing some PHP extensions is required."; $missingExtText = ''; $missingExtHtml = ''; $baseUrl = 'https://secure.php.net'; foreach ( $missingExts as $ext ) { $missingExtText .= " * $ext <$baseUrl/$ext>\n"; $missingExtHtml .= "