예제 #1
0
 /**
  * Initialize dependencies
  *
  * @param Magento_ObjectManager $objectManager
  * @param Mage_Core_Model_Config $config
  * @param Mage_Core_Model_Translate $translator
  */
 public function __construct(Magento_ObjectManager $objectManager, Mage_Core_Model_Config $config, Mage_Core_Model_Translate $translator)
 {
     $this->_objectManager = $objectManager;
     $this->_config = $config;
     $this->_translator = $translator;
     $this->_configFiles = $this->_config->getModuleConfigurationFiles('validation.xml');
     $this->_initializeDefaultTranslator();
 }
예제 #2
0
 /**
  * Load system configuration
  *
  * @return Mage_Backend_Model_Config_Structure
  */
 public function getConfiguration()
 {
     if ($this->_cache->canUse('config')) {
         $cache = $this->_cache->load(self::CACHE_SYSTEM_CONFIGURATION_STRUCTURE);
         if ($cache) {
             return unserialize($cache);
         }
     }
     $fileNames = $this->_appConfig->getModuleConfigurationFiles('adminhtml' . DIRECTORY_SEPARATOR . 'system.xml');
     $config = $this->_appConfig->getModelInstance('Mage_Backend_Model_Config_Structure', array('sourceFiles' => $fileNames));
     if ($this->_cache->canUse('config')) {
         $this->_cache->save(serialize($config), self::CACHE_SYSTEM_CONFIGURATION_STRUCTURE, array(Mage_Core_Model_Config::CACHE_TAG));
     }
     return $config;
 }
예제 #3
0
 /**
  * @param Mage_Core_Model_Config $config
  * @param Mage_Core_Model_Cache $cache
  * @param Mage_Backend_Model_Config_Structure_Converter $structureConverter
  * @param bool $runtimeValidation
  */
 public function __construct(Mage_Core_Model_Config $config, Mage_Core_Model_Cache $cache, Mage_Backend_Model_Config_Structure_Converter $structureConverter, $runtimeValidation = true)
 {
     $this->_runtimeValidation = $runtimeValidation;
     $this->_converter = $structureConverter;
     $this->_config = $config;
     if ($cache->canUse('config') && ($cachedData = $cache->load(self::CACHE_SYSTEM_CONFIGURATION_STRUCTURE))) {
         $this->_data = unserialize($cachedData);
     } else {
         $fileNames = $this->_config->getModuleConfigurationFiles('adminhtml' . DIRECTORY_SEPARATOR . 'system.xml');
         parent::__construct($fileNames);
         if ($cache->canUse('config')) {
             $cache->save(serialize($this->_data), self::CACHE_SYSTEM_CONFIGURATION_STRUCTURE, array(Mage_Core_Model_Config::CACHE_TAG));
         }
     }
 }
예제 #4
0
파일: Config.php 프로젝트: nemphys/magento2
 /**
  * Retrieve list of acl files from each module
  *
  * @return array
  */
 protected function _getAclResourceFiles()
 {
     $files = $this->_config->getModuleConfigurationFiles('adminhtml' . DIRECTORY_SEPARATOR . 'acl.xml');
     return (array) $files;
 }
예제 #5
0
파일: Config.php 프로젝트: rorteg/magento2
 /**
  * Return array menu configuration files
  *
  * @return array
  */
 public function getMenuConfigurationFiles()
 {
     $files = $this->_appConfig->getModuleConfigurationFiles('adminhtml' . DIRECTORY_SEPARATOR . 'menu.xml');
     return (array) $files;
 }