[eluser]egoslip[/eluser]
E1M2
Thanks so much for the clarification.. now I only have one more question. keep in mind I'm self thought php programmer and I'm now getting my head around the php class funtion never had any formal education on programing.
below is the mod I did to the _scan_directory i tried to keep the modifications to the file very minial. my thought is just look for every observer folder in each module and then just add it to the observer array.
But im getting an error when I load the modules_m model.. how can i fix this if you can help clarify this i would be greatly thankful
Code:
<?
function _scan_directory($dirr /*rename from $dir*/)
{
$observers = array();
//Start matchbox mod
$this->load->model('modules_m'); //error starts here
$modules=$this->modules_m->getModules();
foreach($modules as $module){
$dir='modules/'.$module['slug'].'/'.$dirr;
//EOF matchbox mod
if (($dh = @opendir($dir)) !== false)
{
while (($file = readdir($dh)) !== false)
{
if ($file == '..' || $file == '.')
continue;
if (is_dir($dir.$file))
$observers = array_merge($observers, $this->_scan_directory($dir.$file.'/'));
else
{
list($observer, $ext) = explode('.', $file);
if (('.'.$ext) != EXT)
continue;
$observers[] = array(
'name' => $observer,
'location' => $dir.$file,
'modified' => filemtime($dir.$file)
);
}
}
closedir($dh);
} }//added to close the foreach mod of matchbox
return $observers;//moved out side of the foreach and if statment
}
?>