コード例 #1
0
ファイル: Proxy.php プロジェクト: mpi77/PhoenixFramework
 /**
  * Detect proxy request.
  * 
  * @return boolean
  */
 private function isProxyRequest()
 {
     $route = $this->request->getUrl()->getQueryParameter(FrontController::URL_GET_ROUTE);
     $action = $this->request->getUrl()->getQueryParameter(FrontController::URL_GET_ACTION);
     $token = $this->request->getUrl()->getQueryParameter(FrontController::URL_GET_TOKEN);
     return empty($route) && empty($action) && !empty($token);
 }
コード例 #2
0
 /**
  * Perform action on this view.
  *
  * @throws Phoenix\Exceptions\WarningException
  * @return void
  */
 private function performViewAction()
 {
     /*
      * ($this->response == null) means that cotroller does not throw any exception and everything is ok
      *
      * ($this->response == Response && $this->response->getException() == NoticeException) means that controller
      * throws NoticeException
      *
      * it is possible to create new response with content only in situations mentioned above
      */
     $action_name = $this->request->getUrl()->getQueryParameter(self::URL_GET_ACTION);
     if (is_null($this->response) || $this->response instanceof Response && $this->response->getException() instanceof NoticeException) {
         if (System::isCallable($this->view, $action_name)) {
             $old_exception = $this->response instanceof Response && $this->response->getException() instanceof NoticeException ? $this->response->getException() : null;
             $this->view->{$action_name}();
             $this->response = $this->view->getResponse();
             $this->response->setException($old_exception);
         } else {
             throw new WarningException(FrameworkExceptions::W_ROUTER_INVALID_ACTION, json_encode($this->request));
         }
     }
 }