What is the best way to deal with site configurations when building a site?

I am currently religiously using upgrade and install scripts for everything, meaning a zero configuration state when moving a site betweene environments etc.

However, some things in Magento just dont lend themselves to upgrade scripts and it is starting to become a little bit messy.

An example, is i am using the webshopapps matrix rate module and am writing an install script for my site that creates the required entries in the webshopapps shipping rate table.

However, in order to get that to work, i need to make my sites local module depend on the webshopapps module.

Really what I am asking here is what are the best practices for developing like this?

3 Answers 3


I would create a local extension that you would use for rewriting classes from other extensions, writing update scripts and call it something like XyzCore. This way you ensure having this kind of logic in one place.

You may also specify in your module-xml that it depends on other extensions. Here is an example taken from Mage_Api.xml:

                <Mage_Core />
  • How does this extend to setting up your http url vs https url, etc.? I think that's what the OP is getting at...
    – philwinkle
    May 6, 2013 at 20:11

As binici says.

I implement a ProjectName_Install module and throw in all the stuff which should be configurated. What can be easily done is the configuration. Consider everything inside the <default>.

All other things are going into install scripts. If you need MatrixRates sure, just throw it in the depends, I don't see any problem with that.

<?xml version="1.0" encoding="UTF-8"?>
                <logo_alt>Some text</logo_alt>
                <welcome>Herzlich Willkommen bei xxx</welcome>
                <product_url_suffix />
                <category_url_suffix />
            <state_required />

The answer from binici is correct even for Magento 2. Here is an example Magento 2 etc/module.xml file that accomplishes the same goal. This file declares a module called "Foo_Bar" with version "1.0.0" and states that it depends on module "Foo_Charlie":

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Foo_Bar" setup_version="1.0.0">
            <module name="Foo_Charlie" />

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.