From 19ad90d1f12058345ceb651b4bed6ff0f298dd08 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 5 Oct 2005 15:36:49 +0000 Subject: [PATCH] - doc: generate a TOC --- docs/functions.html | 240 ++++++++++++++++++++++++++++++++++++++++++-- funcsummary.php | 50 ++++++++- 2 files changed, 280 insertions(+), 10 deletions(-) diff --git a/docs/functions.html b/docs/functions.html index 8979c25..1503d1a 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -43,9 +43,29 @@ p br, pre code br { display: block; } + .toc { + position: absolute; + top: 10px; + right: 10px; + width: 300px; + height: 95%; + overflow: scroll; + font-size: .9em; + } + body>div.toc { + position: fixed; + } + .toc ul { + padding-left: 15px; + margin-left: 0; + } + .toc li { + padding: 0; + margin: 0; + } -

http_functions.c

+

http_functions.c

string http_date([int timestamp])

Compose a valid HTTP date regarding RFC 822/1123
looking like: "Wed, 22 Dec 2004 11:34:47 GMT"

@@ -307,7 +327,7 @@ See http_get() for a full list of available options.

Unregister a previously registered custom request method.

Expects either the request method name or ID.

Returns TRUE on success, or FALSE on failure.

-

long http_request_method_exists(mixed method)

+

int http_request_method_exists(mixed method)

Check if a request method is registered (or available by default).

Expects either the request method name or ID as parameter.

Returns TRUE if the request method is known, else FALSE.

@@ -318,7 +338,7 @@ See http_get() for a full list of available options.

string http_build_query(mixed formdata [, string prefix[, string arg_separator]])

Generates a form-encoded query string from an associative array or object.


-

http_message_object.c

+

http_message_object.c

HttpMessage

void HttpMessage::__construct([string message])

Instantiate a new HttpMessage object.

@@ -407,7 +427,7 @@ This provides limited functionality compared to HttpRequest and HttpResponse.

Returns the full message as string.


-

http_request_object.c

+

http_request_object.c

HttpRequest

void HttpRequest::__construct([string url[, int request_method = HTTP_METH_GET]])

Instantiate a new HttpRequest object.

@@ -647,7 +667,7 @@ HttpMalformedHeaderException, HttpEncodingException.


-

http_requestpool_object.c

+

http_requestpool_object.c

HttpRequestPool

void HttpRequestPool::__construct([HttpRequest request[, ...]])

Instantiate a new HttpRequestPool object. An HttpRequestPool is
@@ -704,7 +724,7 @@ HttpRequestPoolException, HttpMalformedHeaderException.

void HttpRequestPool::rewind()

Implements Iterator::rewind().


-

http_response_object.c

+

http_response_object.c

static bool HttpResponse::setHeader(string name, mixed value[, bool replace = true])

Send an HTTP header.

Expects a string parameter containing the name of the header and a mixed
@@ -760,7 +780,7 @@ contain a primary and secondary content type part.

static string HttpResponse::getContentType()

Get current Content-Type header setting.

Returns the currently set content type as string.

-

static string HttpResponse::guessContentType(string magic_file[, long magic_mode = MAGIC_MIME])

+

static string HttpResponse::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME])

Attempts to guess the content type of supplied payload through libmagic.
If the attempt is successful, the guessed content type will automatically
be set as response content type.

@@ -859,7 +879,211 @@ http.cache_log is set.


-

Generated at: Wed, 05 Oct 2005 14:35:52 +0000

+
Table of Contents + +
+

Generated at: Wed, 05 Oct 2005 15:34:24 +0000

diff --git a/funcsummary.php b/funcsummary.php index 4a7c1dd..1867f5a 100644 --- a/funcsummary.php +++ b/funcsummary.php @@ -73,6 +73,26 @@ $preface = <<<_PREFACE p br, pre code br { display: block; } + .toc { + position: absolute; + top: 10px; + right: 10px; + width: 300px; + height: 95%%; + overflow: scroll; + font-size: .9em; + } + body>div.toc { + position: fixed; + } + .toc ul { + padding-left: 15px; + margin-left: 0; + } + .toc li { + padding: 0; + margin: 0; + } @@ -89,6 +109,8 @@ if ($_SERVER['argc'] < 2) { die("Usage: {$_SERVER['argv'][0]} [ ...]\n"); } +$TOC = array(); + printf($preface, basename(getcwd())); foreach (array_slice($_SERVER['argv'], 1) as $fp) { @@ -96,21 +118,45 @@ foreach (array_slice($_SERVER['argv'], 1) as $fp) { if (mf($f, $m)) { e("\nAnalyzing %s\n", basename($f)); - printf("

%s

\n", basename($f)); + printf("

%s

\n", basename($f), basename($f)); foreach ($m[1] as $i => $p) { e("Documenting $p\n"); if ($o = preg_match('/^(.*), (.*)$/', $m[4][$i], $n)) { if ($n[2] == '__construct') { printf("

%s

\n", $n[1], $n[1]); } - } + $TOC[basename($f)][$n[1]][$n[2]] = $n[1].'::'.$n[2].'()'; + printf("%s\n", 3, $n[1].'_'.$n[2], $p, 3); + } else { + $TOC[basename($f)][$m[4][$i]] = $m[4][$i].'()'; + printf("%s\n", 2, $m[4][$i], $p, 2); + } + print ff($m[3][$i]) ."\n"; + /* printf("%s\n%s\n", $o?3:2, $o?$n[1].'_'.$n[2]:$m[4][$i], $p, $o?3:2, ff($m[3][$i])); + */ } print "
\n"; } } } +printf("
Table of Contents\n\n
\n"); printf($footer, date('r')); e("\nDone\n"); -- 2.30.2