tag * @param string $shortText * @param string $longText * @param string $longHtml */ function wfGenericError( $type, $mwVersion, $title, $shortText, $longText, $longHtml ) { $protocol = isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'; if ( $type == 'cli' ) { $finalOutput = $longText; } else { header( "$protocol 500 MediaWiki configuration Error" ); // Don't cache error pages! They cause no end of trouble... header( 'Cache-control: none' ); header( 'Pragma: no-cache' ); if ( $type == 'index.php' || $type == 'mw-config/index.php' ) { $pathinfo = pathinfo( $_SERVER['SCRIPT_NAME'] ); if ( $type == 'mw-config/index.php' ) { $dirname = dirname( $pathinfo['dirname'] ); } else { $dirname = $pathinfo['dirname']; } $encLogo = htmlspecialchars( str_replace( '//', '/', $dirname . '/' ) . 'resources/assets/mediawiki.png' ); $shortHtml = htmlspecialchars( $shortText ); header( 'Content-type: text/html; charset=UTF-8' ); $finalOutput = << MediaWiki {$mwVersion} The MediaWiki logo

MediaWiki {$mwVersion} internal error

{$shortHtml}

{$title}

{$longHtml}

HTML; // Handle everything that's not index.php } else { // So nothing thinks this is JS or CSS $finalOutput = ( $type == 'load.php' ) ? "/* $shortText */" : $shortText; } } echo "$finalOutput\n"; die( 1 ); } /** * Display an error for the minimum PHP version requirement not being satisfied. * * @param string $type See wfGenericError * @param string $mwVersion See wfGenericError * @param string $minimumVersionPHP The minimum PHP version supported by MediaWiki * @param string $phpVersion The current PHP version */ function wfPHPVersionError( $type, $mwVersion, $minimumVersionPHP, $phpVersion ) { $shortText = "MediaWiki $mwVersion requires at least " . "PHP version $minimumVersionPHP, you are using PHP $phpVersion."; $longText = "Error: You might be using on older PHP version. \n" . "MediaWiki $mwVersion needs PHP $minimumVersionPHP or higher.\n\n" . "Check if you have a newer php executable with a different name, such as php5.\n\n"; $longHtml = <<upgrading your copy of PHP. PHP versions less than 5.3.0 are no longer supported by the PHP Group and will not receive security or bugfix updates.

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."; $longHtml = <<mediawiki.org for help on installing the required components. HTML; wfGenericError( $type, $mwVersion, 'External dependencies', $shortText, $longText, $longHtml ); }