cvs: pear /PHP_Archive/tests pearindex.php
| From: | Greg Beaver | Date: | Fri, 15 Apr 2005 04:32:08 +0000 |
| Subject: | cvs: pear /PHP_Archive/tests pearindex.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-31172@lists.php.net to get a copy of this message | ||
cellog Fri Apr 15 00:32:08 2005 EDT
Modified files:
/pear/PHP_Archive/tests pearindex.php
Log:
add phpversion() check
add (disabled) debugging error handler
http://cvs.php.net/diff.php/pear/PHP_Archive/tests/pearindex.php?r1=1.4&r2=1.5&ty=u
Index: pear/PHP_Archive/tests/pearindex.php
diff -u pear/PHP_Archive/tests/pearindex.php:1.4 pear/PHP_Archive/tests/pearindex.php:1.5
--- pear/PHP_Archive/tests/pearindex.php:1.4 Thu Apr 14 00:08:09 2005
+++ pear/PHP_Archive/tests/pearindex.php Fri Apr 15 00:32:08 2005
@@ -1,4 +1,27 @@
<?php
+if (version_compare(phpversion(), '5.0.0', '<')) {
+ die('Error - PEAR requires streams support of PHP 5.0.0 or newer');
+}
+function testerr($type, $m, $file, $line)
+{
+ if ($type == E_STRICT) return;
+ $errortype = array (
+ E_ERROR => "Error",
+ E_WARNING => "Warning",
+ E_PARSE => "Parsing Error",
+ E_NOTICE => "Notice",
+ E_CORE_ERROR => "Core Error",
+ E_CORE_WARNING => "Core Warning",
+ E_COMPILE_ERROR => "Compile Error",
+ E_COMPILE_WARNING => "Compile Warning",
+ E_USER_ERROR => "User Error",
+ E_USER_WARNING => "User Warning",
+ E_USER_NOTICE => "User Notice"
+ );
+ $errortype = $errortype[$type];
+ print "$errortype: $m in $file on $line\n";
+}
+//set_error_handler('testerr');
PHP_Archive::cacheStat('PEAR.phar');
// {{{ usage()