cvs: phpdoc /scripts/quickref makefunclist.php manual_en_contents.txt
| From: | Gabor Hojtsy | Date: | Thu, 20 Nov 2003 19:29:49 +0000 |
| Subject: | cvs: phpdoc /scripts/quickref makefunclist.php manual_en_contents.txt | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969356998@lists.php.net to get a copy of this message | ||
goba Thu Nov 20 14:29:49 2003 EDT
Removed files:
/phpdoc/scripts/quickref manual_en_contents.txt
Modified files:
/phpdoc/scripts/quickref makefunclist.php
Log:
use the XML source tree to generate the list of functions instead of requireing a local build of
files (or working with an outdated function list)
Index: phpdoc/scripts/quickref/makefunclist.php
diff -u phpdoc/scripts/quickref/makefunclist.php:1.1 phpdoc/scripts/quickref/makefunclist.php:1.2
--- phpdoc/scripts/quickref/makefunclist.php:1.1 Thu Nov 20 14:03:51 2003
+++ phpdoc/scripts/quickref/makefunclist.php Thu Nov 20 14:29:49 2003
@@ -1,16 +1,34 @@
-<?
+<?php
-$lines=file("manual_en_contents.txt");
-$funcs=array();
+$XML_REF_ROOT = "../../en/reference/";
+$FUNCTIONS = array();
-foreach($lines as $line) {
- $line=trim($line);
- if (substr($line, -4)!=".php") continue;
- if (substr($line, 0, 9)=="function.")
- $funcs[]=str_replace("-", "_", substr($line, 9, -4));
+if ($dh = @opendir($XML_REF_ROOT)) {
+ while (($file = readdir($dh)) !== FALSE) {
+ if (is_dir($XML_REF_ROOT . $file) && !in_array($file, array(".",
"..", "CVS"))) {
+ get_function_files($XML_REF_ROOT . $file);
+ }
+ }
+ closedir($dh);
+} else {
+ die("Unable to find phpdoc XML files");
}
-sort($funcs);
-fwrite(fopen("funclist.txt", "w"), implode("\n",
$funcs)."\n");
+sort($FUNCTIONS);
+fwrite(fopen("funclist.txt", "w"), implode("\n",
$FUNCTIONS)."\n");
+
+function get_function_files($dir) {
+ global $FUNCTIONS;
+ if ($dh = @opendir($dir . "/functions")) {
+ while (($file = readdir($dh)) !== FALSE) {
+ if (fnmatch("*.xml", $file)) {
+ $FUNCTIONS[] = str_replace(array(".xml", "-"),
array("", "_"), $file);
+ }
+ }
+ closedir($dh);
+ } else {
+ die("Unable to find phpdoc XML files in $dir folder");
+ }
+}
?>