[thelist] FLOWCHART(ing): any ideas on how i can map out functions in a web app.?

Bill Haenel bill at webmarketingworx.com
Tue Jun 25 22:25:00 CDT 2002


> "genFunc.asp" and it would show me a list
> of all the functions in that file. i could also search for
> "getProductID" and it would show me which file that function was
> contained in.

Idunno about asp or perl (so I'm probably wasting your time - sorry), but
with PHP you could start with including the file you're searching through,
then listing all of the defined functions in that file using the array
within the [user] key of the array created by PHP's get_defined_functions()
function.

Maybe...

<?
include "functions.php";
$funcs = get_defined_functions();
$userfuncs = $funcs['user'];
foreach ($userfuncs as $funcname) {
	echo $funcname.'<br>';
}
?>


In the function search, you could loop through the files in a specified
directory and check each key in [user] for a match to the function you're
looking for (sent via form?) as each file is checked.

<?
include "functions.php"; //loop around this and check each file as it is
included
$funcs = get_defined_functions();
$userfuncs = $funcs['user'];
foreach ($userfuncs as $funcname) {
	if ($funcname == $funcsearch) {
		echo 'found it!';
	}
}
?>

The first works fine - haven't tried the second.

Neat idea - good luck!

BH




More information about the thelist mailing list