/**
  * Run application. Run process responsible for request processing and sending response.
  * List of supported parameters:
  *  scope_code - code of default scope (website/store_group/store code)
  *  scope_type - type of default scope (website/group/store)
  *  options    - configuration options
  *
  * @param  array $params application run parameters
  * @return Mage_Core_Model_App
  */
 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;
 }