示例#1
0
 /**
  *
  * @return Response
  *
  */
 public static function render_exception(Exception $ex)
 {
     if (trim(env('SHOW_ERRORS', '')) != '1') {
         $error_url = env('ERROR_URL', '');
         if ($error_url == $_SERVER['REQUEST_URI']) {
             die('Error');
         }
         Navigation::location_go($error_url);
     } else {
         if ($ex && $ex instanceof \Symfony\Component\HttpKernel\Exception\HttpException) {
             $code = $ex->getStatusCode();
         } else {
             $code = 200;
         }
         $content = self::_get_exception_html($ex);
         $content = "<html><head></head><body>{$content}</body></html>";
         return Response::create($content, $code);
     }
 }
 public static function logout($redirect = null)
 {
     @session_start();
     $_SESSION[self::$_SESSION_VARNAME] = false;
     Navigation::location_go($redirect ? $redirect : Navigation::get_site_url());
 }