1

I'm looking at putting together a module which will help resolve conflicting behaviours between a few modules we've got. What I was hoping to be able to do is create a module which could override, say 4 modules, but would still work even if only 3 of those modules were installed.

As I understand it, the only way to control whether a module loads after another is to make it dependent on that module, but obviously that wouldn't work in this case since the modules it was dependent on wouldn't necessarily be installed. So I was wondering if there was a way other than dependency to make sure a module follows another, but rather than the previous module being a requirement it just checks if it's installed and ignores it if not

1
  • Why do you need dynamic dependency?
    – laketuna
    Commented Oct 6, 2014 at 17:51

1 Answer 1

0

It's not possible to natively have dynamic dependencies over multiple extensions in an extension in Magento. If you really want to make such dynamic enforcement of dependency, you will need to edit Mage_Core_Model_Config::_loadDeclaredModules() to check the existence of the extensions in the depends node.

However, it still presents the issues of having a comprehensive list class overrides in your resolution extension while some of the parent classes may not exist, overriding or improperly editing an important class, Mage_Core_Model_Config, and having to fully identify the consequence of making such modification, etc.

I think it would be more beneficial to create your resolution extension to fit the exact problem of your Magento instance, instead of trying to make it a catch-all. All of the possible problems you have to deal with are not worth what you're trying to do.

2
  • Thanks for the answer, ended up it wasn't applicable for us anyway so don't need to actually put it into practice regardless. Was curious whether it was possible though, it seemed like it could be quite an interesting system to set up Commented Oct 8, 2014 at 8:33
  • Yeah, in general and in my experience, there's often no need to make things fancy in Magento, especially if it involves functions of classes that are up in the hierarchy/processes.
    – laketuna
    Commented Oct 8, 2014 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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