Store View Initialization
This happens in ‘core/app’ model in the _initCurrentStore() function. What this function does is, reads all stores information database. This is information is read from ‘core/website’ , ‘core/store’ , ‘core/store_group’ and it iterates over these objects and assigns them accordingly. It also check which is the default website and stores that in a separate variable
From index.php we call the Mage::run() we pass two parameters ($storeScope and $storeType), both these parameters are used here.
$scopeType: can be website, store, group (if empty its treated as website)
$storeScope: this is code of (website or store etc according to type)
based of this the default website, store etc is initialized.
Next we also have two functions
Both these function check cookie and $_GET[‘___store’] if there is a store code present in them. If it’s present that store code is regarded as the current store.
This happens in the
_initEnvironment() at line
When the class ‘core/locale’ is initialized, the constructor get called which automatically read locale from system configuration and initializes it.