43 'mb_substr' =>
'mbstring',
44 'xml_parser_create' =>
'xml',
45 'ctype_digit' =>
'ctype',
46 'json_decode' =>
'json',
48 'mime_content_type' =>
'fileinfo',
97 ( defined(
'HHVM_VERSION' ) && $impl !==
'PHP' ) ||
101 'implementation' =>
'HHVM',
102 'version' => defined(
'HHVM_VERSION' ) ? HHVM_VERSION :
'undefined',
103 'vendor' =>
'Facebook',
104 'upstreamSupported' =>
'3.18.5',
105 'minSupported' =>
'3.18.5',
106 'upgradeURL' =>
'https://docs.hhvm.com/hhvm/installation/introduction',
110 'implementation' =>
'PHP',
111 'version' => PHP_VERSION,
112 'vendor' =>
'the PHP Group',
113 'upstreamSupported' =>
'7.2.0',
114 'minSupported' =>
'7.0.13',
115 'upgradeURL' =>
'https://secure.php.net/downloads.php',
124 $minimumVersion = $phpInfo[
'minSupported'];
125 $otherInfo = $this->
getPHPInfo( $phpInfo[
'implementation'] ===
'HHVM' ?
'PHP' :
'HHVM' );
130 $shortText =
"MediaWiki $this->mwVersion requires at least {$phpInfo['implementation']}"
131 .
" version $minimumVersion or {$otherInfo['implementation']} version "
132 .
"{$otherInfo['minSupported']}, you are using {$phpInfo['implementation']} "
133 .
"{$phpInfo['version']}.";
135 $longText =
"Error: You might be using an older {$phpInfo['implementation']} version "
136 .
"({$phpInfo['implementation']} {$phpInfo['version']}). \n"
137 .
"MediaWiki $this->mwVersion needs {$phpInfo['implementation']}"
138 .
" $minimumVersion or higher or {$otherInfo['implementation']} version "
139 .
"{$otherInfo['minSupported']}.\n\nCheck if you have a"
140 .
" newer PHP executable with a different name.\n\n";
144 Please consider <a
href=
"{$phpInfo['upgradeURL']}">upgrading your
copy of
145 {$phpInfo[
'implementation']}</a>.
146 {$phpInfo[
'implementation']} versions less than {$phpInfo[
'upstreamSupported']} are no
147 longer supported by {$phpInfo[
'vendor']} and will not receive
148 security or bugfix updates.
151 If
for some reason you are unable to upgrade your {$phpInfo[
'implementation']}
version,
152 you will need to <a
href=
"https://www.mediawiki.org/wiki/Download">download</a> an
154 See our <a
href=
"https://www.mediawiki.org/wiki/Compatibility#PHP">compatibility page</a>
155 for details of which versions are compatible with prior versions of {$phpInfo[
'implementation']}.
159 "Supported {$phpInfo['implementation']} versions",
172 $shortText =
"Installing some external dependencies (e.g. via composer) is required.";
174 $longText =
"Error: You are missing some external dependencies. \n"
175 .
"MediaWiki now also has some external dependencies that need to be installed\n"
176 .
"via composer or from a separate git repo. Please see\n"
177 .
"https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries\n"
178 .
"for help on installing the required components.";
182 MediaWiki now also has some external dependencies that need to be installed via
183 composer or from a separate git repo. Please see
184 <a
href=
"https://www.mediawiki.org/wiki/Download_from_Git#Fetch_external_libraries">mediawiki.org</a>
185 for help on installing the required components.
189 $this->
triggerError(
'External dependencies', $shortText, $longText, $longHtml );
197 $missingExtensions =
array();
198 foreach ( $this->functionsExtensionsMapping as $function => $extension ) {
200 $missingExtensions[] = $extension;
204 if ( $missingExtensions ) {
205 $shortText =
"Installing some PHP extensions is required.";
207 $missingExtText =
'';
208 $missingExtHtml =
'';
209 $baseUrl =
'https://secure.php.net';
210 foreach ( $missingExtensions as
$ext ) {
211 $missingExtText .=
" * $ext <$baseUrl/$ext>\n";
212 $missingExtHtml .=
"<li><b>$ext</b> "
213 .
"(<a href=\"$baseUrl/$ext\">more information</a>)</li>";
216 $cliText =
"Error: Missing one or more required components of PHP.\n"
217 .
"You are missing a required extension to PHP that MediaWiki needs.\n"
221 You are missing a required extension to
PHP that
MediaWiki
222 requires to run. Please install:
228 $this->
triggerError(
'Required components', $shortText, $cliText, $longHtml );
236 $protocol =
isset( $_SERVER[
'SERVER_PROTOCOL'] ) ? $_SERVER[
'SERVER_PROTOCOL'] :
'HTTP/1.0';
238 header(
"$protocol 500 MediaWiki configuration Error" );
240 header(
'Cache-control: none' );
241 header(
'Pragma: no-cache' );
255 'resources/assets/mediawiki.png' );
258 header(
'Content-type: text/html; charset=UTF-8' );
260 $finalOutput = <<<HTML
262<html lang=
"en" dir=
"ltr">
264 <meta charset=
"UTF-8" />
266 <
style media=
'screen'>
287 <img src=
"{$encLogo}" alt=
'The MediaWiki logo' />
288 <h1>
MediaWiki {$this->mwVersion}
internal error</h1>
319 if ( $this->format ===
'html' ) {
328 echo
"$finalOutput\n";
342 $phpVersionCheck->setFormat( $format );
343 $phpVersionCheck->setScriptPath( $scriptPath );
344 $phpVersionCheck->checkRequiredPHPVersion();
345 $phpVersionCheck->checkVendorExistence();
346 $phpVersionCheck->checkExtensionExistence();
in the sidebar</td >< td > font color
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a copy
wfEntryPointCheck( $format='text', $scriptPath='/')
Check PHP version and that external dependencies are installed, and display an informative error if e...
triggerError( $title, $shortText, $longText, $longHtml)
Display something vaguely comprehensible in the event of a totally unrecoverable error.
setFormat( $format)
Set the format used for errors.
outputHTMLHeader()
Output headers that prevents error pages to be cached.
setScriptPath( $scriptPath)
Set the script path used for images in HTML-formatted errors.
checkExtensionExistence()
Displays an error, if a PHP extension does not exist.
checkRequiredPHPVersion()
Displays an error, if the installed PHP version does not meet the minimum requirement.
checkVendorExistence()
Displays an error, if the vendor/autoload.php file could not be found.
$functionsExtensionsMapping
getPHPInfo( $impl=false)
Return the version of the installed PHP implementation.
getIndexErrorOutput( $title, $longHtml, $shortText)
Returns an error page, which is suitable for output to the end user via a web browser.
The ContentHandler facility adds support for arbitrary content types on wiki instead of relying on wikitext for everything It was introduced in MediaWiki Each kind of and so on Built in content types as usual *javascript user provided javascript code *json simple implementation for use by etc *css user provided css code *text plain text In PHP
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))
if(!is_readable( $file)) $ext