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


PHP Mage_Core_Model_Config::setOptions方法代码示例

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


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

示例1: setUp

    public function setUp()
    {
        $this->_config = new Mage_Core_Model_Config(<<<XML
            <config>
                <global>
                    <cache>
                        <types>
                            <single_tag>
                                <label>Tag One</label>
                                <description>This is Tag One</description>
                                <tags>tag_one</tags>
                            </single_tag>
                            <multiple_tags>
                                <label>Tags One and Two</label>
                                <description>These are Tags One and Two</description>
                                <tags>tag_one,tag_two</tags>
                            </multiple_tags>
                        </types>
                    </cache>
                </global>
            </config>
XML
);
        $this->_helper = $this->getMock('Mage_Core_Helper_Data', array('__'));
        $this->_helper->expects($this->any())->method('__')->will($this->returnArgument(0));
        $this->_config->setOptions(array('cache_dir' => __DIR__, 'etc_dir' => __DIR__));
        $this->_cacheFrontend = $this->getMock('Zend_Cache_Core', array('load', 'test', 'save', 'remove', 'clean', '_getHelper'));
        $this->_requestProcessor = $this->getMock('stdClass', array('extractContent'));
        $this->_model = new Mage_Core_Model_Cache(array('config' => $this->_config, 'helper' => $this->_helper, 'frontend' => $this->_cacheFrontend, 'backend' => 'BlackHole', 'request_processors' => array($this->_requestProcessor)));
    }
开发者ID:nemphys,项目名称:magento2,代码行数:30,代码来源:CacheTest.php

示例2: testLoadBaseLocalConfig

 /**
  * @param string $etcDir
  * @param string $option
  * @param string $expectedNode
  * @param string $expectedValue
  * @dataProvider loadBaseLocalConfigDataProvider
  */
 public function testLoadBaseLocalConfig($etcDir, $option, $expectedNode, $expectedValue)
 {
     $model = new Mage_Core_Model_Config();
     $model->setOptions(array('etc_dir' => __DIR__ . "/_files/local_config/{$etcDir}", 'local_config' => $option));
     $model->loadBase();
     $this->assertInstanceOf('Varien_Simplexml_Element', $model->getNode($expectedNode));
     $this->assertEquals($expectedValue, (string) $model->getNode($expectedNode));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:15,代码来源:ConfigTest.php

示例3: baseInit

 /**
  * Common logic for all run types
  *
  * @param  string|array $options
  * @return Mage_Core_Model_App
  */
 public function baseInit($options)
 {
     $this->_initEnvironment();
     $this->_config = Mage::getConfig();
     $this->_config->setOptions($options);
     $this->_initBaseConfig();
     $cacheInitOptions = is_array($options) && array_key_exists('cache', $options) ? $options['cache'] : array();
     $this->_initCache($cacheInitOptions);
     return $this;
 }
开发者ID:mswebdesign,项目名称:Mswebdesign_Magento_1_Community_Edition,代码行数:16,代码来源:App.php

示例4: baseInit

 /**
  * Common logic for all run types
  *
  * @param  string|array $options
  * @return Mage_Core_Model_App
  */
 public function baseInit($options)
 {
     $this->_initEnvironment();
     $this->_config = Mage::getConfig();
     $this->_config->setOptions($options);
     $this->_initBaseConfig();
     $this->_initCache();
     return $this;
 }
开发者ID:xiaoguizhidao,项目名称:emporiodopara,代码行数:15,代码来源:App.php

示例5: run

 /**
  * Run application. Run process responsible for request processing and sending response.
  * List of suppported parametes:
  *  scope_code - code of default scope (website/store_group/store code)
  *  scope_type - type of default scope (website/group/store)
  *  options    - configuration options
  *
  * @param array $params application run parameters
  *
  * @return Mage_Core_Model_App
  */
 public function run($params)
 {
     $scopeCode = isset($params['scope_code']) ? $params['scope_code'] : '';
     $scopeType = isset($params['scope_type']) ? $params['scope_type'] : 'store';
     $options = isset($params['options']) ? $params['options'] : array();
     $this->_initEnvironment();
     $this->_config = Mage::getConfig();
     $this->_config->setOptions($options);
     $this->_initBaseConfig();
     $this->_initCache();
     if ($this->_cache->processRequest()) {
         $this->getResponse()->sendResponse();
     } else {
         $this->_initModules();
         $this->loadAreaPart(Mage_Core_Model_App_Area::AREA_GLOBAL, Mage_Core_Model_App_Area::PART_EVENTS);
         if ($this->_config->isLocalConfigLoaded()) {
             $this->_initCurrentStore($scopeCode, $scopeType);
             $this->_initRequest();
             Mage_Core_Model_Resource_Setup::applyAllDataUpdates();
         }
         $this->getFrontController()->dispatch();
     }
     return $this;
 }
开发者ID:jpbender,项目名称:mage_virtual,代码行数:35,代码来源:App.php


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