5 function re($file, $re, &$m=NULL) {
7 return file_exists("$doc/$file") ?
preg_match($re, file_get_contents("$doc/$file"), $m) : 0;
11 return file_exists("$doc/$file");
13 function fg($path, &$g=NULL) {
15 return count($g = glob("$doc/$path"));
19 $doc = "/home/mike/Development/src/php/phpdoc/en/trunk/reference/$ext";
20 $ref = new ReflectionExtension($ext);
22 printf("Undocumented INI options:\n");
23 foreach ($ref->getINIEntries() as $name => $tmp) {
24 re("configuration.xml", "#<entry>$name</entry>#") or printf("\t%s (%s)\n", $name, $tmp);
28 printf("Undocumented stream filters:\n");
29 foreach (preg_grep("/^$ext\./", stream_get_filters()) as $filter) {
30 fe(sprintf("streamfilters/%s.xml", substr($filter, 5))) or printf("\t%s\n", $filter);
34 printf("Undocumented constants:\n");
35 foreach ($ref->getConstants() as $name => $tmp) {
36 re("constants.xml", "#<constant>$name</constant>#") or printf("\t%s (%s)\n", $name, $tmp);
41 printf("Undocumented functions:\n");
42 foreach ($ref->getFunctions() as $func) {
43 /* @var $func ReflectionFunction */
44 fg(sprintf("functions/*/%s.xml", strtr($func->getName(),'_','-'))) or printf("\t%s()\n", $func->getName());
48 printf("Undocumented classes/members:\n");
49 foreach ($ref->getClasses() as $class) {
50 if (substr($class->getName(), -strlen("Exception")) === "Exception") continue;
51 /* @var $class ReflectionClass */
52 fg(sprintf("%s.xml", $class->getName())) or printf(" %s\n", $class->getName());
53 foreach ($class->getConstants() as $name => $tmp) {
54 re($class->getName().".xml", "#>$name<#") or printf("\t%s::%s (%s)\n", $class->getName(), $name, $tmp);
56 foreach ($class->getProperties() as $prop) {
57 /* @var $prop ReflectionProperty */
58 $prop->isPrivate() or re($class->getName().".xml", "#>{$prop->getName()}<#") or printf("\t%s::$%s\n", $class->getName(), $prop->getName());
60 foreach ($class->getMethods() as $meth) {
61 /* @var $meth ReflectionMethod */
63 $meth->getPrototype();
64 } catch (Exception
$ex) {
65 // if getPrototype throws an exception it's definitely not a method declared in an interface
66 $meth->isPrivate() or fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s%s::%s()\n", $meth->isStatic()?
'static ':'', $class->getName(), $meth->getName());
74 printf("Undocumented request options:\n");
75 if (is_file($file = dirname(__FILE__
)."/../http_request_api.c")) {
76 if (preg_match_all("#(?:http_request_option\(request,\s*options,\s*\")(\w+)(?=\")#", file_get_contents($file), $match)) {
77 foreach ($match[1] as $opt) {
78 re("request-options.xml", "#<term>\s*$opt#") or printf("\t%s\n", $opt);
81 printf("List of request option entities:\n");
82 foreach ($match[1] as $opt) {
83 printf("\t<!ENTITY link.http.request.option.%1\$s '<link linkend=\"http.request.option.%1\$s\"><literal>%1\$s</literal> request option</link>'>\n", $opt);
87 printf("\thttp_request_api.c not found\n");