cvs: phpruntests /src run-tests.php
| From: | Georg Gradwohl | Date: | Tue, 12 May 2009 16:05:00 +0000 |
| Subject: | cvs: phpruntests /src run-tests.php | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-57730@lists.php.net to get a copy of this message | ||
g2 Tue May 12 16:05:00 2009 UTC
Modified files:
/phpruntests/src run-tests.php
Log:
phpruntests: improved version-check in the start-script
http://cvs.php.net/viewvc.cgi/phpruntests/src/run-tests.php?r1=1.2&r2=1.3&diff_format=u
Index: phpruntests/src/run-tests.php
diff -u phpruntests/src/run-tests.php:1.2 phpruntests/src/run-tests.php:1.3
--- phpruntests/src/run-tests.php:1.2 Thu May 7 20:58:45 2009
+++ phpruntests/src/run-tests.php Tue May 12 16:05:00 2009
@@ -8,34 +8,13 @@
* check the version of the running php-executable and
* ensure that is 5.3 or higher
*/
-$v = phpversion();
-
-$major = substr($v, 0, 1);
-$minor = substr($v, 2, 1);
-
-$isVersionOk = false;
-
-if ($major > 5) {
- $isVersionOk = true;
-
-} elseif ($major == 5) {
-
- if ($minor >= 3) {
- $isVersionOk = true;
- }
+if (version_compare(PHP_VERSION, '5.3.0RC1', '<')) {
+ die('This version of run-tests requires PHP 5.3RC1 or higher, you are running ' .
PHP_VERSION . "\n");
}
+require_once dirname(__FILE__) . '/rtAutoload.php';
-if ($isVersionOk) {
-
- require_once dirname(__FILE__) . '/rtAutoload.php';
-
- $phpTestRun = new rtPhpTestRun($argv);
- $phpTestRun->run();
-
-} else {
-
- die("This version of run-tests requires PHP 5.3 or higher.\nYou can check your current
version by executing 'php -v' from the command line.\n");
-}
+$phpTestRun = new rtPhpTestRun($argv);
+$phpTestRun->run();
?>