When looking at the class app\code\core\Mage\Core\Model\App.php
, we have the following function:
public function run($params)
{
$options = isset($params['options']) ? $params['options'] : array();
$this->baseInit($options);
Mage::register('application_params', $params);
if ($this->_cache->processRequest()) {
$this->getResponse()->sendResponse();
} else {
$this->_initModules();
$this->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
if ($this->_config->isLocalConfigLoaded()) {
$scopeCode = isset($params['scope_code']) ? $params['scope_code'] : '';
$scopeType = isset($params['scope_type']) ? $params['scope_type'] : 'store';
$this->_initCurrentStore($scopeCode, $scopeType);
$this->_initRequest();
Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
}
$this->getFrontController()->dispatch();
}
return $this;
}
To add a event/observer
we use the following code:
<events>
<EVENT_TO_HOOK>
<observers>
<module>
<type>singleton</type>
<class>company_module_model_observer</class>
<method>methodToCall</method>
</module>
</observers>
</EVENT_TO_HOOK>
</events>
What event should we add to observe the run
function of class Mage_Core_Model_App
?