In Magento, I want to modify the code of an Abstract class. Specifically, I want to modify the behavior of the function _getReadAdapter() of the class Mage_Core_Model_Resource_Db_Abstract.
According to this article by Alan Storm, http://alanstorm.com/magento_upgrade_rewrite_override, there are three ways to do it. Modifying the Magento’s source code is very bad and not encouraged. On the other hand, it seems to me that I cannot use Magento’s override/rewrite system, since the abstract class is neither a model, helper nor block. Is that correct?
As such, the only way to go about this is to make a copy of this particular source code at app/local/Mage, and modify the code of this new copy. Is that right?
Yep, using the codepool
app/code/localis the way to go.This is because
abstractclasses are not handled by the Magento factories, but literally extended in the class definitions.