Certificated magento

Q.2.29) Which events are associated with sending output?

http_response_send_before - lie in Mage_Core_Controller_Response_Http->sendResponse()

 public function sendResponse()

    {

        Mage::dispatchEvent('http_response_send_before', array('response'=>$this));

        return parent::sendResponse();

    }

controller_front_send_response_before - lie in Mage_Core_Controller_Varien_Front->dispatch()

controller_front_send_response_after - lie in Mage_Core_Controller_Varien_Front->dispatch()
 
 public function dispatch()
    {
        $request = $this->getRequest();
 
        // If pre-configured, check equality of base URL and requested URL
        $this->_checkBaseUrl($request);
 
        $request->setPathInfo()->setDispatched(false);
 
        $this->_getRequestRewriteController()->rewrite();
 
        Varien_Profiler::start('mage::dispatch::routers_match');
        $i = 0;
        while (!$request->isDispatched() && $i++ < 100) {
            foreach ($this->_routers as $router) {
                /** @var $router Mage_Core_Controller_Varien_Router_Abstract */
                if ($router->match($request)) {
                    break;
                }
            }
        }
        Varien_Profiler::stop('mage::dispatch::routers_match');
        if ($i>100) {
            Mage::throwException('Front controller reached 100 router match iterations');
        }
        // This event gives possibility to launch something before sending output (allow cookie setting)
        Mage::dispatchEvent('controller_front_send_response_before', array('front'=>$this));
        Varien_Profiler::start('mage::app::dispatch::send_response');
        $this->getResponse()->sendResponse();
        Varien_Profiler::stop('mage::app::dispatch::send_response');
        Mage::dispatchEvent('controller_front_send_response_after', array('front'=>$this));
        return $this;
    }

0 Bình luận

Trở về
  • 1.12) Set up a cron job
  • 1.12) Set up a cron job

    Let’s start with server setup.   As any complex system, Magento has a lot of tasks that need to be executed...