Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: makefunclist.php
- ===================================================================
- RCS file: /repository/phpdoc/scripts/quickref/makefunclist.php,v
- retrieving revision 1.7
- diff -u -r1.7 makefunclist.php
- --- makefunclist.php 31 Dec 2008 06:40:11 -0000 1.7
- +++ makefunclist.php 2 May 2009 22:40:10 -0000
- @@ -15,6 +15,7 @@
- +----------------------------------------------------------------------+
- | Authors: Mitja Slenc <mitja@php.net> |
- | Gabor Hojtsy <goba@php.net> |
- + | Kalle Sommer Nielsen <kalle@php.net> |
- +----------------------------------------------------------------------+
- $Id: makefunclist.php,v 1.7 2008/12/31 06:40:11 philip Exp $
- @@ -31,24 +32,63 @@
- }
- closedir($dh);
- } else {
- - die("Unable to find phpdoc XML files");
- + die("Unable to find phpdoc XML files\n");
- }
- sort($FUNCTIONS);
- fwrite(fopen("funclist.txt", "w"), implode("\n", $FUNCTIONS)."\n");
- +function get_filename($file, $ext = ".xml") {
- + if (!defined("PATHINFO_FILENAME")) {
- + $filename = pathinfo($file, PATHINFO_BASENAME);
- + return substr($filename, 0, strpos($filename, $ext));
- + }
- +
- + return pathinfo($file, PATHINFO_FILENAME);
- +}
- +
- function get_function_files($dir) {
- global $FUNCTIONS;
- if ($dh = @opendir($dir . "/functions")) {
- while (($file = readdir($dh)) !== FALSE) {
- if (ereg("\\.xml\$", $file)) {
- - $FUNCTIONS[] = str_replace(array(".xml", "-"), array("", "_"), $file);
- + $FUNCTIONS[] = strtolower(str_replace(array(".xml", "-"), array("", "_"), $file));
- }
- }
- closedir($dh);
- } else {
- - die("Unable to find phpdoc XML files in $dir folder");
- + $dh = @opendir($dir . "/");
- +
- + if ($ch === FALSE) {
- + die("Unable to find phpdoc XML files in $dir folder\n");
- + }
- +
- + while (($file = readdir($dh)) !== FALSE) {
- + if (!ereg("\\.xml\$", $file)) {
- + continue;
- + }
- +
- + $class = get_filename($file);
- +
- + if (!is_dir($dir . "/" . $class . "/")) {
- + continue;
- + }
- +
- + $cdh = @opendir($dir . "/" . $class . "/");
- +
- + if ($cdh === FALSE) {
- + continue;
- + }
- +
- + while (($method = readdir($cdh)) !== FALSE) {
- + if (!ereg("\\.xml\$", $method)) {
- + continue;
- + }
- +
- + $FUNCTIONS[] = strtolower($class . "::" . get_filename($method));
- + }
- + }
- }
- }
- -?>
- +?>
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement