cvs: pear /PHP_CompatInfo CompatInfo.php

From: Date: Mon, 21 Feb 2005 06:03:56 +0000
Subject: cvs: pear /PHP_CompatInfo CompatInfo.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-29602@lists.php.net to get a copy of this message
davey Mon Feb 21 01:03:56 2005 EDT Modified files: /pear/PHP_CompatInfo CompatInfo.php Log: * Added apidocs for includes * Removed $php4_version and $php5_version * removed the PHP5RC2 hack * updated to handle new shorter array keys init and ext instead of version_init and extension http://cvs.php.net/diff.php/pear/PHP_CompatInfo/CompatInfo.php?r1=1.12&r2=1.13&ty=u Index: pear/PHP_CompatInfo/CompatInfo.php diff -u pear/PHP_CompatInfo/CompatInfo.php:1.12 pear/PHP_CompatInfo/CompatInfo.php:1.13 --- pear/PHP_CompatInfo/CompatInfo.php:1.12 Tue Jan 11 00:14:46 2005 +++ pear/PHP_CompatInfo/CompatInfo.php Mon Feb 21 01:03:55 2005 @@ -16,33 +16,24 @@ // | Authors: Davey Shafik <davey@php.net> | // +----------------------------------------------------------------------+ // -// $Id: CompatInfo.php,v 1.12 2005/01/11 05:14:46 davey Exp $ +// $Id: CompatInfo.php,v 1.13 2005/02/21 06:03:55 davey Exp $ /** * Check Compatibility of chunk of PHP code * @package PHP_CompatInfo * @category PHP */ - + /** - * Current PHP4 Version (used for -dev version) - * @global string $php4_version + * An array of function init versions and extension */ -$php4_version = '4.3.6'; +require_once 'PHP/data/func_array.php'; /** - * Current PHP5 Version (used for -dev version) - * @global string $php5_version + * An array of constants and their init versions */ -$php5_version = '5.0.0'; - -require_once 'PHP/data/func_array.php'; require_once 'PHP/data/const_array.php'; -// Seems to be a bug in PHP5RC2, $GLOBALS['const'] not reg'd -$GLOBALS['const'] = $const; -$GLOBALS['funcs'] = $funcs; - /** * Check Compatibility of chunk of PHP code * @@ -330,7 +321,7 @@ T_TRY => 'try', T_CLONE => 'clone', T_INTERFACE => 'interface', - T_IMPLEMENTS => 'implements' + T_IMPLEMENTS => 'implements', ); foreach ($php5_tokens as $php5_token => $value) { @@ -376,19 +367,22 @@ foreach($functions as $name) { if (isset($GLOBALS['funcs'][$name]) && (!in_array($name,$udf) && (!in_array($name,$options['ignore_functions'])))) { if ($options['debug'] == true) { - $functions_version[$GLOBALS['funcs'][$name]['version_init']][] = array('function' => $name, 'extension' => $GLOBALS['funcs'][$name]['extension']); + $functions_version[$GLOBALS['funcs'][$name]['init']][] = array('function' => $name, 'extension' => $GLOBALS['funcs'][$name]['extension']); } - $cmp = version_compare($latest_version,$GLOBALS['funcs'][$name]['version_init']); + $cmp = version_compare($latest_version,$GLOBALS['funcs'][$name]['init']); if ((int)$cmp === -1) { - $latest_version = $GLOBALS['funcs'][$name]['version_init']; + $latest_version = $GLOBALS['funcs'][$name]['init']; } - if ((!empty($GLOBALS['funcs'][$name]['extension'])) && ($GLOBALS['funcs'][$name]['extension'] != 'ext_standard') && ($GLOBALS['funcs'][$name]['extension'] != 'zend')) { - if(!in_array(substr($GLOBALS['funcs'][$name]['extension'],4),$extensions) || !in_array(substr($GLOBALS['funcs'][$name]['extension'], 5),$extensions)) { - $extension = substr($GLOBALS['funcs'][$name]['extension'],4); - if ($extension{0} != '_') { - $extensions[] = $extension; - } else { - $extensions[] = substr($extension, 1); + if ((!empty($GLOBALS['funcs'][$name]['ext'])) && ($GLOBALS['funcs'][$name]['ext'] != 'ext_standard') && ($GLOBALS['funcs'][$name]['ext'] != 'zend')) { + $extension = substr($GLOBALS['funcs'][$name]['ext'],4); + if ($extension{0} != '_') { + if(!in_array($ext,$extensions)) { + $extensions[] = $ext; + } + } else { + $ext = substr($ext, 1); + if(!in_array($ext,$extensions)) { + $extensions[] = $ext; } } } @@ -397,9 +391,9 @@ $constants = array_unique($constants); foreach($constants as $constant) { - $cmp = version_compare($latest_version,$GLOBALS['const'][$constant]['version_init']); + $cmp = version_compare($latest_version,$GLOBALS['const'][$constant]['init']); if ((int)$cmp === -1) { - $latest_version = $GLOBALS['const'][$constant]['version_init']; + $latest_version = $GLOBALS['const'][$constant]['init']; } if(!in_array($GLOBALS['const'][$constant]['name'],$constant_names)) { $constant_names[] = $GLOBALS['const'][$constant]['name'];

« previous php.pear.cvs (#29602) next »