Пример #1
0
 /**
  * Start the App.
  *
  * @return void
  */
 public function run()
 {
     //Define a custom error handler so we can log PHP errors
     set_error_handler(array('\\Kotori\\Core\\Handle', 'error'));
     set_exception_handler(array('\\Kotori\\Core\\Handle', 'exception'));
     register_shutdown_function(array('\\Kotori\\Core\\Handle', 'end'));
     Config::getSoul()->initialize($this->_config);
     ini_set('date.timezone', Config::getSoul()->TIME_ZONE);
     if (Config::getSoul()->USE_SESSION) {
         !session_id() && session_start();
     }
     //Build
     new Build(Config::getSoul()->APP_FULL_PATH);
     //Load application's common functions
     Helper::import(Config::getSoul()->APP_FULL_PATH . '/common.php');
     if (function_exists('spl_autoload_register')) {
         spl_autoload_register(array('\\Kotori\\Core\\Helper', 'autoload'));
     } else {
         function __autoload($className)
         {
             Helper::autoload($className);
         }
     }
     //Load route class
     Route::getSoul()->dispatch();
     //Global security filter
     array_walk_recursive($_GET, array('\\Kotori\\Http\\Request', 'filter'));
     array_walk_recursive($_POST, array('\\Kotori\\Http\\Request', 'filter'));
     array_walk_recursive($_REQUEST, array('\\Kotori\\Http\\Request', 'filter'));
 }