本文整理汇总了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)));
}
示例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));
}
示例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;
}
示例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;
}
示例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;
}