• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mage_Core_Model_Config_Base类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: loadPackageConfiguration

 /**
  * Iterate all active modules "etc" folders and combine data from
  * specidied xml file name to one object
  *
  * @param   string $fileName
  * @param   null|Mage_Core_Model_Config_Base $mergeToObject
  * @return  Mage_Core_Model_Config_Base
  */
 public function loadPackageConfiguration($mergeToObject = null, $mergeModel = null)
 {
     if ($mergeToObject === null) {
         $mergeToObject = new Mage_Core_Model_Config_Base();
         $mergeToObject->loadString('<config/>');
     }
     if ($mergeModel === null) {
         $mergeModel = new Mage_Core_Model_Config_Base();
     }
     $channels = Mage::getModel('channel/channel')->getCollection();
     foreach ($channels as $id => $channel) {
         // if the store is an activated channel
         if ($channel->load($id)->isChannel()) {
             if ($mergeModel->loadString($channel->getApiConfig())) {
                 $mergeToObject->extend($mergeModel, true);
             }
         }
     }
     /* $packages = Mage::getModel('catalog/product')
                 ->getCollection()
                 ->addFieldToFilter(
                 	'type_id',
                     Faett_Package_Model_Product_Type::TYPE_PACKAGE
                 );
     
             foreach ($packages as $id => $package) {
                 if ($mergeModel->loadString($package->load($id)->getApiConfig())) {
                     $mergeToObject->extend($mergeModel, true);
                 }
             } */
     return $mergeToObject;
 }
开发者ID:BGCX067,项目名称:faett-channel-svn-to-git,代码行数:40,代码来源:Config.php


示例2: loadPackageConfiguration

 /**
  * Iterate all active modules "etc" folders and combine data from
  * specidied xml file name to one object
  *
  * @param   string $fileName
  * @param   null|Mage_Core_Model_Config_Base $mergeToObject
  * @return  Mage_Core_Model_Config_Base
  */
 public function loadPackageConfiguration($mergeToObject = null, $mergeModel = null)
 {
     // initialize the configuration XML structure to append
     if ($mergeToObject === null) {
         $mergeToObject = new Mage_Core_Model_Config_Base();
         $mergeToObject->loadString('<config/>');
     }
     // initialize the configuration XML structure
     if ($mergeModel === null) {
         $mergeModel = new Mage_Core_Model_Config_Base();
     }
     // load the Collection with all channels
     $channels = Mage::getModel('channel/channel')->getCollection();
     // iterate over the channels
     foreach ($channels as $id => $channel) {
         // if the store is an activated channel
         if ($channel->load($id)->isChannel()) {
             // merge the channel to the ACL's
             if ($mergeModel->loadString($channel->getApiConfig())) {
                 $mergeToObject->extend($mergeModel, true);
             }
             // load the package Collection
             $packages = Mage::helper('channel')->getPackageCollection($channel);
             // merge the packages to the channel's ACL's
             foreach ($packages as $id => $package) {
                 if ($mergeModel->loadString($package->load($id)->getApiConfig($channel))) {
                     $mergeToObject->extend($mergeModel, true);
                 }
             }
         }
     }
     // return the configuration structure
     return $mergeToObject;
 }
开发者ID:BGCX067,项目名称:faett-channel-svn-to-git,代码行数:42,代码来源:Config.php


示例3: extendConfig

 /**
  * Extend extra configs from etc folder of module on system init configs
  *
  * @param Varien_Event_Observer $observer
  */
 public function extendConfig($observer)
 {
     $storeCode = Mage::helper("jmbasetheme")->getCurrentStoreCode("backend");
     $profiles = array_keys(Mage::helper("jmbasetheme")->getProfiles($storeCode));
     $mergeObject = new Mage_Core_Model_Config_Base();
     $profilePath = Mage::helper("jmbasetheme")->getProfilePath($storeCode);
     foreach ($profiles as $profile) {
         if (file_exists($profilePath . "core" . DS . $profile . ".xml")) {
             $mergeObject->loadFile($profilePath . "core" . DS . $profile . ".xml");
         } else {
             $mergeObject->loadFile($profilePath . "local" . DS . $profile . ".xml");
         }
         $observer->config->extend($mergeObject, false);
     }
     if (file_exists($profilePath . "core" . DS . "core.xml")) {
         $mergeObject->loadFile($profilePath . "core" . DS . "core.xml");
         $observer->config->extend($mergeObject, false);
     }
     //extend tablet settings
     $mergeObject->loadFile(Mage::getModuleDir('etc', 'Wavethemes_Jmbasetheme') . "/device.xml");
     $observer->config->extend($mergeObject, false);
     //extend mobile settings
     $mergeObject->loadFile(Mage::getModuleDir('etc', 'Wavethemes_Jmbasetheme') . "/mobile.xml");
     $observer->config->extend($mergeObject, false);
 }
开发者ID:kozinthetdbp,项目名称:megamall,代码行数:30,代码来源:Observer.php


示例4: testConstruct

    public function testConstruct()
    {
        $config = new Mage_Core_Model_Config_Base(<<<XML
<?xml version="1.0"?>
<root><key>value</key></root>
XML
);
        $this->assertInstanceOf('Mage_Core_Model_Config_Element', $config->getNode('key'));
    }
开发者ID:relue,项目名称:magento2,代码行数:9,代码来源:BaseTest.php


示例5: addMageOneFourConfig

 public function addMageOneFourConfig($observer)
 {
     if (version_compare(Mage::getVersion(), '1.5.0.0', '<')) {
         $file = Mage::getModuleDir('etc', 'MageBase_DpsPaymentExpress') . DS . 'config-1.4.xml';
         $config = Mage::getConfig();
         $prototype = new Mage_Core_Model_Config_Base();
         $prototype->loadFile($file);
         $config->extend($prototype);
         $config->saveCache();
     }
 }
开发者ID:mVentory,项目名称:magebase_paymentexpress,代码行数:11,代码来源:Observer.php


示例6: _initSectionsAndTabs

 protected function _initSectionsAndTabs()
 {
     if (Mage::helper('advanced')->isAnyStoreDisabled()) {
         $mergeConfig = Mage::getModel('core/config_base');
         $config = Mage::getConfig()->loadModulesConfiguration('system.xml');
         //these 4 lines are the only added content
         $configFile = Mage::helper('advanced')->getEtcPath() . DS . 'system-disabled.xml';
         $mergeModel = new Mage_Core_Model_Config_Base();
         $mergeModel->loadFile($configFile);
         $config = $config->extend($mergeModel, true);
         $this->_sections = $config->getNode('sections');
         $this->_tabs = $config->getNode('tabs');
     } else {
         return parent::_initSectionsAndTabs();
     }
     return parent::_initSectionsAndTabs();
 }
开发者ID:naz-ahmed,项目名称:ndap-magento-mirror,代码行数:17,代码来源:Config.php


示例7: Extendconfig

 public function Extendconfig($observer)
 {
     $profiles = array_keys(Mage::helper("jmbasetheme")->getProfiles());
     $mergeobject = new Mage_Core_Model_Config_Base();
     foreach ($profiles as $profile) {
         if (file_exists(Mage::helper("jmbasetheme")->getprofileFolder() . DS . "core" . DS . $profile . ".xml")) {
             $mergeobject->loadFile(Mage::helper("jmbasetheme")->getprofileFolder() . DS . "core" . DS . $profile . ".xml");
         } else {
             $mergeobject->loadFile(Mage::helper("jmbasetheme")->getprofileFolder() . DS . "local" . DS . $profile . ".xml");
         }
         $observer->config->extend($mergeobject, false);
     }
     if (file_exists(Mage::helper("jmbasetheme")->getprofileFolder() . DS . "core" . DS . "core.xml")) {
         $mergeobject->loadFile(Mage::helper("jmbasetheme")->getprofileFolder() . DS . "core" . DS . "core.xml");
         $observer->config->extend($mergeobject, false);
     }
     //extend tablet settings
     $mergeobject->loadFile(Mage::getModuleDir('etc', 'Wavethemes_Jmbasetheme') . "/device.xml");
     $observer->config->extend($mergeobject, false);
     //extend mobile settings
     $mergeobject->loadFile(Mage::getModuleDir('etc', 'Wavethemes_Jmbasetheme') . "/mobile.xml");
     $observer->config->extend($mergeobject, false);
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:23,代码来源:Observer.php


示例8: _checkBaseUrl

 /**
  * Check base url settings, if not set it rises an exception
  *
  * @param Mage_Core_Model_Config_Base $original
  * @param Mage_Core_Model_Config_Base $test
  * @return EcomDev_PHPUnit_Model_Config
  * @throws RuntimeException
  */
 protected function _checkBaseUrl($original, $test)
 {
     $baseUrlSecure = (string) $test->getNode(self::XML_PATH_SECURE_BASE_URL);
     $baseUrlUnsecure = (string) $test->getNode(self::XML_PATH_UNSECURE_BASE_URL);
     if (empty($baseUrlSecure) || empty($baseUrlUnsecure) || $baseUrlSecure == self::CHANGE_ME || $baseUrlUnsecure == self::CHANGE_ME) {
         throw new RuntimeException('The base url is not set for proper controller tests. ' . 'Please run ecomdev-phpunit.php with magento-config action.');
     }
 }
开发者ID:cmuench,项目名称:EcomDev_PHPUnit,代码行数:16,代码来源:Config.php


示例9: mergeConfig

 public function mergeConfig($mergeToObject, $extensions)
 {
     foreach ($extensions as $extension) {
         if ($extension) {
             $mergeModel = new Mage_Core_Model_Config_Base();
             if ($mergeModel->loadString($extension)) {
                 $mergeToObject->extend($mergeModel->getNode(), true);
             }
         }
     }
     return $mergeToObject;
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:12,代码来源:Data.php


示例10: _checkBaseUrl

 /**
  * Check base url settings, if not set it rises an exception
  *
  * @param Mage_Core_Model_Config_Base $original
  * @param Mage_Core_Model_Config_Base $test
  * @return Mage_Test_Model_Config
  * @throws RuntimeException
  */
 protected function _checkBaseUrl($original, $test)
 {
     $baseUrlSecure = (string) $test->getNode(self::XML_PATH_SECURE_BASE_URL);
     $baseUrlUnsecure = (string) $test->getNode(self::XML_PATH_UNSECURE_BASE_URL);
     if (empty($baseUrlSecure) || empty($baseUrlUnsecure) || $baseUrlSecure == self::CHANGE_ME || $baseUrlUnsecure == self::CHANGE_ME) {
         echo sprintf('Please change values in %s file for nodes %s and %s. ' . 'It will help in setting up proper controller test cases', 'app/etc/local.xml.phpunit', self::XML_PATH_SECURE_BASE_URL, self::XML_PATH_UNSECURE_BASE_URL);
         exit;
     }
 }
开发者ID:NatashaOlut,项目名称:Mage_Test,代码行数:17,代码来源:Config.php


示例11: isModuleEnabled

 public function isModuleEnabled($module)
 {
     $fileConfig = new Mage_Core_Model_Config_Base();
     $fileConfig->loadFile(Mage::getBaseDir('etc') . DS . 'modules' . DS . $module . '.xml');
     $isActive = $fileConfig->getNode('modules/' . $module . '/active');
     if (!$isActive || !in_array((string) $isActive, array('true', '1'))) {
         return false;
     }
     return true;
 }
开发者ID:rcclaudrey,项目名称:dev,代码行数:10,代码来源:Front.php


示例12: _loadDeclaredModules

 /**
  * Load declared modules configuration
  *
  * @return  Mage_Core_Model_Config
  */
 protected function _loadDeclaredModules()
 {
     Magento_Profiler::start('load_modules_files');
     $moduleFiles = $this->_getDeclaredModuleFiles();
     if (!$moduleFiles) {
         return $this;
     }
     Magento_Profiler::stop('load_modules_files');
     Magento_Profiler::start('load_modules_declaration');
     $unsortedConfig = new Mage_Core_Model_Config_Base('<config/>');
     $emptyConfig = new Mage_Core_Model_Config_Element('<config><modules/></config>');
     $declaredModules = array();
     foreach ($moduleFiles as $oneConfigFile) {
         $path = explode(DIRECTORY_SEPARATOR, $oneConfigFile);
         $moduleConfig = new Mage_Core_Model_Config_Base($oneConfigFile);
         $modules = $moduleConfig->getXpath('modules/*');
         if (!$modules) {
             continue;
         }
         $cPath = count($path);
         if ($cPath > 4) {
             $moduleName = $path[$cPath - 4] . '_' . $path[$cPath - 3];
             $this->_modulesCache[$moduleName] = $moduleConfig;
         }
         foreach ($modules as $module) {
             $moduleName = $module->getName();
             $isActive = (string) $module->active;
             if (isset($declaredModules[$moduleName])) {
                 $declaredModules[$moduleName]['active'] = $isActive;
                 continue;
             }
             $newModule = clone $emptyConfig;
             $newModule->modules->appendChild($module);
             $declaredModules[$moduleName] = array('active' => $isActive, 'module' => $newModule);
         }
     }
     foreach ($declaredModules as $moduleName => $module) {
         if ($module['active'] == 'true') {
             $module['module']->modules->{$moduleName}->active = 'true';
             $unsortedConfig->extend(new Mage_Core_Model_Config_Base($module['module']));
         }
     }
     $sortedConfig = new Mage_Core_Model_Config_Module($unsortedConfig, $this->_allowedModules);
     $this->extend($sortedConfig);
     Magento_Profiler::stop('load_modules_declaration');
     return $this;
 }
开发者ID:nemphys,项目名称:magento2,代码行数:52,代码来源:Config.php


示例13: _getClassConfig

 /**
  * @param $type
  * @param Mage_Core_Model_Config_Base $moduleConfig
  * @return Mage_Core_Model_Config_Element
  */
 protected function _getClassConfig($type, Mage_Core_Model_Config_Base $moduleConfig)
 {
     $xpath = "global/{$type}s/*[class]";
     $classConfigs = $moduleConfig->getNode()->xpath($xpath);
     if ($classConfigs) {
         return $classConfigs[0];
     }
     return false;
 }
开发者ID:Wohlie,项目名称:phpstorm-magento-mapper,代码行数:14,代码来源:generate-phpstorm-map.php


示例14: initFields

    /**
     * Init fieldset fields
     *
     * @param Varien_Data_Form_Element_Fieldset $fieldset
     * @param Varien_Simplexml_Element $group
     * @param Varien_Simplexml_Element $section
     * @param string $fieldPrefix
     * @param string $labelPrefix
     * @return Soon_StockReleaser_Block_Adminhtml_System_Config_Form
     */
    public function initFields($fieldset, $group, $section, $fieldPrefix = '', $labelPrefix = '')
    {
        if (!$group->is('use_custom_form', 1)) {
            return parent::initFields($fieldset, $group, $section, $fieldPrefix = '', $labelPrefix = '');
        }
        if (!$this->_configDataObject) {
            $this->_initObjects();
        }
        // Extends for config data
        $configDataAdditionalGroups = array();
        $paymentMethods = Mage::helper('payment')->getPaymentMethods();
        $xmlString = "<config><fields>";
        $sort_order = 0;
        foreach ($paymentMethods as $code => $paymentMethod) {
            if (!isset($paymentMethod['active']) || $paymentMethod['active'] == 0) {
                continue;
            }
            ++$sort_order;
            $xmlString .= '
        		<' . $code . ' translate="label">
                            <label>' . $paymentMethod['title'] . '</label>
                            <frontend_type>text</frontend_type>
                            <sort_order>' . $sort_order . '</sort_order>
                            <validate>validate-number</validate>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
			</' . $code . '>';
            ++$sort_order;
            $xmlString .= '                    
        		<' . $code . '-unit translate="label">
                            <frontend_type>select</frontend_type>
                            <source_model>stockreleaser/system_config_source_unit</source_model>
                            <sort_order>' . $sort_order . '</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
			</' . $code . '-unit>';
        }
        $xmlString .= "</fields></config>";
        $element = new Mage_Core_Model_Config_Base();
        $element->loadString($xmlString);
        foreach ($element->getNode('fields') as $elements) {
            $elements = (array) $elements;
            // sort either by sort_order or by child node values bypassing the sort_order
            if ($group->sort_fields && $group->sort_fields->by) {
                $fieldset->setSortElementsByAttribute((string) $group->sort_fields->by, $group->sort_fields->direction_desc ? SORT_DESC : SORT_ASC);
            } else {
                usort($elements, array($this, '_sortForm'));
            }
            foreach ($elements as $e) {
                if (!$this->_canShowField($e)) {
                    continue;
                }
                /**
                 * Look for custom defined field path
                 */
                $path = (string) $e->config_path;
                if (empty($path)) {
                    $path = $section->getName() . '/' . $group->getName() . '/' . $fieldPrefix . $e->getName();
                } elseif (strrpos($path, '/') > 0) {
                    // Extend config data with new section group
                    $groupPath = substr($path, 0, strrpos($path, '/'));
                    if (!isset($configDataAdditionalGroups[$groupPath])) {
                        $this->_configData = $this->_configDataObject->extendConfig($groupPath, false, $this->_configData);
                        $configDataAdditionalGroups[$groupPath] = true;
                    }
                }
                $id = $section->getName() . '_' . $group->getName() . '_' . $fieldPrefix . $e->getName();
                if (isset($this->_configData[$path])) {
                    $data = $this->_configData[$path];
                    $inherit = false;
                } else {
                    $data = $this->_configRoot->descend($path);
                    $inherit = true;
                }
                if ($e->frontend_model) {
                    $fieldRenderer = Mage::getBlockSingleton((string) $e->frontend_model);
                } else {
                    $fieldRenderer = $this->_defaultFieldRenderer;
                }
                $fieldRenderer->setForm($this);
                $fieldRenderer->setConfigData($this->_configData);
                $helperName = $this->_configFields->getAttributeModule($section, $group, $e);
                $fieldType = (string) $e->frontend_type ? (string) $e->frontend_type : 'text';
                $name = 'groups[' . $group->getName() . '][fields][' . $fieldPrefix . $e->getName() . '][value]';
                $label = Mage::helper($helperName)->__($labelPrefix) . ' ' . Mage::helper($helperName)->__((string) $e->label);
                $hint = (string) $e->hint ? Mage::helper($helperName)->__((string) $e->hint) : '';
                if ($e->backend_model) {
                    $model = Mage::getModel((string) $e->backend_model);
//.........这里部分代码省略.........
开发者ID:FranchuCorraliza,项目名称:magento,代码行数:101,代码来源:Form.php


示例15: _generateClassRewriteConflictsData

 /**
  * Generate class rewrite conflicts
  *
  * @return array
  */
 protected function _generateClassRewriteConflictsData()
 {
     $modules = Mage::app()->getConfig()->getNode('modules')->children();
     $data = $systemReport = $_conflicts = $_rewrites = array();
     foreach ($modules as $modName => $module) {
         $configFile = $this->_getModulePath($modName, $this->_getModuleCodePoolByClassName($modName));
         $configFile .= 'etc' . DS . 'config.xml';
         try {
             $config = new Mage_Core_Model_Config_Base($configFile);
         } catch (Exception $e) {
             //
         }
         if (!isset($config)) {
             continue;
         }
         $classes = $config->getXpath('global/*/*/rewrite');
         if (!$classes) {
             continue;
         }
         /** @var $element Mage_Core_Model_Config_Element */
         foreach ($classes as $element) {
             //module node
             $moduleNode = $element->getParent();
             //scope node (models|blocks|helpers)
             $scopeNode = $moduleNode->getParent();
             //scope name
             $scopeName = $scopeNode->getName();
             if (!in_array($scopeName, array('models', 'blocks', 'helpers'))) {
                 continue;
             }
             /** @var $rewrite Mage_Core_Model_Config_Element */
             foreach ($element as $rewrite) {
                 $_rewriteFactoryName = $element->getParent()->getName() . '/' . $rewrite->getName();
                 if (!array_key_exists($_rewriteFactoryName, $_rewrites)) {
                     $_rewrites[$_rewriteFactoryName] = array('pool' => (string) $module->codePool, 'rewrite' => trim($rewrite), 'is_active' => $this->_isModuleActiveByClassName($modName));
                 } else {
                     if (!array_key_exists($_rewriteFactoryName, $_conflicts)) {
                         $_conflicts[$_rewriteFactoryName][] = $_rewrites[$_rewriteFactoryName];
                     }
                     $_conflicts[$_rewriteFactoryName][] = array('pool' => (string) $module->codePool, 'rewrite' => trim($rewrite), 'is_active' => $this->_isModuleActiveByClassName($modName));
                 }
             }
         }
         unset($config);
     }
     if ($_conflicts) {
         foreach ($_conflicts as $factoryName => $conflicts) {
             foreach ($conflicts as $conflict) {
                 $data[] = array($factoryName, $conflict['rewrite'] . "\n" . '    {' . $this->_getClassPath($conflict['rewrite'], $conflict['pool']) . '}', $conflict['is_active'] ? 'Yes' : 'No');
             }
         }
     }
     $systemReport['Class Rewrite Conflicts'] = array('header' => array('Factory Name', 'Class', 'Is Active'), 'data' => $data);
     return $systemReport;
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:60,代码来源:Tool.php


示例16: _makeEventsLowerCase

 /**
  * Makes all events to lower-case
  *
  * @param string $area
  * @param Mage_Core_Model_Config_Base $mergeModel
  */
 protected function _makeEventsLowerCase($area, Mage_Core_Model_Config_Base $mergeModel)
 {
     $events = $mergeModel->getNode($area . "/" . Mage_Core_Model_App_Area::PART_EVENTS);
     if ($events !== false) {
         $children = clone $events->children();
         /** @var Mage_Core_Model_Config_Element $event */
         foreach ($children as $event) {
             if ($this->_isNodeNameHasUpperCase($event)) {
                 $oldName = $event->getName();
                 $newEventName = strtolower($oldName);
                 if (!isset($events->{$newEventName})) {
                     /** @var Mage_Core_Model_Config_Element $newNode */
                     $newNode = $events->addChild($newEventName, $event);
                     $newNode->extend($event);
                 }
                 unset($events->{$oldName});
             }
         }
     }
 }
开发者ID:mswebdesign,项目名称:Mswebdesign_Magento_1_Community_Edition,代码行数:26,代码来源:Config.php


示例17: _loadDeclaredModules

 /**
  * Load declared modules configuration
  *
  * @param   null $mergeConfig depricated
  * @return  Mage_Core_Model_Config
  */
 protected function _loadDeclaredModules($mergeConfig = null)
 {
     $moduleFiles = $this->_getDeclaredModuleFiles();
     if (!$moduleFiles) {
         return;
     }
     Varien_Profiler::start('config/load-modules-declaration');
     $unsortedConfig = new Mage_Core_Model_Config_Base();
     $unsortedConfig->loadString('<config/>');
     $fileConfig = new Mage_Core_Model_Config_Base();
     // load modules declarations
     foreach ($moduleFiles as $file) {
         $fileConfig->loadFile($file);
         $unsortedConfig->extend($fileConfig);
     }
     $moduleDepends = array();
     foreach ($unsortedConfig->getNode('modules')->children() as $moduleName => $moduleNode) {
         if (!$this->_isAllowedModule($moduleName)) {
             continue;
         }
         $depends = array();
         if ($moduleNode->depends) {
             foreach ($moduleNode->depends->children() as $depend) {
                 $depends[$depend->getName()] = true;
             }
         }
         $moduleDepends[$moduleName] = array('module' => $moduleName, 'depends' => $depends, 'active' => 'true' === (string) $moduleNode->active ? true : false);
     }
     // check and sort module dependence
     $moduleDepends = $this->_sortModuleDepends($moduleDepends);
     // create sorted config
     $sortedConfig = new Mage_Core_Model_Config_Base();
     $sortedConfig->loadString('<config><modules/></config>');
     foreach ($unsortedConfig->getNode()->children() as $nodeName => $node) {
         if ($nodeName != 'modules') {
             $sortedConfig->getNode()->appendChild($node);
         }
     }
     foreach ($moduleDepends as $moduleProp) {
         $node = $unsortedConfig->getNode('modules/' . $moduleProp['module']);
         $sortedConfig->getNode('modules')->appendChild($node);
     }
     $this->extend($sortedConfig);
     Varien_Profiler::stop('config/load-modules-declaration');
     return $this;
 }
开发者ID:par-orillonsoft,项目名称:Magento,代码行数:52,代码来源:Config.php


示例18: isRedisEnabled

 protected function isRedisEnabled()
 {
     $fileConfig = new Mage_Core_Model_Config_Base();
     $fileConfig->loadFile(Mage::getBaseDir('etc') . DS . 'modules' . DS . 'Cm_RedisSession.xml');
     $isActive = $fileConfig->getNode('modules/Cm_RedisSession/active');
     if (!$isActive || !in_array((string) $isActive, array('true', '1'))) {
         return false;
     }
     return true;
 }
开发者ID:guohuadeng,项目名称:stampApp,代码行数:10,代码来源:Front.php


示例19: __construct

 public function __construct($sourceData = null)
 {
     $this->setCacheId('config_urapidflow');
     $this->setCacheTags(array(self::CACHE_TAG));
     $this->setCacheChecksum(null);
     parent::__construct($sourceData);
     $this->_construct();
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:8,代码来源:Config.php


示例20: __construct

 public function __construct($arg)
 {
     list($sourceData, $moduleName) = $arg;
     parent::__construct($sourceData);
     $this->_config = Mage::getConfig();
     $this->_moduleName = $moduleName;
     $this->_moduleDir = realpath(Mage::getModuleDir('', $moduleName));
     $this->_etcModuleDir = realpath(Mage::getModuleDir('etc', $moduleName));
 }
开发者ID:ThomasNegeli,项目名称:Compatibility,代码行数:9,代码来源:Module.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Mage_Core_Model_Config_Data类代码示例发布时间:2022-05-23
下一篇:
PHP Mage_Core_Model_Config类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap