Magento's base structure
Base directory The default installation contains the following files and directories in the base directory: • .htaccess • .htaccess.sample • 404 (directory) • app (directory) • cron.php • downloader (directory) • favicon.ico • index.php • index.php.sample • js (directory) • lib (directory) • LICENSE_AFL.txt • LICENSE.txt • media (directory) • pear • pkginfo (directory) • report (directory) • skin (directory) • var (directory)
The function of each of the files in the base directory The following is a run through of all the files in the base directory, to show us what they do: • .htaccess—This file controls mod_rewrite for fancy URLs and sets configuration server variables (such as memory limit) and PHP maximum execution time, so that Magento can run better. • .htaccess.sample—Works as a backup for .htaccess, so that we know the default .htaccess file (if ever we edit it and need to backtrack). • cron.php—The file that should be executed as a cron job every few minutes to ensure that Magento’s wide caching doesn’t affect our server’s performance. • favicon.ico—Magento’s default favicon; it’s the small icon that appears in the toolbar of our browser. • index.php—The main loader file for Magento and the file that initializes everything. • index.php.sample—The base template for new index.php files, useful when we have edited the index.php file and need to backtrack. • LICENSE_AFL.txt—It contains the Academic Free License that Magento is distributed under. • LICENSE.txt—It contains the Open Software License that Magento is distributed under. • pear—This controls all automatic updating via the downloader and SSH. This file is initialized and handles the updating of each individual module that makes up Magento. • php.ini—A sample php.ini file for raw PHP server variables recommended when setting up Magento on our server. This should not be used as a complete replacement, but only as a guide to replace certain lines of the php.ini server file. It is useful when overriding these variables when .htaccess isn’t enabled on our server.