bjori           Thu Apr 16 13:41:25 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src    run-tests.php 
  Log:
  MFH: Make it possible to run on 5.2
  
  
http://cvs.php.net/viewvc.cgi/php-src/run-tests.php?r1=1.226.2.37.2.35.2.63&r2=1.226.2.37.2.35.2.64&diff_format=u
Index: php-src/run-tests.php
diff -u php-src/run-tests.php:1.226.2.37.2.35.2.63 
php-src/run-tests.php:1.226.2.37.2.35.2.64
--- php-src/run-tests.php:1.226.2.37.2.35.2.63  Thu Mar 12 20:42:46 2009
+++ php-src/run-tests.php       Thu Apr 16 13:41:25 2009
@@ -24,7 +24,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: run-tests.php,v 1.226.2.37.2.35.2.63 2009/03/12 20:42:46 zoe Exp $ */
+/* $Id: run-tests.php,v 1.226.2.37.2.35.2.64 2009/04/16 13:41:25 bjori Exp $ */
 
 /* Sanity check to ensure that pcre extension needed by this script is 
available.
  * In the event it is not, print a nice error message indicating that this 
script will
@@ -59,11 +59,26 @@
 exit;
 }
 
-// __DIR__ is available from 5.3.0
+// Version constants only available as of 5.2.8
+if (!defined("PHP_VERSION_ID")) {
+       list($major, $minor, $bug) = explode(".", phpversion(), 3);
+       $bug = (int)$bug; // Many distros make up their own versions
+       if ($bug < 10) {
+               $bug = "0$bug";
+       }
+
+       define("PHP_VERSION_ID", "{$major}0{$minor}$bug");
+       define("PHP_MAJOR_VERSION", $major);
+}
+
+// __DIR__ and FILE_BINARY is available from 5.3.0
 if (PHP_VERSION_ID < 50300) {
        define('__DIR__', realpath(dirname(__FILE__)));
+       define('FILE_BINARY', 0);
 }
 
+
+
 // If timezone is not set, use UTC.
 if (ini_get('date.timezone') == '') {
        date_default_timezone_set('UTC');
@@ -617,7 +632,7 @@
                                        $html_output = is_resource($html_file);
                                        break;
                                case '--version':
-                                       echo '$Revision: 1.226.2.37.2.35.2.63 
$' . "\n";
+                                       echo '$Revision: 1.226.2.37.2.35.2.64 
$' . "\n";
                                        exit(1);
 
                                default:



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to