[eluser]cpscdave[/eluser]
that method kinda works.
However there is a couple problems.
First it gives you the base class functions as well,
and it doesnt then let you know whether the method is private or protected.
I actually figured out a method to get what I need:
$theDir is set to where the controllers are on the local server
Code:
$theControllers = array();
if ($dh = opendir($theDir)) {
while (($file = readdir($dh)) !== false) {
if(strstr($file, ".php"))
{
$theControllers[] = $file;
}
}
}
closedir($dh);
$uris = array();
foreach($theControllers as $controller)
{
if($controller == "auth.php") //not sure how to handle this yet...
continue;
$class = str_replace(".php","",$controller);
$fp = fopen($theDir . $controller, "r");
$content = fread($fp, filesize($theDir . $controller));
fclose($fp);
$theLines = explode("\n",$content);
foreach($theLines as $line)
{
if(stristr($line, "private"))
continue;
if(stristr($line, "protected"))
continue;
if(stristr($line, "function"))
{
$myLine = trim(str_replace("function","",$line));
$myLine = str_replace(strchr($myLine, "("),"",$myLine);
if(strtolower($class) == strtolower($myLine))
{
//is constructor
continue;
}
if(substr($myLine,0,1)=="_")
{
//is private
continue;
}
$uris[] = $class . "/".$myLine;
} //end if line is function
} //end foreach lines
}//end foreach controller
print_r($uris);