当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Core_Model_App::init方法代码示例

本文整理汇总了PHP中Mage_Core_Model_App::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Core_Model_App::init方法的具体用法?PHP Mage_Core_Model_App::init怎么用?PHP Mage_Core_Model_App::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Core_Model_App的用法示例。


在下文中一共展示了Mage_Core_Model_App::init方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testInit

 public function testInit()
 {
     $this->assertNull($this->_model->getConfig());
     $this->_model->init('');
     $this->assertInstanceOf('Mage_Core_Model_Config', $this->_model->getConfig());
     $this->assertNotEmpty($this->_model->getConfig()->getNode());
     $this->assertContains(Mage_Core_Model_App::ADMIN_STORE_ID, array_keys($this->_model->getStores(true)));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:AppTest.php

示例2: testInit

 /**
  * @covers Mage_Core_Model_App::_initCache
  *
  * @magentoConfigFixture global/cache/id_prefix test
  * @magentoAppIsolation enabled
  */
 public function testInit()
 {
     $this->assertNull($this->_model->getConfig());
     $this->_model->init('');
     $this->assertInstanceOf('Mage_Core_Model_Config', $this->_model->getConfig());
     $this->assertNotEmpty($this->_model->getConfig()->getNode());
     $this->assertContains(Mage_Core_Model_App::ADMIN_STORE_ID, array_keys($this->_model->getStores(true)));
     // Check that we have shared cache object inside of object manager
     $objectManager = Mage::getObjectManager();
     /** @var $cache Mage_Core_Model_Cache */
     $cache = $objectManager->get('Mage_Core_Model_Cache');
     $this->assertAttributeEquals('test', '_idPrefix', $cache);
 }
开发者ID:natxetee,项目名称:magento2,代码行数:19,代码来源:AppTest.php

示例3: initApp

 /**
  * Initialize an application
  *
  * @param   string $code
  * @param   string $type
  * @param   string|array $options
  */
 public static function initApp($code = '', $type = 'store', $options = array())
 {
     include BP . '/lib/Varien/Object.php';
     include BP . '/app/code/core/Mage/Core/Model/App.php';
     include BP . '/app/code/core/Mage/Core/Model/App_Area.php';
     include BP . '/app/code/core/Mage/Core/Model/Config.php';
     include BP . '/app/code/core/Mage/Core/Model/Store.php';
     include BP . '/lib/Varien/Event/Collection.php';
     if (VPROF) {
         Varien_Profiler::start('mage::app::construct');
     }
     self::$_app = new Mage_Core_Model_App();
     if (VPROF) {
         Varien_Profiler::stop('mage::app::construct');
     }
     AO::setRoot();
     AO::register('events', new Varien_Event_Collection());
     if (VPROF) {
         Varien_Profiler::start('mage::app::register_config');
     }
     AO::$_coreConfig = new Mage_Core_Model_Config();
     if (VPROF) {
         Varien_Profiler::stop('mage::app::register_config');
     }
     if (VPROF) {
         Varien_Profiler::start('mage::app::init');
     }
     self::$_app->init($code, $type, $options);
     if (VPROF) {
         Varien_Profiler::stop('mage::app::init');
     }
     self::$_app->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
 }
开发者ID:ronseigel,项目名称:agent-ohm,代码行数:40,代码来源:AO.php

示例4: app

 /**
  * Initialize and retrieve application
  *
  * @param   string $code
  * @param   string $type
  * @param   string $etcDir
  * @return  Mage_Core_Model_App
  */
 public static function app($code = '', $type = 'store', $etcDir = null)
 {
     if (is_null(self::$_app)) {
         Varien_Profiler::start('app/init');
         self::$_app = new Mage_Core_Model_App();
         Mage::setRoot();
         Mage::register('events', new Varien_Event_Collection());
         Mage::register('config', new Mage_Core_Model_Config());
         self::$_app->init($code, $type, $etcDir);
         self::$_app->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
     }
     return self::$_app;
 }
开发者ID:arslbbt,项目名称:mangentovies,代码行数:21,代码来源:Mage.php

示例5: app

 /**
  * Get initialized application object.
  *
  * @param string $code
  * @param string $type
  * @param string|array $options
  * @return Mage_Core_Model_App
  */
 public static function app($code = '', $type = 'store', $options = array())
 {
     if (null === self::$_app) {
         self::$_app = new Mage_Core_Model_App();
         self::setRoot();
         self::$_events = new Varien_Event_Collection();
         self::$_config = new Mage_Core_Model_Config();
         Varien_Profiler::start('self::app::init');
         self::$_app->init($code, $type, $options);
         Varien_Profiler::stop('self::app::init');
         self::$_app->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
     }
     return self::$_app;
 }
开发者ID:lightyoruichi,项目名称:Magento-Pre-Patched-Files,代码行数:22,代码来源:Mage.php

示例6: init

 /**
  * @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;
     }
 }
开发者ID:natxetee,项目名称:magento2,代码行数:27,代码来源:Mage.php

示例7: init

 /**
  * @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;
     }
 }
开发者ID:evgeniarudoman,项目名称:magento-ce-1.9,代码行数:30,代码来源:Mage.php


注:本文中的Mage_Core_Model_App::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。