Ver Mensaje Individual
  #9 (permalink)  
Antiguo 26/01/2010, 11:11
Avatar de SergeMedina
SergeMedina
 
Fecha de Ingreso: septiembre-2007
Ubicación: Guadalajara, Jalisco
Mensajes: 459
Antigüedad: 16 años, 8 meses
Puntos: 20
Respuesta: request y isPost en ZF

A mi entender el request no esta almacenado en el registro, este es manejado unicamente por el front controller (Zend/Controller/Front.php):

Código PHP:
Ver original
  1. /**
  2.      * Dispatch an HTTP request to a controller/action.
  3.      *
  4.      * @param Zend_Controller_Request_Abstract|null $request
  5.      * @param Zend_Controller_Response_Abstract|null $response
  6.      * @return void|Zend_Controller_Response_Abstract Returns response object if returnResponse() is true
  7.      */
  8.     public function dispatch(Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null)
  9.     {
  10.         if (!$this->getParam('noErrorHandler') && !$this->_plugins->hasPlugin('Zend_Controller_Plugin_ErrorHandler')) {
  11.             // Register with stack index of 100
  12.             require_once 'Zend/Controller/Plugin/ErrorHandler.php';
  13.             $this->_plugins->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(), 100);
  14.         }
  15.  
  16.         if (!$this->getParam('noViewRenderer') && !Zend_Controller_Action_HelperBroker::hasHelper('viewRenderer')) {
  17.             require_once 'Zend/Controller/Action/Helper/ViewRenderer.php';
  18.             Zend_Controller_Action_HelperBroker::getStack()->offsetSet(-80, new Zend_Controller_Action_Helper_ViewRenderer());
  19.         }
  20.  
  21.         /**
  22.          * Instantiate default request object (HTTP version) if none provided
  23.          */
  24.         if (null !== $request) {
  25.             $this->setRequest($request);
  26.         } elseif ((null === $request) && (null === ($request = $this->getRequest()))) {
  27.             require_once 'Zend/Controller/Request/Http.php';
  28.             $request = new Zend_Controller_Request_Http();
  29.             $this->setRequest($request);
  30.         }
  31.  
  32.         /**
  33.          * Set base URL of request object, if available
  34.          */
  35.         if (is_callable(array($this->_request, 'setBaseUrl'))) {
  36.             if (null !== $this->_baseUrl) {
  37.                 $this->_request->setBaseUrl($this->_baseUrl);
  38.             }
  39.         }
  40.  
  41.         /**
  42.          * Instantiate default response object (HTTP version) if none provided
  43.          */
  44.         if (null !== $response) {
  45.             $this->setResponse($response);
  46.         } elseif ((null === $this->_response) && (null === ($this->_response = $this->getResponse()))) {
  47.             require_once 'Zend/Controller/Response/Http.php';
  48.             $response = new Zend_Controller_Response_Http();
  49.             $this->setResponse($response);
  50.         }
  51.  
  52.         /**
  53.          * Register request and response objects with plugin broker
  54.          */
  55.         $this->_plugins
  56.              ->setRequest($this->_request)
  57.              ->setResponse($this->_response);
  58.  
  59.         /**
  60.          * Initialize router
  61.          */
  62.         $router = $this->getRouter();
  63.         $router->setParams($this->getParams());
  64.  
  65.         /**
  66.          * Initialize dispatcher
  67.          */
  68.         $dispatcher = $this->getDispatcher();
  69.         $dispatcher->setParams($this->getParams())
  70.                    ->setResponse($this->_response);
  71.  
  72.         // Begin dispatch
  73.         try {
  74.             /**
  75.              * Route request to controller/action, if a router is provided
  76.              */
  77.  
  78.             /**
  79.             * Notify plugins of router startup
  80.             */
  81.             $this->_plugins->routeStartup($this->_request);
  82.  
  83.             $router->route($this->_request);
  84.  
  85.             /**
  86.             * Notify plugins of router completion
  87.             */
  88.             $this->_plugins->routeShutdown($this->_request);
  89.  
  90.             /**
  91.              * Notify plugins of dispatch loop startup
  92.              */
  93.             $this->_plugins->dispatchLoopStartup($this->_request);
  94.  
  95.             /**
  96.              *  Attempt to dispatch the controller/action. If the $this->_request
  97.              *  indicates that it needs to be dispatched, move to the next
  98.              *  action in the request.
  99.              */
  100.             do {
  101.                 $this->_request->setDispatched(true);
  102.  
  103.                 /**
  104.                  * Notify plugins of dispatch startup
  105.                  */
  106.                 $this->_plugins->preDispatch($this->_request);
  107.  
  108.                 /**
  109.                  * Skip requested action if preDispatch() has reset it
  110.                  */
  111.                 if (!$this->_request->isDispatched()) {
  112.                     continue;
  113.                 }
  114.  
  115.                 /**
  116.                  * Dispatch request
  117.                  */
  118.                 try {
  119.                     $dispatcher->dispatch($this->_request, $this->_response);
  120.                 } catch (Exception $e) {
  121.                     if ($this->throwExceptions()) {
  122.                         require_once 'Zend/Controller/Exception.php';
  123.                         throw new Zend_Controller_Exception($e->getMessage(), $e->getCode(), $e);
  124.                     }
  125.                     $this->_response->setException($e);
  126.                 }
  127.  
  128.                 /**
  129.                  * Notify plugins of dispatch completion
  130.                  */
  131.                 $this->_plugins->postDispatch($this->_request);
  132.             } while (!$this->_request->isDispatched());
  133.         } catch (Exception $e) {
  134.             if ($this->throwExceptions()) {
  135.                 require_once 'Zend/Controller/Exception.php';
  136.                 throw new Zend_Controller_Exception($e->getMessage(), $e->getCode(), $e);
  137.             }
  138.  
  139.             $this->_response->setException($e);
  140.         }
  141.  
  142.         /**
  143.          * Notify plugins of dispatch loop completion
  144.          */
  145.         try {
  146.             $this->_plugins->dispatchLoopShutdown();
  147.         } catch (Exception $e) {
  148.             if ($this->throwExceptions()) {
  149.                 require_once 'Zend/Controller/Exception.php';
  150.                 throw new Zend_Controller_Exception($e->getMessage(), $e->getCode(), $e);
  151.             }
  152.  
  153.             $this->_response->setException($e);
  154.         }
  155.  
  156.         if ($this->returnResponse()) {
  157.             return $this->_response;
  158.         }
  159.  
  160.         $this->_response->sendResponse();
  161.     }
  162. }
__________________
I see dead pixels