From: Michael Wallner Date: Thu, 1 Mar 2012 13:31:23 +0000 (+0000) Subject: make syntactically valid X-Git-Tag: DEV_2-before-client~33 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=a55d2fffb5a4b7876cb8ec43b00a5162950e9a94 make syntactically valid --- diff --git a/php_http_request_method.c b/php_http_request_method.c index 654ae8c..118721f 100644 --- a/php_http_request_method.c +++ b/php_http_request_method.c @@ -32,7 +32,7 @@ static PHP_HTTP_STRLIST(php_http_request_methods) = PHP_HTTP_STRLIST_ITEM("LOCK") PHP_HTTP_STRLIST_ITEM("UNLOCK") /* WebDAV Versioning - RFC 3253 */ - PHP_HTTP_STRLIST_ITEM("VERSION-CONTROL") + PHP_HTTP_STRLIST_ITEM("VERSION_CONTROL") PHP_HTTP_STRLIST_ITEM("REPORT") PHP_HTTP_STRLIST_ITEM("CHECKOUT") PHP_HTTP_STRLIST_ITEM("CHECKIN") @@ -41,7 +41,7 @@ static PHP_HTTP_STRLIST(php_http_request_methods) = PHP_HTTP_STRLIST_ITEM("UPDATE") PHP_HTTP_STRLIST_ITEM("LABEL") PHP_HTTP_STRLIST_ITEM("MERGE") - PHP_HTTP_STRLIST_ITEM("BASELINE-CONTROL") + PHP_HTTP_STRLIST_ITEM("BASELINE_CONTROL") PHP_HTTP_STRLIST_ITEM("MKACTIVITY") /* WebDAV Access Control - RFC 3744 */ PHP_HTTP_STRLIST_ITEM("ACL") diff --git a/reflection2php.php b/reflection2php.php index 7768eeb..c55eb65 100755 --- a/reflection2php.php +++ b/reflection2php.php @@ -9,7 +9,7 @@ function m($m) { return $n; } function t($p) { - if ($c = $p->getClass()) return $c->getName() . " "; + if ($c = $p->getClass()) return "\\" . $c->getName() . " "; if ($p->isArray()) return "array "; } function c($n, $c) { @@ -59,12 +59,15 @@ printf("\n"); foreach ($ext->getClasses() as $class) { - printf("%s%s %s ", m($class->getModifiers()), $class->isInterface() ? "interface":"class" ,$class->getName()); + if ($class->inNamespace()) { + printf("namespace %s {\n", $class->getNamespaceName()); + } + printf("%s%s %s ", m($class->getModifiers()), $class->isInterface() ? "interface":"class" ,$class->getShortName()); if ($p = $class->getParentClass()) { - printf("extends %s ", $p->getName()); + printf("extends \\%s ", $p->getName()); } if ($i = $class->getInterfaceNames()) { - printf("implements %s ", implode(", ", array_filter($i,function($v){return$v!="Traversable";}))); + printf("implements \\%s ", implode(", \\", array_filter($i,function($v){return$v!="Traversable";}))); } printf("\n{\n"); @@ -102,6 +105,10 @@ foreach ($ext->getClasses() as $class) { } } - printf("}\n\n"); + printf("}\n"); + if ($class->inNamespace()) { + printf("}\n"); + } + printf("\n"); }