Magento 1 Extensions – How to Get a List of All Class Rewrites

code analysisconfigurationextensionsmagento-1overrides

Is there a way to list all rewrites and maybe other potential conflicts besides reviewing all configuration files? I have to analyse some projects with lots of extensions and custom modifications and would like to automate as much as possible of this.

The most important thing is to detect extensions that rewrite the same class, but I'd like to have a list of all rewrites in place too, to keep an overview. At the moment I maintain this list manually in a spreadsheet.

I found this extension ("Extension Conflict") on Magento Connect but judging by the reviews and release notes it seems to be outdated.

Best Answer

Have a look at the n98-magerun utility:

Rewrite List

Lists all registered class rewrites:

$ n98-magerun.phar dev:module:rewrite:list

Rewrite Conflicts

Lists all duplicated rewrites and tells you which class is loaded by Magento. The command checks class inheritance in order of your module dependencies. n98-magerun.phar dev:module:rewrite:conflicts [--log-junit="..."]

If a filename with --log-junit option is set the tool generates an XML file and no output to stdout.

You can also log the conflicts to a JUnit Style XML file for further analysis, for example on a continues integration server.

Disclaimer: semi-self-link / I am involved in that project