Customize Parts Of Magento Configuration

Last modified by Moshe on Fri, June 25, 2010 09:04
Source|Old Revisions  

This is an old revision of the document!


This page intended to give overview and clarify details of customizations for various parts of modules’ configuration.

How is the configuration generated?

To achieve maximum flexibility of configuration without need for manual editing of configuration files, Magento utilizes a concept of merging the configuration from multiple XML files into one global cached configuration repository.

As an example, let’s see how 2 simple source xml files merge into one:

  • Source file 1:
<?xml version="1.0"?>
<config>
  <node1>
    <node1_1>Data1</node1_1>
  </node1>
  <node2>Data2</node2>
</config>
  • Source file 2:
<?xml version="1.0"?>
<config>
  <node1>
    <node1_2>Data3</node1_2>
  </node1>
  <node2>Data4</node2>
  <node3>Data5</node3>
</config>
  • Merged result:
<?xml version="1.0"?>
<config>
  <node1>
    <node1_1>Data1</node1_1>
    <node1_2>Data3</node1_2>
  </node1>
  <node2>Data4</node2>
  <node3>Data5</node3>
</config>

As you can see the merged XML structure consists of source file 1 contents, appended or overwritten (see node2, Data4) by source file 2.

Which files are used in configuration?

Refer to: app/code/core/Mage/Core/Model/Config.php, method init()

  • If usage of config cache is enabled, Magento will try to load the configuration from cache.
    If loaded successfully, it will skip all the following steps.
  • Load app/etc/config.xml.
    This file contains values absolutely necessary for successful load of Magento core components.
  • Merge all files from app/etc/modules/ (app/etc/modules.xml until 0.6.14100).
    Files containing modules declarations are dropped here by the core, community and custom packages installed, and are named by package name (Mage_All.xml).
  • Merge app/etc/local.xml.
    Contains settings for local database connections, installation date and local encryption key.
  • If app/etc/local.xml was not found (not installed yet) app/etc/distro.xml is merged.
    Contains auto-configured values to be used in installation wizard.
  • Merge config.xml from all the modules that were declared in app/etc/modules/*.
    These are: app/code/{codePool}/{moduleName}/etc/config.xml

Models

Helpers

Blocks

Controllers

Resources

Admin Menu and ACL




 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs