/**
  * Framework initialization
  *
  * Registers the autoloader and creates the Request object.
  *
  * @return boolean
  */
 public static function init()
 {
     // Ensure that the framework has not been loaded yet
     if (self::$loaded == true) {
         return FALSE;
     }
     // The variable has been loaded;
     self::$loaded = true;
     // Register the internal autload function for SQL autoloading
     spl_autoload_register(__NAMESPACE__ . '\\Elusive::loader');
     // Populate the Request Object
     Request::get_instance();
     return TRUE;
 }
 /**
  * Constructor
  *
  * Loads debugging data from the static Debug object
  *
  * @return void
  */
 public function __construct()
 {
     // Safety Net
     if (!defined('APP_MODE')) {
         define('APP_MODE', 'PRODUCTION');
     }
     if (APP_MODE == 'DEBUG') {
         $this->debug = TRUE;
     }
     $this->request = Request::get_instance();
     $this->traces = Debug::get('traces');
     $this->errors = Debug::get('errors');
     $this->logs = Debug::get('logs');
     $this->events = Debug::get('events');
 }
 /**
  * Run the Application Controller
  *
  * @return void
  */
 public static function run()
 {
     Events::dispatch('APPLICATION', 'RUN');
     self::$request = Request::get_instance();
     // Load the application settings
     self::load_application_settings();
     Events::dispatch('APPLICATION', 'LOADED');
     Events::dispatch('APPLICATION', 'HANDOFF');
     self::$request->app['path'] = APP_PATH;
     self::$request->app['main_controller'] = APP_CONTROLLER;
     // Try to load the Application Controller
     $appclass = APP_CONTROLLER;
     self::$app = new $appclass();
     Events::dispatch('APPLICATION', 'COMPLETE');
 }
 public function __construct()
 {
     $this->request = Request::get_instance();
     include_once APP_PATH . "/app.php";
     $this->route();
 }