d65effa1ed37733d3417192c4f976dfc532375d2
[m6w6/ext-http] / scripts / check_docs.php
1 #!/usr/bin/env php
2 <?php
3 // $Id$
4
5 function re($file, $re, &$m=NULL) {
6 global $doc;
7 return preg_match($re, file_get_contents("$doc/$file"), $m);
8 }
9 function fe($file) {
10 global $doc;
11 return file_exists("$doc/$file");
12 }
13 function fg($path, &$g=NULL) {
14 global $doc;
15 return count($g = glob("$doc/$path"));
16 }
17
18 $doc = "/home/mike/cvs/phpdoc/en/reference/http";
19 $ext = new ReflectionExtension("http");
20
21 printf("Undocumented INI options:\n");
22 foreach ($ext->getINIEntries() as $name => $tmp) {
23 re("configuration.xml", "#<entry>$name</entry>#") or printf("\t%s (%s)\n", $name, $tmp);
24 }
25 printf("\n");
26
27 printf("Undocumented constants:\n");
28 foreach ($ext->getConstants() as $name => $tmp) {
29 re("constants.xml", "#<constant>$name</constant>#") or printf("\t%s (%s)\n", $name, $tmp);
30 }
31 printf("\n");
32
33
34 printf("Undocumented functions:\n");
35 foreach ($ext->getFunctions() as $func) {
36 /* @var $func ReflectionFunction */
37 fg(sprintf("functions/*/%s.xml", strtr($func->getName(),'_','-'))) or printf("\t%s()\n", $func->getName());
38 }
39 printf("\n");
40
41 printf("Undocumented classes/methods:\n");
42 foreach ($ext->getClasses() as $class) {
43 if (substr($class->getName(), -strlen("Exception")) === "Exception") continue;
44 /* @var $class ReflectionClass */
45 fg(sprintf("%s.xml", $class->getName())) or printf(" %s\n", $class->getName());
46 foreach ($class->getMethods() as $meth) {
47 fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s::%s()\n", $class->getName(), $meth->getName());
48 }
49 printf("\n");
50 }
51 printf("\n");
52
53 ?>