3

I saw this code in app/code/core/Mage/Catalog/etc/config.xml file. Can anyone explain what is the <deprecatedNode> node mentioned here ?

<config>
. . . . . . 
<global>
        <models>
            <catalog>
                <class>Mage_Catalog_Model</class>
                <resourceModel>catalog_resource</resourceModel>
            </catalog>
            <catalog_resource>
                <class>Mage_Catalog_Model_Resource</class>
                <deprecatedNode>catalog_resource_eav_mysql4</deprecatedNode>
                <entities>
                    <product>
                        <table>catalog_product_entity</table>
                    </product>
                       . . . . . . 
</global>
. . . . . .  
</config>
6

There is a comment related to this which explains it:

app/code/core/Mage/Core/Model/Config.php Mage_Core_Model_Config::getGroupedClassName():

            /**
             * Backwards compatibility for pre-MMDB extensions.
             * In MMDB release resource nodes <..._mysql4> were renamed to <..._resource>. So <deprecatedNode> is left
             * to keep name of previously used nodes, that still may be used by non-updated extensions.
             */
            if (isset($config->deprecatedNode)) {
                $deprecatedNode = $config->deprecatedNode;
                $configOld = $this->_xml->global->{$groupType.'s'}->$deprecatedNode;
                if (isset($configOld->rewrite->$class)) {
                    $className = (string) $configOld->rewrite->$class;
                }
            }
| improve this answer | |
  • Can you explain what is MMDB release ? – Sukeshini Sep 30 '13 at 16:13
  • well, if you read a bit more about Magento, initially Magento used harcoded references to MySQL, then they said they will add support for other databases (Multiple DataBase). it refers to that point in time when they started to abstract the resources in order to provide support for multiple db. – FlorinelChis Sep 30 '13 at 16:16
  • Thanks a lot for your quick response. It means currently magento uses <..._resource> instead of <..._mysql4> as resource node right? So this <deprecatedNode> will keep the older naming convention for resource node (in this case it's <..._mysql4>) Please make sure that I have grab the idea correctly ? – Sukeshini Sep 30 '13 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.