cvs: phpdoc /scripts genfuncsummary.php

From: Date: Sat, 24 Aug 2002 05:44:52 +0000
Subject: cvs: phpdoc /scripts genfuncsummary.php
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969348269@lists.php.net to get a copy of this message
jmcastagnetto Sat Aug 24 01:44:52 2002 EDT Modified files: /phpdoc/scripts genfuncsummary.php Log: Possible solution. DO NOT USE THIS SCRIPT YET. Index: phpdoc/scripts/genfuncsummary.php diff -u phpdoc/scripts/genfuncsummary.php:1.1 phpdoc/scripts/genfuncsummary.php:1.2 --- phpdoc/scripts/genfuncsummary.php:1.1 Sat Aug 24 01:23:49 2002 +++ phpdoc/scripts/genfuncsummary.php Sat Aug 24 01:44:52 2002 @@ -2,7 +2,7 @@ // WARNING: still a work in progress // TODO: check why sometimes the regex is fubared - JMC -// $Id: genfuncsummary.php,v 1.1 2002/08/24 05:23:49 jmcastagnetto Exp $ +// $Id: genfuncsummary.php,v 1.2 2002/08/24 05:44:52 jmcastagnetto Exp $ $php4src = realpath("../../php4"); @@ -11,7 +11,7 @@ $filelist = $find->search("/.*\.(c|h|ec)$/",realpath($php4src), 'perl'); sort($filelist); -$proto_re = "/^[[:space:]]*\/\*[[:space:]]*\{\{\{[[:space:]]*proto/"; +$proto_re = "/[[:space:]]*\/\*[[:space:]]*\{\{\{[[:space:]]*proto[[:space:]]*(.+)[[:space:]]*\*\//msU"; $re_split1 = "proto[[:space:]]+|\\*\/[[:space:]]*$"; $re_split2 = "\\**\/[[:space:]]*$"; $re_proto_parts = "/^(.+)[[:space:]]+([[:alnum:]_]+)\((.*)\)[[:space:]]*$/"; @@ -19,6 +19,15 @@ foreach ($filelist as $filename) { $proto_arr = array(); $parse = $same = false; + $matches = array(); + $lines = implode("\n",file($filename)); + preg_match_all($proto_re, $lines, $matches); + if (!empty($matches[1])) { + $name = str_replace(realpath("../../")."/", "# ", $filename); + echo "$name\n"; + echo str_replace("\n\n","\n",implode("\n", $matches[1]))."\n"; + } + /* foreach (file($filename) as $line) { $content = array(); if (preg_match($proto_re, $line)) { @@ -56,6 +65,7 @@ echo "$filename\n"; echo implode("\n", $proto_arr)."\n"; } + */ } ?>

« previous php.doc (#969348269) next »