Throughout this book we will be referencing our URL examples as if they are executing on the
magento.loc domain. You are free to set your local Apache virtual host and host file to any domain you prefer, as long as you keep this in mind. If you're hearing about virtual host terminology for the first time, please refer to the Apache Virtual Host documentation at http://httpd.apache.org/docs/2.4/vhosts/.
Here is a quick summary of each of those files and folders:
.htaccess: This file is a directory-level configuration file supported by several web servers, most notably the Apache web server. It controls
mod_rewritefor fancy URLs and sets configuration server variables (such as memory limit) and PHP maximum execution time.
app: This is where you will find Magento core code files for the backend and for the frontend. This folder is basically the heart of the Magento platform. Later on, we will dive into this folder for more details, given that this is the folder that you as an extension developer will spend most of your time on.
downloader: This folder is used by the Magento Connect Manager, which is the functionality you access from the Magento administration area by navigating to System | Magento Connect | Magento Connect Manager.
get.php: This file hosts a feature that allows core media files to be stored and served from the database. With the Database File Storage system in place, Magento would redirect requests for media files to
includes: This folder is used by the
Mage_Compilerextension whose functionality can be accessed via Magento administration System | Tools | Compilation. The idea behind the Magento compiler feature is that you end up with a PHP system that pulls all of its classes from one folder, thus, giving it a massive performance boost.
app/designfolder, as these two locations actually result in one fully featured Magento theme or package.
var: This folder contains sessions, logs, reports, configuration cache, lock files for application processes, and possible various other files distributed among individual subfolders. During development, you can freely select all the subfolders and delete them, as Magento will recreate all of them on the next page request. From a standpoint of a Magento extension developer, you might find yourself looking into the
var/reportfolders every now and then.
Now that we have covered the basic root folder structure, it's time to dig deeper into the most used folder of all, the
app folder, as shown in the following diagram:
app/ ├── Mage.php ├── code │ ├── community │ │ └── Phoenix │ │ └── Moneybookers │ └── core │ ├── Mage │ └── Zend ├── design │ ├── adminhtml │ ├── frontend │ │ ├── base │ │ │ └── default │ │ │ ├── etc │ │ │ ├── layout │ │ │ └── template │ │ └── default │ │ ├── blank │ │ ├── default │ │ ├── iphone │ │ └── modern │ └── install ├── etc │ ├── config.xml │ ├── local.xml.additional │ ├── local.xml.template │ └── modules └── local └── en_US