Technology Powered Knowledge Base
Click Here To Make FREE Audio & Video Call From Web Browser!

Developer Guide for Magento Module Structure and CodePool

VN:F [1.9.22_1171]
Rating: +20 (from 20 votes)
VN:F [1.9.22_1171]
Rating: 10.0/10 (21 votes cast)

Magneto has three different type of codepools: A) Core, B) Community & C) Local. This three codepool working in same manner but priority of module include paths are different for them. Let’s take a look at app/Mage.php,


$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'local';
$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'community';
$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'core';
$paths[] = BP . DS . 'lib';
$appPath = implode(PS, $paths);
set_include_path($appPath . PS . Mage::registry('original_include_path'));
include_once "Mage/Core/functions.php";
include_once "Varien/Autoload.php";

This code snippet illustrates the order Magento is using to include paths – firstly it includes Local code pool, than community and after that – core, which allow developers to override classes without changing core files.
 
Continue reading