Directory Structure
The Directory Structure (shown in the image above) consists of 2 main directories, includes and resources.
The Includes directory is designed to store php server side files such as classes, functions, packages and templates.
The Resources directory is designed to store client side materials such as CSS, Images and JavaScript files.
There are 2 additional directories
The Logs directory is designed to store error logs to help debug.
The Install directory is used for the installer (currrently in development)
Configuration File
Opening config.php you will be presented with the central configuration.
define("SHOW_ERRORS", true);
will turn on the PHP ini_set('display errors') settingdefine("ERROR_LEVEL", "E_ALL ^ E_NOTICE");
will set the PHP error_reporting error level. More Information can be found here http://php.net/manual/en/function.error-reporting.phpdefine("TIMEZONE", "Australia/Sydney");
Allows you to set the timezoneusing PHP date_default_timezone_set(). More information in TimeZones and formats can be found here http://www.php.net/manual/en/timezones.phpdefine("DB_ENABLE", false);
Enables/Disables OOPSQL MySQLi Database Connectiondefine("THEME", "default");
Sets the BluePrint Theme Name which by default points to /includes/templates/THEMENAME.theme.html (where THEMENAME is the name you specify ie. default)Configuration Switch
define("LOC", 0);
This setting when changed sets which configuration set is active ie. $CFG[0]
or $CFG[1]
etc
Below you will see an example of a server configuration
//Server 1: Development Server $CFG[0]["DB_HOSTNAME"] = "localhost"; $CFG[0]["DB_USERNAME"] = "root"; $CFG[0]["DB_PASSWORD"] = ""; $CFG[0]["DB_DATABASE"] = ""; $CFG[0]["DB_TABLEPREFIX"] = ""; $CFG[0]["BASE_URL"] = "http://localhost/PHPBasePlate/"; $CFG[0]["ADMIN_URL"] = "http://localhost/PHPBasePlate/admin/"; $CFG[0]["ADMIN_EMAIL"] = "webmaster@computerm8.com"; $CFG[0]["PROJECT_NAME"] = "PHPBasePlate"; $CFG[0]["PROJECT_VERSION"] = "1.0.0"; //Server 2: Production Server $CFG[1]["DB_HOSTNAME"] = "host2.example.com"; $CFG[1]["DB_USERNAME"] = "host2dbuser"; $CFG[1]["DB_PASSWORD"] = "host2dbpass"; $CFG[1]["DB_DATABASE"] = "host2db"; $CFG[1]["DB_TABLEPREFIX"] = ""; $CFG[1]["BASE_URL"] = "http://host2.example.com/"; $CFG[1]["ADMIN_URL"] = "http://host2.example.com/admin/"; $CFG[1]["ADMIN_EMAIL"] = "admin@host2.example.com"; $CFG[1]["PROJECT_NAME"] = "Example Project Name"; $CFG[1]["PROJECT_VERSION"] = "1.0.0";
You will notice that each variable has a number ie $CFG[0]
, you can add addition server configuration set by adding $CFG[1]
and so on.
Lets take a look at what each setting does:
1. $CFG[0]["DB_HOSTNAME"]
This setting specifies the MySQLi Database Hostname
2. $CFG[0]["DB_USERNAME"]
This setting specifies the MySQLi Database Username
3. $CFG[0]["DB_PASSWORD"]
This setting specifies the MySQLi Database Password
4. $CFG[0]["DB_DATABASE"]
This setting specifies the MySQLi Database Schema
5. $CFG[0]["DB_TABLEPREFIX"]
This setting specified if a table prefix (if used)
6. $CFG[0]["BASE_URL"]
This setting specifies the absolute URL path where the PHPBasePlate files are located ie. http://localhost/MyWebSite/
7. $CFG[0]["ADMIN_URL"]
This setting will be used when a full administraion panel is added to PHPBasePlate (in Development)
8. $CFG[0]["ADMIN_EMAIL"]
This setting specifies the server Admins Email (may be used for notifications and errors)
9. $CFG[0]["PROJECT_NAME"]
This setting is used to describe the website/project you are working on
10. $CFG[0]["PROJECT_VERSION"]
This setting specifies the version of the website/project you are working on