X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Fcheck_docs.php;h=b6044fda4dee2ee928e219b3b4eb45aac4f5dafd;hb=7367aec9774abffe25f7bf688ff16ff844bf776d;hp=d65effa1ed37733d3417192c4f976dfc532375d2;hpb=3837de728f09505d2bed811d0b26819ee719c3d9;p=m6w6%2Fext-http
diff --git a/scripts/check_docs.php b/scripts/check_docs.php
index d65effa..b6044fd 100755
--- a/scripts/check_docs.php
+++ b/scripts/check_docs.php
@@ -4,7 +4,7 @@
function re($file, $re, &$m=NULL) {
global $doc;
- return preg_match($re, file_get_contents("$doc/$file"), $m);
+ return file_exists("$doc/$file") ? preg_match($re, file_get_contents("$doc/$file"), $m) : 0;
}
function fe($file) {
global $doc;
@@ -15,36 +15,58 @@ function fg($path, &$g=NULL) {
return count($g = glob("$doc/$path"));
}
-$doc = "/home/mike/cvs/phpdoc/en/reference/http";
-$ext = new ReflectionExtension("http");
+
+$ext = "http";
+$doc = "/home/mike/cvs/phpdoc/en/reference/$ext";
+$ref = new ReflectionExtension($ext);
printf("Undocumented INI options:\n");
-foreach ($ext->getINIEntries() as $name => $tmp) {
+foreach ($ref->getINIEntries() as $name => $tmp) {
re("configuration.xml", "#$name#") or printf("\t%s (%s)\n", $name, $tmp);
}
printf("\n");
+printf("Undocumented stream filters:\n");
+foreach (preg_grep("/^$ext\./", stream_get_filters()) as $filter) {
+ fe(sprintf("streamfilters/%s.xml", substr($filter, 5))) or printf("\t%s\n", $filter);
+}
+printf("\n");
+
printf("Undocumented constants:\n");
-foreach ($ext->getConstants() as $name => $tmp) {
+foreach ($ref->getConstants() as $name => $tmp) {
re("constants.xml", "#$name#") or printf("\t%s (%s)\n", $name, $tmp);
}
printf("\n");
printf("Undocumented functions:\n");
-foreach ($ext->getFunctions() as $func) {
+foreach ($ref->getFunctions() as $func) {
/* @var $func ReflectionFunction */
fg(sprintf("functions/*/%s.xml", strtr($func->getName(),'_','-'))) or printf("\t%s()\n", $func->getName());
}
printf("\n");
-printf("Undocumented classes/methods:\n");
-foreach ($ext->getClasses() as $class) {
+printf("Undocumented classes/members:\n");
+foreach ($ref->getClasses() as $class) {
if (substr($class->getName(), -strlen("Exception")) === "Exception") continue;
/* @var $class ReflectionClass */
fg(sprintf("%s.xml", $class->getName())) or printf(" %s\n", $class->getName());
+ foreach ($class->getConstants() as $name => $tmp) {
+ re($class->getName().".xml", "#>$name<#") or printf("\t%s::%s (%s)\n", $class->getName(), $name, $tmp);
+ }
+ foreach ($class->getProperties() as $prop) {
+ /* @var $prop ReflectionProperty */
+ $prop->isPrivate() or re($class->getName().".xml", "#>{$prop->getName()}<#") or printf("\t%s::$%s\n", $class->getName(), $prop->getName());
+ }
foreach ($class->getMethods() as $meth) {
- fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s::%s()\n", $class->getName(), $meth->getName());
+ /* @var $meth ReflectionMethod */
+ try {
+ $meth->getPrototype();
+ } catch (Exception $ex) {
+ // if getPrototype throws an exception it's definitely not a method declared in an interface
+ $meth->isPrivate() or fg(sprintf("%s/%s.xml", $class->getName(), strtr(trim($meth->getName(),'_'),'_','-'))) or printf("\t%s::%s()\n", $class->getName(), $meth->getName());
+ }
+
}
printf("\n");
}