/** * Function called from system_init.php to set up the whole request * */ public function initCertis() { // initialize the values to known quantities. self::$module = ""; self::$action = ""; self::$req_id = ""; self::$params = array(); self::$config = array(); self::$authless = array(); self::$authed_user = ""; self::$exec_mode = ""; self::$CertisInst =& $this; // store a reference to ourself here self::$activeSection = FALSE; // Set up the static variables from either the URL // or the CLI args/env. $this->setupStaticVars(); // set up the session stuff $this->initSession(); // initialize system Global objects $this->initGlobalObjects(); // call up all the module initializers $this->callModInit(); }
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);