This certainly means that understanding how it works and majorly understanding the important areas and files and folder structure of this CMS is even more important. For a PHP Developer it is certainly tough to identify how Magento functions and hence this Webbing Wednesday we decided to make every one aware on the File structure of Magento.
First thing needed is Download Magento (http://www.magentocommerce.com/download) and then install the same on your local machine or on your server.
Once this is done, please start looking into the root directory and follow the details below:
- .htaccess:This file is used for rewriting the URLs and making URLs SEO Friendly. This file is also used for directives which helps improving the performance.
- app (directory)This is one of the most important folder for building the website. This folder contains modules, themes, configuration and translation files. Moreover, the folder also contains all the default template files and admin theme.The folder can be divided into two segments:
The code folder is the engine of Magento, which can further be divided in 3 segments:
Community: where all the paid extensions reside;
Core: Where default Magento core files reside communicating directly with the libraries of Magento;
Local: Where Modules resides.This pretty much summarizes that the core folder is the backbone of Magento and it is highly sensitive and imperative part of the Magento structure.
This folder contains all the Design Files as the name suggests. This part of the folder can also be subdivided into 2 more segments.
Admin: This part covers the Layout and Template files for Admin area of Magento;
FrontEnd: This part covers the Layout and Template Files for the front end of the web page.The website will look beautiful with the correct and maximum use of this folder and all the cosmetic changes can not be done without this very important part of the entire engine.
Well since this pretty much covers the the website, it is important to share how this functions:
Layout XML files residing in Design Folder in the front end section are mainly used to combine XML tags and Blocks for configuring the classes and functions and making it connect to the front end of the web page. In a nutshell when a page runs, Magento reads all the XML files and process the page with the functions and classes received from combining the tags and blocks as mentioned above. This procedure is highly simple to understand and have been implemented in much better and organized way in Magento, which to our best understanding no other eCommerce platform offers.
Its very well known that the magento caching issues can cause trouble to a perfectly functioning website and can certainly affect performance of the website. The cron is used to set the time period for executing the file to ensure the caching of magento is periodically updated.
- downloader (directory)
Magento has recently been upgraded and this is exactly what this downloader directory does. It is a storage area for web downloaded files, for installation and upgradation of magento through browser.
- js (directory)
- lib (directory)
The Magento PHP libraries on which the app folder runs and functions are located here and this is one of the most critical folder of the entire Magento Setup.
- media (directory)
As the name suggests, the directory is for storing the media files and auto generated thumbnails for product images in different sizes. The images are organized in a much fancier and nicer way. This folder can also be used for import/export of mass transfers.
The file controls the automatic update through the downloader script for each individual Magento module.
- pkginfo (directory)
Contains files with info about upgrading teh modules and changes.
- report (directory)
As the name suggests it reports the Magento errors and manages the logs for the same.
- skin (directory)
This is where the themes are located along with the images, css and all the supportive elements for the theme. Moreover the skin files for the installation of skins and administration templates are also found in the same directory.
- var (directory)
Var folder mainly manages the caching of Magento and Sessions along with backup for the database and exports. The directory also manages the error report caching.
There are other parts of Magento which certainly are worth mentioning, however understanding and digesting the above information is more than enough to say “I know how Magento Works”.
Do let us know how you found our Webbing Wednesday Week #2. We shall wait your comments and responses.