Added postredir request options constants
[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 file_exists("$doc/$file") ? preg_match($re, file_get_contents("$doc/$file"), $m) : 0;
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
19 $ext = "http";
20 $doc = "/home/mike/cvs/phpdoc/en/reference/$ext";
21 $ref = new ReflectionExtension($ext);
22
23 printf("Undocumented INI options:\n");
24 foreach ($ref->getINIEntries() as $name => $tmp) {
25 re("configuration.xml", "#<entry>$name</entry>#") or printf("\t%s (%s)\n", $name, $tmp);
26 }
27 printf("\n");
28
29 printf("Undocumented stream filters:\n");
30 foreach (preg_grep("/^$ext\./", stream_get_filters()) as $filter) {
31 fe(sprintf("streamfilters/%s.xml", substr($filter, 5))) or printf("\t%s\n", $filter);
32 }
33 printf("\n");
34
35 printf("Undocumented constants:\n");
36 foreach ($ref->getConstants() as $name => $tmp) {
37 re("constants.xml", "#<constant>$name</constant>#") or printf("\t%s (%s)\n", $name, $tmp);
38 }
39 printf("\n");
40
41
42 printf("Undocumented functions:\n");
43 foreach ($ref->getFunctions() as $func) {
44 /* @var $func ReflectionFunction */
45 fg(sprintf("functions/*/%s.xml", strtr($func->getName(),'_','-'))) or printf("\t%s()\n", $func->getName());
46 }
47 printf("\n");
48
49 printf("Undocumented classes/members:\n");
50 foreach ($ref->getClasses() as $class) {
51 if (substr($class->getName(), -strlen("Exception")) === "Exception") continue;
52 /* @var $class ReflectionClass */
53 fg(sprintf("%s.xml", $class->getName())) or printf(" %s\n", $class->getName());
54 foreach ($class->getConstants() as $name => $tmp) {
55 re($class->getName().".xml", "#>$name<#") or printf("\t%s::%s (%s)\n", $class->getName(), $name, $tmp);
56 }
57 foreach ($class->getProperties() as $prop) {
58 /* @var $prop ReflectionProperty */
59 $prop->isPrivate() or re($class->getName().".xml", "#>{$prop->getName()}<#") or printf("\t%s::$%s\n", $class->getName(), $prop->getName());
60 }
61 foreach ($class->getMethods() as $meth) {
62 /* @var $meth ReflectionMethod */
63 try {
64 $meth->getPrototype();
65 } catch (Exception $ex) {
66 // if getPrototype throws an exception it's definitely not a method declared in an interface
67 $meth->isPrivate() or fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s::%s()\n", $class->getName(), $meth->getName());
68 }
69
70 }
71 printf("\n");
72 }
73 printf("\n");
74
75 ?>