Why do your modules modify core files?
Posted by Denis Parmon on 30 November 2012 05:59 PM
Our modules do not modify any core files directly. As you understand every module changes Magento's behavior by modifying some code. Magento offers a built in mechanism for modifying it's code with minimum changes to it's original code. This is called - rewrite. If you need to modify some part of Magento's functionality then you find classes that work with this functionality, create your own classes extended from these core classes and add your modifications to them. Then you place these new classes into your module and tell Magento that it must use those files instead of the original. As a result the original Magento files and classes are not modified and you can always upgrade the system although during the upgrade modules may stop working.

However some modules require modifications to the parts of the system that belong to the lowest level of Magento architecture that are initialized prior to the built in Magento rewrite engine. To allow this modifications without physical changes to "core" files Magento offers a slightly different option. You can put modified "core" files into the "local" folder and Magento will use these files instead of the original files that stay intact in the core and lib folders. Some of our modules do need to change low level parts of Magento and we use this second option to change the behavior of core classes. However original files remain intact and you can always upgrade the system.
(81 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako Resolve