Advertisement
Guest User

Untitled

a guest
Feb 12th, 2012
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. Index: makefunclist.php
  2. ===================================================================
  3. RCS file: /repository/phpdoc/scripts/quickref/makefunclist.php,v
  4. retrieving revision 1.7
  5. diff -u -r1.7 makefunclist.php
  6. --- makefunclist.php 31 Dec 2008 06:40:11 -0000 1.7
  7. +++ makefunclist.php 2 May 2009 22:40:10 -0000
  8. @@ -15,6 +15,7 @@
  9. +----------------------------------------------------------------------+
  10. | Authors: Mitja Slenc <mitja@php.net> |
  11. | Gabor Hojtsy <goba@php.net> |
  12. + | Kalle Sommer Nielsen <kalle@php.net> |
  13. +----------------------------------------------------------------------+
  14.  
  15. $Id: makefunclist.php,v 1.7 2008/12/31 06:40:11 philip Exp $
  16. @@ -31,24 +32,63 @@
  17. }
  18. closedir($dh);
  19. } else {
  20. - die("Unable to find phpdoc XML files");
  21. + die("Unable to find phpdoc XML files\n");
  22. }
  23.  
  24. sort($FUNCTIONS);
  25. fwrite(fopen("funclist.txt", "w"), implode("\n", $FUNCTIONS)."\n");
  26.  
  27. +function get_filename($file, $ext = ".xml") {
  28. + if (!defined("PATHINFO_FILENAME")) {
  29. + $filename = pathinfo($file, PATHINFO_BASENAME);
  30. + return substr($filename, 0, strpos($filename, $ext));
  31. + }
  32. +
  33. + return pathinfo($file, PATHINFO_FILENAME);
  34. +}
  35. +
  36. function get_function_files($dir) {
  37. global $FUNCTIONS;
  38. if ($dh = @opendir($dir . "/functions")) {
  39. while (($file = readdir($dh)) !== FALSE) {
  40. if (ereg("\\.xml\$", $file)) {
  41. - $FUNCTIONS[] = str_replace(array(".xml", "-"), array("", "_"), $file);
  42. + $FUNCTIONS[] = strtolower(str_replace(array(".xml", "-"), array("", "_"), $file));
  43. }
  44. }
  45. closedir($dh);
  46. } else {
  47. - die("Unable to find phpdoc XML files in $dir folder");
  48. + $dh = @opendir($dir . "/");
  49. +
  50. + if ($ch === FALSE) {
  51. + die("Unable to find phpdoc XML files in $dir folder\n");
  52. + }
  53. +
  54. + while (($file = readdir($dh)) !== FALSE) {
  55. + if (!ereg("\\.xml\$", $file)) {
  56. + continue;
  57. + }
  58. +
  59. + $class = get_filename($file);
  60. +
  61. + if (!is_dir($dir . "/" . $class . "/")) {
  62. + continue;
  63. + }
  64. +
  65. + $cdh = @opendir($dir . "/" . $class . "/");
  66. +
  67. + if ($cdh === FALSE) {
  68. + continue;
  69. + }
  70. +
  71. + while (($method = readdir($cdh)) !== FALSE) {
  72. + if (!ereg("\\.xml\$", $method)) {
  73. + continue;
  74. + }
  75. +
  76. + $FUNCTIONS[] = strtolower($class . "::" . get_filename($method));
  77. + }
  78. + }
  79. }
  80. }
  81.  
  82. -?>
  83. +?>
  84. \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement