vrana Wed Aug 4 03:46:36 2004 EDT
Modified files:
/phpdoc/scripts check-references.php
Log:
Parse only first synopsis, ignore methods
http://cvs.php.net/diff.php/phpdoc/scripts/check-references.php?r1=1.1&r2=1.2&ty=u
Index: phpdoc/scripts/check-references.php
diff -u phpdoc/scripts/check-references.php:1.1 phpdoc/scripts/check-references.php:1.2
--- phpdoc/scripts/check-references.php:1.1 Tue Aug 3 13:29:22 2004
+++ phpdoc/scripts/check-references.php Wed Aug 4 03:46:36 2004
@@ -72,12 +72,12 @@
$source_refs = array();
foreach (array_merge(glob("$zend_dir/*.c*"), glob("$phpsrc_dir/ext/*/*.c*"),
glob("$pecl_dir/*/*.c*")) as $filename) {
$file = file_get_contents($filename);
- preg_match_all('~^\\s*(?:ZEND|PHP)_FE\\((\\w+)\\s*,\\s*(\\w+)\\s*[,)]~mS',
$file, $matches, PREG_SET_ORDER);
-
preg_match_all('~^\\s*(?:ZEND|PHP)_FALIAS\\((\\w+)\\s*,[^,]+,\\s*(\\w+)\\s*[,)]~mS',
$file, $matches2, PREG_SET_ORDER);
+ preg_match_all("~^[ \t]*(?:ZEND|PHP)_FE\\((\\w+)\\s*,\\s*(\\w+)\\s*[,)]~mS",
$file, $matches, PREG_SET_ORDER);
+ preg_match_all("~^[
\t]*(?:ZEND|PHP)_FALIAS\\((\\w+)\\s*,[^,]+,\\s*(\\w+)\\s*[,)]~mS", $file, $matches2,
PREG_SET_ORDER);
foreach (array_merge($matches, $matches2) as $val) {
if ($val[2] != "NULL") {
if (empty($number_refs[$val[2]])) {
- echo "! $val[2] in $filename is not defined.\n";
+ echo "! $val[2] from $filename is not defined.\n";
}
$source_refs[strtolower($val[1])] = $number_refs[$val[2]];
}
@@ -86,9 +86,12 @@
// compare with documentation
foreach (glob("$phpdoc_dir/reference/*/functions/*.xml") as $filename) {
- if
(preg_match('~^(.*<methodsynopsis>.*)<methodname>([^<]*)(.*)</methodsynopsis>~sS',
file_get_contents($filename), $matches)) {
+ if
(preg_match('~^(.*<methodsynopsis>.*)<methodname>([^<]+)<(.*)</methodsynopsis>~sSU',
file_get_contents($filename), $matches)) {
$lineno = substr_count($matches[1], "\n");
$function_name = strtolower($matches[2]);
+ if (strpos($function_name, '-') || strpos($function_name, ':')) {
+ continue; // methods are not supported
+ }
$methodsynopsis = $matches[3];
$source_ref =& $source_refs[$function_name];
preg_match_all('~<parameter>(&)?~S', $methodsynopsis, $matches);