Magento Files And Folders Structure
This tutorial will provide the detailed information regarding Magento’s default files and folders structure. As we all know that the Magento is based on MVC structure in PHP language. Magento uses Zend framework as a base library. Magento has very powerful, simple, flexible and defined directory structure.
Here, we will discuss top level directory of the Magento and will explore the depth of sub-directories. In this tutorial, we will name “root” where our Magento is installed.
The default files and folders included in the main directories are as following.
There are some folders or directory on Magento root:
There are some files on Magento root:
Further in this tutorial, we will discuss every root level directory of Magento:
1) App directory in Magento:
App directory is very important role in the Magento. It contains all application development related files. Word “app” comes from word application.
This directory contains following type of files:
- Configuration files related to Magento application like database, modules, core and theme files.
- All modules
- Design and theme related files
- Language related files.
# app directory: It has following 4 sub directories:
## /app/code directory: It is the directory for the development. It has following sub-directories:
In core directory contains all Magento core modules with mage namespace.
In local directory contains all locally developed modules, means if we are customizing any core module then we can create own module in /app/code/local/ module.
In community directory contain module installed by Magento connect.
# /app/design directory: This is directory for designer. It contains all design related files of the admin and frontend interface. It has 3 sub directories:
# /app/etc directory: It is primarily contains xml files. These xml files contains all configuration related information of our store like database etc. In this directory, local.xml for configuration for database.
# /app/locale directory: This directory contains the language related file. For example, if you have two running store for language, then we will create locale for every language.
2) Downloader directory:
It is related to Magento files downloading. It is used to install the extension from Magento connect. This is used for the installation and upgrade of Magento through our browser.
3) errors directory:
It is contains different error processor and template files like 404 error. Usually people do not touch this directory.
4) includes directory:
It contains some middleware code files. All model files parsed and moved into this folder. Once you made any changes in our module’s model file then it first parsed and moved into this folder.
5) js directory:
6) lib directory:
It contains all php library used in Magento.
7) media directory:
This is storage of the Magento media files like images, generated thumbnails, uploaded products images. It is also used the container for importing images through csv or mass import/export tools. It also contains dynamic images in third party modules.
8) skin directory:
- skin/ adminhtml
- skin/ install
9) var directory:
Var directory play important role in Magento. It is contains mainly temporary files and data like cache, error, log, session and locks.
Hope now we have clear understanding of Magento directory structure.