/** * @static * @param string $code * @param string $type * @param array $options * @param string|array $modules */ public static function init($code = '', $type = 'store', $options = array(), $modules = array()) { try { self::$_app = self::getObjectManager()->create('Mage_Core_Model_App'); if (!empty($modules)) { self::$_app->initSpecified($code, $type, $options, $modules); } else { self::$_app->init($code, $type, $options); } } catch (Mage_Core_Model_Session_Exception $e) { header('Location: ' . self::getBaseUrl()); die; } catch (Mage_Core_Model_Store_Exception $e) { require_once self::getBaseDir() . DS . 'pub' . DS . 'errors' . DS . '404.php'; die; } catch (Exception $e) { self::printException($e); die; } }
/** * @static * @param string $code * @param string $type * @param array $options * @param string|array $modules */ public static function init($code = '', $type = 'store', $options = array(), $modules = array()) { try { self::setRoot(); self::$_app = new Mage_Core_Model_App(); self::_setIsInstalled($options); self::_setConfigModel($options); if (!empty($modules)) { self::$_app->initSpecified($code, $type, $options, $modules); } else { self::$_app->init($code, $type, $options); } } catch (Mage_Core_Model_Session_Exception $e) { header('Location: ' . self::getBaseUrl()); die; } catch (Mage_Core_Model_Store_Exception $e) { require_once self::getBaseDir() . DS . 'errors' . DS . '404.php'; die; } catch (Exception $e) { self::printException($e); die; } }