Cart45 folder and file structure
Cart45's folder structure is designed to be simple on 2 levels
- Easy for developers to find ways to customise Cart45
- Easy for website owners to easily install and update Cart45
Folder structure
- admin: all pages the cart45 admin section
- behaviour: JavaScript files
- cache: cached text files of site settings. Used to speed up Cart45
- class: Cart45's class files - may be referred to as the Model in MVC programming
- content: All the page we see e.g. product sales page, home page go here
- forms: some automatically generated forms
- images:
- categories
- content
- help
- icons
- layout
- products
- inc: important miscellaneous files including config.php and settings.inc.php
- init: files which control how are pages interact with our class files. Sometime knowsn as the Controller in MVC programming
- style: CSS files
- templates: common HTML snippets. Some pages use the same pieces of HTML so rather than repeating them in each file they are here.
- forms: forms used to add/edit/delete items from Cart45
- themes: where users can add their own themes to Cart45
Important files
Here's a brief rundown of some of the important files in Cart45.
.htaccess
.htaccess is very important. It tells your server to display Cart45's custom error pages if an error occurs and also it sends every page request to rewrite.php (see next file) without which we'd be stuck with URLs like www.crat45.com/products.php?id=4567 which would be awful for search engine optimisation (SEO).
.htaccess files are hidden by default in your system so you may have to create it yourself. Cart45's download file has a htaccess.txt file they you can rename to .htaccess.
rewrite.php
All page requests go through rewrite.php and rewrite.php works out which page to show, whether it exists or not and a whole heap of other things. Using this file enables Cart45's mod_rewrite rules in the .htaccess file to be minimal.
maintenance.html
maintentance.html is a simple html file that is shown when your website is down for maintenance - we recommend that you put up this page (via the settings.inc.php) file whenever you are updating your cart45 website - in whatever capacity.
settings.inc.php
This file can be found in the inc folder. It does all the setting up of Cart45 and readies your website for display to the world.
You can set it to show the maintenace.html page for every page by changing the line:
$objMaintenance = new Maintenance(false);
to
$objMaintenance = new Maintenance(true);
config.php
Config.php can be found in the inc folder also. This file stores you configuration settings including your website address (URL) e.g. www.myshop.com and your database settings.
This file is comprehensively commented so you should easily be able to edit it to suit your website's settings.
robots.txt
robots.txt is used to tell robots (that is Google, Yahoo etc) which pages they can and cannot put in their results. By default Cart45 bans the following folders:
- admin
- behaviour
- cache
- class
- forms
- inc
- init
- style
- templates
...which is most Cart45 files. This means somebody searching for your website in Google won't be given a link to your admin area by mistake and gain the chance to login.