/**
  * Dispatches a request.
  *
  * This will determine which module and action to use by request parameters specified by the user.
  */
 public function dispatch()
 {
     try {
         if (sfConfig::get('sf_logging_enabled')) {
             $this->getContext()->getLogger()->info('{sfController} dispatch request');
         }
         // reinitialize filters (needed for unit and functional tests)
         sfFilter::$filterCalled = array();
         // determine our module and action
         $request = $this->getContext()->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         // make the first request
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         if (sfConfig::get('sf_test')) {
             throw $e;
         }
         $e->printStackTrace();
     } catch (Exception $e) {
         if (sfConfig::get('sf_test')) {
             throw $e;
         }
         try {
             // wrap non symfony exceptions
             $sfException = new sfException();
             $sfException->printStackTrace($e);
         } catch (Exception $e) {
             header('HTTP/1.0 500 Internal Server Error');
         }
     }
 }
Example #2
0
 /**
  * Dispatches a request.
  *
  * This will determine which module and action to use by request parameters specified by the user.
  */
 public function dispatch()
 {
     try {
         // reinitialize filters (needed for unit and functional tests)
         sfFilter::$filterCalled = array();
         // determine our module and action
         $request = $this->context->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         if (empty($moduleName) || empty($actionName)) {
             throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
         }
         // make the first request
         $this->forward($moduleName, $actionName);
     } catch (sfError404Exception $e) {
         if (!sfConfig::get('sf_web_debug')) {
             $this->forward('dmFront', 'error404');
         } else {
             $e->printStackTrace();
         }
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
 }
 /**
  * Dispatches a request.
  *
  * This will determine which module and action to use by request parameters specified by the user.
  */
 public function dispatch()
 {
     try {
         if (sfConfig::get('sf_logging_enabled')) {
             $this->dispatcher->notify(new sfEvent($this, 'application.log', array('Dispatch request')));
         }
         // reinitialize filters (needed for unit and functional tests)
         sfFilter::$filterCalled = array();
         // determine our module and action
         $request = $this->context->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         if (empty($moduleName) || empty($actionName)) {
             throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
         }
         // make the first request
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
 }
 /**
  * Dispatches a request.
  *
  * This will determine which module and action to use by request parameters specified by the user.
  */
 public function dispatch()
 {
     try {
         // reinitialize filters (needed for unit and functional tests)
         sfFilter::$filterCalled = array();
         // determine our module and action
         $request = $this->context->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         if (empty($moduleName) || empty($actionName)) {
             throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
         }
         // make the first request
         $this->forward($moduleName, $actionName);
     } catch (sfStopException $e) {
         // ignore, do nothing
     } catch (Exception $e) {
         // Throwing an exception here will break the exception handling
         // when process isolation of PHPUnit is activated.
         // This will only work when the configuration "convertErrorsToExceptions"
         // is enabled.
         trigger_error(sprintf('wrapped controller exception [%s]: %s', get_class($e), $e->getMessage()));
     }
 }
 public function dispatch()
 {
     try {
         sfFilter::$filterCalled = array();
         $request = $this->context->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         if (empty($moduleName) || empty($actionName)) {
             throw new sfError404Exception(sprintf('Empty module and/or action after parsing the URL "%s" (%s/%s).', $request->getPathInfo(), $moduleName, $actionName));
         }
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         $e->printStackTrace();
     } catch (Exception $e) {
         sfException::createFromException($e)->printStackTrace();
     }
 }
Example #6
0
 public function dispatch()
 {
     try {
         if (sfConfig::get('sf_logging_enabled')) {
             $this->getContext()->getLogger()->info('{sfController} dispatch request');
         }
         sfFilter::$filterCalled = array();
         $request = $this->getContext()->getRequest();
         $moduleName = $request->getParameter('module');
         $actionName = $request->getParameter('action');
         $this->forward($moduleName, $actionName);
     } catch (sfException $e) {
         if (sfConfig::get('sf_test')) {
             throw $e;
         }
         $e->printStackTrace();
     } catch (Exception $e) {
         if (sfConfig::get('sf_test')) {
             throw $e;
         }
         try {
             $sfException = new sfException($e->getMessage());
             $sfException->printStackTrace($e);
         } catch (Exception $e) {
             header('HTTP/1.0 500 Internal Server Error');
         }
     }
 }
 /**
  * Dispatches a soap request via a sfTestBrowser to the tested application.
  *
  * @see SoapClient::__doRequest()
  */
 public function __doRequest($request, $location, $action, $version)
 {
     $this->lastRequest = strval($request);
     $GLOBALS['HTTP_RAW_POST_DATA'] = $this->lastRequest;
     $this->browser->setHttpHeader('soapaction', strval($action));
     sfFilter::$filterCalled = array();
     $this->lastResponse = strval($this->browser->post('/')->getResponse()->getContent());
     return $this->lastResponse;
 }