Config File Documentation

The config file is responsible for setting up the system constants, creating a connection to the database and setting up the various paths within the system.

API Documentation

API Home
API for the config file

There are three main tasks the config file undertakes:

  1. Setting the include path
  2. Auto loading class files
  3. Setting up the system constants

This config file is included by each .html / .php file using a call similar to:

if(file_exists(dirname($_SERVER['DOCUMENT_ROOT']).DIRECTORY_SEPARATOR.
"dc-admin-config/config.php")
&& is_file(dirname($_SERVER['DOCUMENT_ROOT']).DIRECTORY_SEPARATOR.
"dc-admin-config/config.php")){

include(dirname($_SERVER['DOCUMENT_ROOT']).DIRECTORY_SEPARATOR.
"dc-admin-config/config.php");

// page activity goes in here

}else{ // we can't find the config file
echo "

Unable to find config file at: ".
dirname($_SERVER['DOCUMENT_ROOT']).DIRECTORY_SEPARATOR.
'dc-admin-config/config.php.'.".


Please check the file path is correct.

";

Auto Class Loader
24 June 2010
The automatic loading of classes makes things very simple when developing a ...
Setting the Include Path
6 July 2010
When PHP tries to include a file it will look for it first in the folder specified by the include_path variable. You can set this variable in the config file to point to the root folder where you keep your code files, and PHP will go looking for your file there ...
Getting the System Constants
6 July 2010
There are many settings within the system that are constant. Instead of passing them around in parameter lists we can define them as a constant and refer to them directly whenever we need ...