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"));
20 $doc = "/home/mike/cvs/phpdoc/en/reference/$ext";
21 $ref = new ReflectionExtension($ext);
23 $ini = $ref->getINIEntries();
24 printf("Undocumented INI options (%d):\n", count($ini));
25 foreach ($ini as $name => $tmp) {
26 re("configuration.xml", "#<entry>$name</entry>#") or printf("\t%s (%s)\n", $name, $tmp);
30 $flt = preg_grep("/^$ext\./", stream_get_filters());
31 printf("Undocumented stream filters (%d):\n", count($flt));
32 foreach ($flt as $filter) {
33 fe(sprintf("streamfilters/%s.xml", substr($filter, 5))) or printf("\t%s\n", $filter);
37 $con = $ref->getConstants();
38 printf("Undocumented constants (%d):\n", count($con));
39 foreach ($con as $name => $tmp) {
40 re("constants.xml", "#<constant>$name</constant>#") or printf("\t%s (%s)\n", $name, $tmp);
45 printf("Undocumented functions:\n");
46 foreach ($ref->getFunctions() as $func) {
47 /* @var $func ReflectionFunction */
48 fg(sprintf("functions/*/%s.xml", strtr($func->getName(),'_','-'))) or printf("\t%s()\n", $func->getName());
52 printf("Undocumented classes/members:\n");
53 foreach ($ref->getClasses() as $class) {
54 if (substr($class->getName(), -strlen("Exception")) === "Exception") continue;
55 /* @var $class ReflectionClass */
56 fg(sprintf("%s.xml", $class->getName())) or printf(" %s\n", $class->getName());
57 foreach ($class->getConstants() as $name => $tmp) {
58 re($class->getName().".xml", "#>$name<#") or printf("\t%s::%s (%s)\n", $class->getName(), $name, $tmp);
60 foreach ($class->getProperties() as $prop) {
61 /* @var $prop ReflectionProperty */
62 $prop->isPrivate() or re($class->getName().".xml", "#>{$prop->getName()}<#") or printf("\t%s::$%s\n", $class->getName(), $prop->getName());
64 foreach ($class->getMethods() as $meth) {
65 /* @var $meth ReflectionMethod */
67 $meth->getPrototype();
68 } catch (Exception
$ex) {
69 // if getPrototype throws an exception it's definitely not a method declared in an interface
70 $meth->isPrivate() or fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s::%s()\n", $class->getName(), $meth->getName());