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


PHP Mage_Core_Model_Config::getOptions方法代码示例

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


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

示例1: testConstructor

 /**
  * @param mixed $data
  * @param array $map
  * @dataProvider constructorDataProvider
  */
 public function testConstructor($data, $map)
 {
     //TODO: We should not use mocks in integration tests
     /** @var Magento_ObjectManager_Zend|PHPUnit_Framework_MockObject_MockObject $objectManagerMock */
     $objectManagerMock = $this->getMock('Magento_ObjectManager_Zend', array('create', 'get'), array(), '', false);
     $objectManagerMock->expects($this->any())->method('create')->will($this->returnValueMap(array($map, array('Mage_Core_Model_Config_Base', array(), true, new Mage_Core_Model_Config_Base()))));
     $this->_model = new Mage_Core_Model_Config($objectManagerMock, $data);
     $this->assertInstanceOf('Mage_Core_Model_Config_Options', $this->_model->getOptions());
 }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例2: addStreamLog

 /**
  * Add a logger by specified key
  *
  * Second argument is a file name (relative to log directory) or a PHP "wrapper"
  *
  * @param string $loggerKey
  * @param string $fileOrWrapper
  * @return Mage_Core_Model_Logger
  * @link http://php.net/wrappers
  */
 public function addStreamLog($loggerKey, $fileOrWrapper = '')
 {
     $file = $fileOrWrapper ?: "{$loggerKey}.log";
     if (!preg_match('#^[a-z][a-z0-9+.-]*\\://#i', $file)) {
         $file = $this->_config->getOptions()->getLogDir() . DIRECTORY_SEPARATOR . $file;
     }
     $writerClass = (string) $this->_config->getNode('global/log/core/writer_model');
     if (!$writerClass || !is_subclass_of($writerClass, 'Zend_Log_Writer_Stream')) {
         $writerClass = 'Zend_Log_Writer_Stream';
     }
     /** @var $writer Zend_Log_Writer_Stream */
     $writer = $writerClass::factory(array('stream' => $file));
     $writer->setFormatter(new Zend_Log_Formatter_Simple('%timestamp% %priorityName% (%priority%): %message%' . PHP_EOL));
     $this->_loggers[$loggerKey] = new Zend_Log($writer);
     return $this;
 }
开发者ID:,项目名称:,代码行数:26,代码来源:

示例3: execute

 /**
  * Execute command
  *
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return void
  *
  * @throws InvalidArgumentException
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->detectMagento($output, true);
     if (false === $this->initMagento()) {
         throw new RuntimeException('Magento could not be loaded');
     }
     $this->config = \Mage::getConfig();
     $this->modulesDir = $this->config->getOptions()->getEtcDir() . DS . 'modules' . DS;
     if ($codePool = $input->getOption('codepool')) {
         $output->writeln('<info>' . ($this->commandName == 'enable' ? 'Enabling' : 'Disabling') . ' modules in <comment>' . $codePool . '</comment> codePool...</info>');
         $this->enableCodePool($codePool, $output);
     } elseif ($module = $input->getArgument('moduleName')) {
         $this->enableModule($module, $output);
     } else {
         throw new InvalidArgumentException('No code-pool option nor module-name argument');
     }
 }
开发者ID:netz98,项目名称:n98-magerun,代码行数:27,代码来源:AbstractCommand.php

示例4: getImgDir

 /**
  * Get captcha image directory
  *
  * @param mixed $website
  * @return string
  */
 public function getImgDir($website = null)
 {
     $mediaDir = $this->_config->getOptions()->getDir('media');
     $captchaDir = Magento_Filesystem::getPathFromArray(array($mediaDir, 'captcha', $this->_app->getWebsite($website)->getCode()));
     $this->_filesystem->setWorkingDirectory($mediaDir);
     $this->_filesystem->setIsAllowCreateDirectories(true);
     $this->_filesystem->ensureDirectoryExists($captchaDir, 0755);
     return $captchaDir . Magento_Filesystem::DIRECTORY_SEPARATOR;
 }
开发者ID:,项目名称:,代码行数:15,代码来源:

示例5: getViewFile

 /**
  * Get theme file name, using fallback mechanism
  *
  * @param string $file
  * @param string|null $module
  * @return string
  */
 public function getViewFile($file, $module = null)
 {
     $dir = $this->_appConfig->getOptions()->getDesignDir();
     $moduleDir = $module ? $this->_appConfig->getModuleDir('view', $module) : '';
     $dirs = array();
     $themeModel = $this->_theme;
     while ($themeModel) {
         list($package, $theme) = $this->_getInheritedTheme($themeModel);
         $dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/locale/{$this->_locale}";
         $dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}";
         $themeModel = $themeModel->getParentTheme();
     }
     $extraDirs = array($this->_appConfig->getOptions()->getJsDir(), Mage::getDesign()->getCustomizationDir());
     return $this->_fallback($file, $dirs, $module, array("{$moduleDir}/{$this->_area}/locale/{$this->_locale}", "{$moduleDir}/{$this->_area}"), $extraDirs);
 }
开发者ID:,项目名称:,代码行数:22,代码来源:

示例6: getSkinFile

 /**
  * Get skin file name, using fallback mechanism
  *
  * @param string $file
  * @param string|null $module
  * @return string
  */
 public function getSkinFile($file, $module = null)
 {
     $dir = $this->_appConfig->getOptions()->getDesignDir();
     $moduleDir = $module ? $this->_appConfig->getModuleDir('view', $module) : '';
     $defaultSkin = Mage_Core_Model_Design_Package::DEFAULT_SKIN_NAME;
     $dirs = array();
     $theme = $this->_theme;
     $package = $this->_package;
     while ($theme) {
         $dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/skin/{$this->_skin}/locale/{$this->_locale}";
         $dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/skin/{$this->_skin}";
         if ($this->_skin != $defaultSkin) {
             $dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/skin/{$defaultSkin}/locale/{$this->_locale}";
             $dirs[] = "{$dir}/{$this->_area}/{$package}/{$theme}/skin/{$defaultSkin}";
         }
         list($package, $theme) = $this->_getInheritedTheme($package, $theme);
     }
     return $this->_fallback($file, $dirs, $module, array("{$moduleDir}/{$this->_area}/locale/{$this->_locale}", "{$moduleDir}/{$this->_area}"), array($this->_appConfig->getOptions()->getJsDir()));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:26,代码来源:Fallback.php

示例7: _initOptions

 /**
  * Initialize cache types options
  *
  * @return Mage_Core_Model_Cache
  */
 protected function _initOptions()
 {
     $options = $this->load(self::OPTIONS_CACHE_ID);
     if ($options === false) {
         $options = $this->_getResource()->getAllOptions();
         if (is_array($options)) {
             $this->_allowedCacheOptions = $options;
             $this->save(serialize($this->_allowedCacheOptions), self::OPTIONS_CACHE_ID);
         } else {
             $this->_allowedCacheOptions = array();
         }
     } else {
         $this->_allowedCacheOptions = unserialize($options);
     }
     if ($this->_config->getOptions()->getData('global_ban_use_cache')) {
         foreach ($this->_allowedCacheOptions as $key => $val) {
             $this->_allowedCacheOptions[$key] = false;
         }
     }
     return $this;
 }
开发者ID:natxetee,项目名称:magento2,代码行数:26,代码来源:Cache.php

示例8: getUseCacheFilename

 /**
  * Get file name with cache configuration settings
  *
  * @deprecated after 1.4.0.0-alpha3, functionality implemented in Mage_Core_Model_Cache
  * @return string
  */
 public function getUseCacheFilename()
 {
     return $this->_config->getOptions()->getEtcDir() . DS . 'use_cache.ser';
 }
开发者ID:mswebdesign,项目名称:Mswebdesign_Magento_1_Community_Edition,代码行数:10,代码来源:App.php

示例9: _collectConfigFolders

 /**
  * @return array List of all "etc" folders
  */
 private function _collectConfigFolders()
 {
     $folders = array($this->_config->getOptions()->getEtcDir());
     return $this->_addModuleFolders($folders);
 }
开发者ID:inviqa,项目名称:magento-symfony-container,代码行数:8,代码来源:ConfigurationBuilder.php

示例10: testConstructor

 /**
  * @dataProvider constructorDataProvider
  */
 public function testConstructor($data)
 {
     $this->_model = new Mage_Core_Model_Config($data);
     $this->assertInstanceOf('Mage_Core_Model_Config_Options', $this->_model->getOptions());
 }
开发者ID:nemphys,项目名称:magento2,代码行数:8,代码来源:ConfigTest.php


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