How do I check an external file for a class?
I am trying to setup a install feature for my modules, so I am trying to get it to load a list of directories and then check if the module file has a method called install. So only the modules with this method will be shown in the list.
Here is my code so far:
$output .= '<div id="module-dialog" title="Add Widget"><form id="widget-list" name="widget-list">
<select name="widgets" size="12" id="widgets-list">';
$dirHandler = opendir('modules') or die ("Could not open module folder");
while ($dir = readdir($dirHandler)) {
if($dir!="." && $dir!=".."){
// Code to filter out modules with install class -- goes here
$output .='<option>'.$dir.'</option>';
}
}
$output .='</select></form></div>';
The module file name is the same as the directory name. example: folder:Admin, file:Admin.php
If this can not be done then I guess I will create a separate file just for the install function.