Degrade gracefully: disable PHPTal-based skins on PHP 5.0 or higher.
authorBrion Vibber <brion@users.mediawiki.org>
Fri, 6 Aug 2004 09:46:25 +0000 (09:46 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Fri, 6 Aug 2004 09:46:25 +0000 (09:46 +0000)
Notify the user about this at setup time.

config/index.php
includes/DefaultSettings.php

index e6fb49c..f72d4dc 100644 (file)
@@ -189,7 +189,16 @@ $wgConfiguring = true;
 $conf = new ConfigData;
 
 install_version_checks();
-print "<li>PHP " . phpversion() . " ok</li>\n";
+
+print "<li>PHP " . phpversion() . ": ";
+if( version_compare( phpversion(), "5.0", "lt" ) ) {
+       print "ok";
+} else {
+       print " <b>the MonoBook skin will be disabled due to an incompatibility
+               between the PHPTAL template library and PHP 5</b>. The wiki should
+               function normally, but with the older look and feel.";
+}
+print "</li>\n";
 
 if( ini_get( "safe_mode" ) ) {
        ?>
index bdfd264..bd10946 100644 (file)
@@ -351,7 +351,9 @@ $wgImageMagickConvertCommand    = '/usr/bin/convert';
 # PHPTal is a library for page templates. MediaWiki includes
 # a recent PHPTal distribution. It is required to use the
 # Monobook (default) skin.
-$wgUsePHPTal = true;
+#
+# Currently it does not work on PHP5.
+$wgUsePHPTal = version_compare( phpversion(), "5.0", "lt" );
 
 if( !isset( $wgCommandLineMode ) ) {
        $wgCommandLineMode = false;