5 return sprintf("<blockquote>%s</blockquote>\n", highlight_string($m[1], true));
10 '/\/\* *\{\{\{ *proto (.*?)(\n|$)(.*?)PHP_(?:FUNCTION|METHOD)\((.*?)\)/s',
11 file_get_contents($f), $m);
15 $t = preg_replace('/^ \* /m', '', trim($t, "*/ \n"));
16 $t = preg_replace_callback('/(\<\?php.*?\?\>)/s', 'hl', $t);
17 $t = nl2br(preg_replace('/\n *\* */', "\n", $t));
18 $t = preg_replace('/(\<br \/\>\n)+\<pre\>(\<br \/\>\n)+/', '</p><pre>', $t);
19 $t = preg_replace('/(\<br \/\>\n)+\<\/pre\>(\<br \/\>\n)+/', '</pre><p>', $t);
20 return sprintf('<p>%s</p>', ltrim($t, ' *'));
23 $preface = <<<_PREFACE
26 <title>Function Summary of ext/%s</title>
30 font-family: sans-serif;
50 border: 1px solid #ccc;
68 <p><b>Generated at: %s</b></p>
74 if ($_SERVER['argc'] < 2) {
75 die("Usage: {$_SERVER['argv'][0]} <file>[ <file> ...]\n");
78 printf($preface, basename(getcwd()));
80 foreach (array_slice($_SERVER['argv'], 1) as $f) {
82 printf("<h1>%s</h1>\n", basename($f));
83 foreach ($m[1] as $i => $p) {
84 printf("<h2 id=\"%s\">%s</h2>\n%s\n",
85 str_replace(', ', '_', $m[4][$i]), $p, ff($m[3][$i]));
87 print "<hr noshade>\n";
91 printf($footer, date('r'));