App directory of magento
“app” directory play very important role in the magento. This directory contains allapplication development related files. app is on the root in the magento directory structure. Word app comes from word application. This directory contains following type of file:
- Different configuration files related to magento application like database configuration file, module configuration files etc.
- All module of the magento.
- Design and theme related files
- Language related files
app directory has following 4 sub directories.
/app/code directory: code directory is the directory for the developer. All magento code is placed in the /app/code directory. code directory has following 3 sub directories.
/app/code/core directory: This directory contains all magento core modules. All magento modules clubbed in Mage namespace.
/app/code/local directory: This directory contains all locally developed module. Locally developed module means if you are customizing any core magento feature by creating any module then you can create your module in /app/code/local module.
/app/code/community directory: This directory contain module installed by magento connect.
/app/design directory: This is directory for the designer. /app/design magento directory contains all design related files of the admin and frontend interface. /app/design directory has following 3 sub directories.
- frontend : Contains design file related to fronted of your magento
- adminhtml : Contains design file related to admin interface of your magento
- install : Contains design file related to magento installer.
/app/etc directory: This directory primarily contains xml files. These xml files contains all configuration related information of your store. Following are some example of the configuration files of your magento store:
- /app/etc/local.xml file contains database server information and router information
- /app/etc/config.xml file contains all directory related information
- /app/etc/modules folder contains all module loading configuration files.
/app/locale directory: This directory contains the language string file. For example if you are running your magento store in 2 language then you need to create locale folder for every language.
So in magento directory structure app folder play very important role. If you want to learn customization of magento then you should be completely aware about the app directory structure of the magento.
This directory contains files related to magento files downloading. This directory contains file which used to install the extension from magento connect.download directory is place on the root of magento directory structure.
This directory contains different error processor and template files. Like 404 error or 503. Usually people do not touch this directory. This directory is paced on the root of magento directory structure.
This directory contains some middle ware code file. All model files first parsed and moved into this folder and magento directly loads files from this directory. Once you made any change in your module’s model file then it first parsed and moved into the include folder. This directory is paced on the root of magento directory structure.
Magento lib directory contains all php library used by magento. Some of the them are created by varien(magento company) and some other opensource library like zend framework, pear,
This directory contains all media file used in your store. For example all images uploaded in the product and category catalog. This directory also contains dynamic images used in 3rd party module. So all dynamic media files used in the magento is placed in media folder.
- skin/frontend: This directory contain css, js and image files of fronted magento themes
- skin/adminhtml: This directory contains css,js and images of admin theme of magento.
- skin/install: This directory contains media related to magento installer.
In magento directory structure var directory play important role. Var directory contains mainly temporary files and data. Or in other terms it contains the middleware files generated by magento like cache, error, log, session and locks. Following are the sub-directory of the var directory:
- var/cache: This folder contains all magento middle ware cached data. If you will enable the caching then magento will just onetime loads some variable from XML and store in the serialized variable in a text file in cache directory. It increases the performace of you ecommerce stores.
- var/locks : This directory contains the table locking information.
- /var/session: If you will store session in the files then magento create a file in var/session directory and store all php session data in specific file of this directory.
- var/log: If you will enable the logging of your magento store then log will be store in this directory.
var directory is paced on the root of magento directory structure.
If you want you can slightly change the magento directory structure by using the configuration file of magento. For example you can open app/etc/config.xml and change the path of following directory:
- app directory.
Hope now you have clear understanding of magento directory structure.