1

I am get confused a little bit about the correct answer for this question, may be it is small.

One /app/code/core/Mage/Core/Model/App.php

 public function run($params)
{
    $this->baseInit($options);
    $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;
}

Base configuration as well as Module configuration is loading by below code when request something.

$this->_config->loadBase();
$this->_config->loadModules();
$this->_config->loadDb();

Two app/code/core/Mage/Core/Model/App.php

public function init($code, $type = null, $options = array())
{

    $this->_initEnvironment();
    $this->_config = Mage::getConfig();
    $this->_config->setOptions($options);
    $this->_initBaseConfig();
    $this->_initCache();
    $this->_config->init($options);

    if (Mage::isInstalled($options)) {
        $this->_initCurrentStore($code, $type);
        $this->_initRequest();
    }
    return $this;
}

It is calling when we call Stactic Method Mage::app(); initializing configuration and loading

Based on One and Two Config loading which is the correct answer for tagged (How and when does Magento load .... ) question ?

Any answer appreciate.

1 Answer 1

0

In Magento have three executing function (Mage::init(), Mage::app(), Mage::run()). But there are two main functions that usually use for executing, that is Mage::app(), Mage::run().

You can read this: http://vncosy.com/magento-what-is-the-difference-regarding-module-loading-between-magerun-and-mageapp/

1
  • cool answer , But what if get asked above question ( how and when does ... base configuration, the module configuration, and the database configuration? ) . Do I have to say Mage::app() or by the public function run(). Feb 4, 2016 at 9:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.