我想在这里更正KESHAV_PHP。
$_SERVER['MAGE_RUN_TYPE']定义最终用于选择商店的实体类型。如果通过传递此处来定义特定商店store,那么将加载商店。这意味着(与keshav所写的相反),无论商店是否是默认网站的一部分,这都没有关系。
如果通过website,则将加载商店,这是该网站的默认设置。
$_SERVER['MAGE_RUN_CODE']定义了的网站或商店,在表中所定义的代码core_website.code和core_store.code。
整个过程可以在这里找到:
\Mage_Core_Model_App::_initCurrentStore
switch ($scopeType) {
case 'store':
$this->_currentStore = $scopeCode;
break;
case 'group':
$this->_currentStore = $this->_getStoreByGroup($scopeCode);
break;
case 'website':
$this->_currentStore = $this->_getStoreByWebsite($scopeCode);
break;
default:
$this->throwStoreException();
}
当getStoreByWebsite只得到了默认的组,然后调用getStoreByGroup它得到默认存储为组。