// {{{ __autoload($class) /** * __autoload * * autoload is ran by php when it can't find a class it is trying to load. * by naming our classes intelligently we should be able to load most classes * dynamically. * * @author joe stump <[email protected]> * @param string $class class name we're trying to load * @return void * @package framework */
function __autoload($class) { $file = str_replace('_','/',substr($class,2)).'.php'; require_once(fr_base_path.'/includes/'.$file); } // }}}
if (isset($_get['module'])) { $module = $_get['module']; if (isset($_get['event'])) { $event = $_get['event']; } else { $event = '__default'; }
$classfile = fr_base_path.'/modules/'.$module.'/'.$class.'.php'; if (file_exists($classfile)) { require_once($classfile); if (class_exists($class)) { try { $instance = new $class(); if (!fr_module::isvalid($instance)) { die("requested module is not a valid framework module!"); }
$instance->modulename = $module; if ($instance->authenticate()) { try { $result = $instance->$event(); if (!pear::iserror($result)) { $presenter = fr_presenter::factory($instance->presenter,$instance);
if (!pear::iserror($presenter)) { $presenter->display(); } else { die($presenter->getmessage()); } } } catch (exception $error) { die($error->getmessage()); } } else { die("you do not have access to the requested page!"); } } catch (exception $error) { die($error->getmessage()); } } else { die("an valid module for your request was not found"); } } else { die("could not find: $classfile"); } } else { die("a valid module was not specified"); }