cvs: pear /PHP_CompatInfo/scripts updateVersionInfo.php
| From: | Laurent Laville | Date: | Thu, 15 Jun 2006 21:38:42 +0000 |
| Subject: | cvs: pear /PHP_CompatInfo/scripts updateVersionInfo.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-40736@lists.php.net to get a copy of this message | ||
farell Thu Jun 15 21:38:42 2006 UTC
Modified files:
/pear/PHP_CompatInfo/scripts updateVersionInfo.php
Log:
- more PEAR CS (about global variables)
- adds PHP 3 functions
- fixes missing functions and extensions
- add header comment block (QA)
http://cvs.php.net/viewcvs.cgi/pear/PHP_CompatInfo/scripts/updateVersionInfo.php?r1=1.1&r2=1.2&diff_format=u
Index: pear/PHP_CompatInfo/scripts/updateVersionInfo.php
diff -u pear/PHP_CompatInfo/scripts/updateVersionInfo.php:1.1
pear/PHP_CompatInfo/scripts/updateVersionInfo.php:1.2
--- pear/PHP_CompatInfo/scripts/updateVersionInfo.php:1.1 Mon Feb 21 06:04:16 2005
+++ pear/PHP_CompatInfo/scripts/updateVersionInfo.php Thu Jun 15 21:38:42 2006
@@ -1,11 +1,28 @@
<?php
-require 'c:\web\php-cvs\pear\PHP_CompatInfo\data\func_array.php';
+/**
+ * The functions array script generator.
+ *
+ * Sources come from :
+ * - http://cvs.php.net/viewcvs.cgi/phpdoc/xsl/version.xml?revision=1.19&view=markup
+ * - http://cvs.php.net/viewcvs.cgi/phpdoc/funclist.txt?revision=1.35&view=markup
+ *
+ * @version $Id: updateVersionInfo.php,v 1.2 2006/06/15 21:38:42 farell Exp $
+ * @author Davey Shafik <davey@php.net>
+ * @author Laurent Laville <pear@laurent-laville.org>
+ * @package PHP_CompatInfo
+ * @ignore
+ */
-$xml = simplexml_load_file('c:\web\php-cvs\phpdoc\xsl\version.xml');
+@include_once 'D:\php\pear\PHP_CompatInfo\CompatInfo\func_array.php';
+
+$xml = simplexml_load_file('D:\php\pear\PHP_CompatInfo\scripts\version.xml');
foreach ($xml->function as $function) {
$name = (string) $function['name'];
$version = false;
+ if (!isset($funcs[$name]['ext'])) {
+ $funcs[$name]['ext'] = ' ';
+ }
if (preg_match('/= (\d\.\d\.\d)/', (string) $function['from'], $matches)) {
$funcs[$name]['init'] = $matches[1];
continue;
@@ -28,44 +45,52 @@
}
}
-$txt = file('c:\web\php-cvs\phpdoc\funclist.txt');
+$txt = file('D:\php\pear\PHP_CompatInfo\scripts\funclist.txt');
-for ($i = 0; $i < sizeof($txt); $i++) {
+$i = 0;
+$limit = count($txt);
+
+while ($i < $limit) {
if (strpos($txt[$i], '#') !== FALSE) {
if (strpos(strtolower($txt[$i]), 'zend') !== FALSE) {
$module = 'zend';
} else {
- preg_match('@# php-src/(ext|sapi)/(.*?)/.*@', $txt[$i], $matches);
- $module = $matches[1] .'_'. $matches[2];
+ $found = preg_match('@# php-src/(ext|sapi)/(.*?)/.*@', $txt[$i], $matches);
+ if ($found) {
+ $module = $matches[1] .'_'. $matches[2];
+ } else {
+ $module = ' ';
+ }
}
$i += 1;
- while (strpos($txt[$i], '#') === FALSE && ($i < sizeof($txt))) {
- if ($txt[$i] != '') {
+ while ($i < $limit) {
+ if (strpos($txt[$i], '#') === FALSE) {
$name = trim($txt[$i]);
+ if (empty($name)) {
+ break;
+ }
if (!isset($funcs[$name]['ext'])) {
$funcs[$name]['ext'] = $module;
}
}
$i += 1;
}
- $i -= 1;
}
+ $i += 1;
}
foreach ($funcs as $key => $function) {
if (!isset($function['init']) || ($function['init'] == '')) {
$funcs[$key]['init'] = '5-dev';
}
- if ($function['init']{0} == 3) {
- unset($funcs[$key]);
- }
}
unset($funcs[""]);
-file_put_contents('c:\web\php-cvs\pear\PHP_CompatInfo\data\func_array.php',
+file_put_contents('D:\php\pear\PHP_CompatInfo\CompatInfo\func_array.php',
"<?php
# This file is generated!
-\$funcs = " .var_export($funcs, true). "
+\$GLOBALS['_PHP_COMPATINFO_FUNCS'] = " .var_export($funcs, true). "
?>");
-?>
\ No newline at end of file
+?>
+