Example #1
0
File: boot.php Project: Eteng/lorb
/*** include the path for the library utill ***/
//todo:modle the autoload properly
/*** auto load model classes ***/
function __autoload($class_name)
{
    $filename = strtolower($class_name) . '.Model.php';
    $file = __SITE_PATH . '/model/' . $filename;
    if (file_exists($file) == false) {
        return false;
    }
    include $file;
}
/**A function used to load Dodeye library
 * @param String $path of the Class to inport e.g <"Dodeye.util.basic">
 * @return requirement to the path
 */
function pitch($path)
{
    $path = str_replace('.', "\\", $path);
    $path = $path . ".php";
    return require_once "{$path}";
}
/*** a new registry object ***/
$registry = new Registry();
$registry->dodeye = new Dodeye($registry);
/**creating the database reg object ***/
$registry->db = DB::getDB(LorbConfig::getConfig()->getDefaultDB());
$registry->cfg = LorbConfig::getConfig();
$registry->maps = Maps::getInstance();
Template::setBaseDir();
$registry->front = new FrontController($registry);