Example #1
0
        if (preg_match("/Controller/", $class_name)) {
            // if it's a controller class being requested, remove controller, lower the resulting
            // string and that should be the module name
            $module = strtolower(preg_replace("/Controller/", "", $class_name));
            require_once _SYSTEM_ . "/modules/{$module}/controller.php";
            return;
        } else {
            // otherwise, it's a Model from within a module somewhere.
            $class_file = glob(_SYSTEM_ . "/modules/*/" . $class_name . ".model.php");
            if (count($class_file) == 1) {
                require_once $class_file[0];
                return;
            } elseif (count($class_file) > 1) {
                error_log("[System::__autoload] Ambiguous Class {$class_name}. Multiple Class files found.  Not Autoloading.");
            } else {
                error_log("[System::__autoload] {$class_name} not found.");
            }
        }
    }
}
if (!spl_autoload_register('classLoader', true, true)) {
    error_log("[System::init()] Unable to register classLoader");
    exit(1);
}
// create a new instance of the base Certis class.
$CertisInst = new Certis();
// ... and call the initCertis() function to set
// the object environment for all extended objects from here on.
$CertisInst->initCertis();
# Set out timezone
date_default_timezone_set($CertisInst->config->time_zone);