* Friendlier check for PHP 5 in command-line scripts; it's common for parallel
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 15 Oct 2006 20:12:08 +0000 (20:12 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 15 Oct 2006 20:12:08 +0000 (20:12 +0000)
  PHP 4 and 5 installations to interfere on the command-line.

RELEASE-NOTES
maintenance/commandLine.inc

index ca0aa6b..98a9ece 100644 (file)
@@ -47,6 +47,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Added global $wgStyleVersion to centralize bumping CSS and JS file versions
   for cache-friendly style and script updating
 * (bug 7562) Fix non-ASCII namespaces on Windows/XAMPP servers
+* Friendlier check for PHP 5 in command-line scripts; it's common for parallel
+  PHP 4 and 5 installations to interfere on the command-line.
 
 
 == Languages updated ==
index 2549057..13e2ef5 100644 (file)
@@ -14,6 +14,15 @@ if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
        exit();
 }
 
+if( version_compare( PHP_VERSION, '5.0.0' ) < 0 ) {
+       print "Sorry! This version of MediaWiki requires PHP 5; you are running " .
+               PHP_VERSION . ".\n\n" .
+               "If you are sure you already have PHP 5 installed, it may be " .
+               "installed\n" .
+               "in a different path from PHP 4. Check with your system administrator.\n";
+       die( -1 );
+}
+
 define('MEDIAWIKI',true);
 
 # Process command line arguments