Location: PHPKode > projects > ExiteCMS > index.php
<?php
/*
|---------------------------------------------------------------
| PHP ERROR REPORTING LEVEL
|---------------------------------------------------------------
|
| By default CI runs with error reporting set to ALL.  For security
| reasons you are encouraged to change this when your site goes live.
| For more info visit:  http://www.php.net/error_reporting
|
*/
	error_reporting(E_ALL);

/*
|---------------------------------------------------------------
| CODEIGNITER ENGINE FOLDER NAME
|---------------------------------------------------------------
|
| This variable must contain the name of the CI "system" folder.
|
| Include the path if the folder is not in the same  directory
| as this file.
|
| NO TRAILING SLASH!
|
*/
	$system_folder = "system";

/*
|---------------------------------------------------------------
| EXITECMS FOLDER NAME
|---------------------------------------------------------------
|
| If you want this front controller to use a different "application"
| folder then the default one you can set its name here. The folder
| can also be renamed or relocated anywhere on your server.
|
| Include the path if the folder is not in the same  directory
| as this file.
|
| NO TRAILING SLASH!
|
*/
	$application_folder = "exitecms";

/*
|---------------------------------------------------------------
| MODULES FOLDER NAME
|---------------------------------------------------------------
|
| If you want this front controller to use a different "modules"
| folder then the default one you can set its name here. The folder
| can also be renamed or relocated anywhere on your server.
|
| Include the path if the folder is not in the same  directory
| as this file.
|
| NO TRAILING SLASH!
|
*/
	$modules_folder = "modules";

/*
|---------------------------------------------------------------
| THEMES FOLDER NAME
|---------------------------------------------------------------
|
| If you want this front controller to use a different "themes"
| folder then the default one you can set its name here. The folder
| can also be renamed or relocated anywhere on your server.
|
| Include the path if the folder is not in the same  directory
| as this file.
|
| NO TRAILING SLASH!
|
*/
	$themes_folder = "themes";

/*
|---------------------------------------------------------------
| DATA FOLDER NAME
|---------------------------------------------------------------
|
| If you want this front controller to use a different "data"
| folder then the default one you can set its name here. The folder
| can also be renamed or relocated anywhere on your server.
|
| Include the path if the folder is not in the same  directory
| as this file.
|
| NO TRAILING SLASH!
|
*/
	$data_folder = "data";

/*
|---------------------------------------------------------------
| ASSETS FOLDER NAME
|---------------------------------------------------------------
|
| If you want this front controller to use a different "assets"
| folder then the default one you can set its name here. The folder
| can also be renamed or relocated anywhere on your server.
|
| Include the path if the folder is not in the same  directory
| as this file. Note that this directory MUST be within the root
| of your website to allow pages to request the assets
|
| NO TRAILING SLASH!
|
*/
	$assets_folder = "assets";

/*
|===============================================================
| END OF USER CONFIGURABLE SETTINGS
|===============================================================
*/


/*
|---------------------------------------------------------------
| SET THE SERVER PATH
|---------------------------------------------------------------
|
| Let's attempt to determine the full-server path to the "system"
| folder in order to reduce the possibility of path problems.
| Note: We only attempt this if the user hasn't specified a
| full server path.
|
*/
if (strpos($system_folder, '/') === FALSE)
{
	if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
	{
		$system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
	}
}
else
{
	// Swap directory separators to Unix style for consistency
	$system_folder = str_replace("\\", "/", $system_folder);
}

/*
|---------------------------------------------------------------
| DEFINE APPLICATION CONSTANTS
|---------------------------------------------------------------
|
| EXT			- The file extension.  Typically ".php"
| FCPATH		- The full server path to THIS file
| SELF			- The name of THIS file (typically "index.php")
| BASEPATH		- The full server path to the "system" folder
| APPPATH		- The full server path to the "exitecms" folder
| MODULESPATH	- The full server path to the "modules" folder
| THEMESPATH	- The full server path to the "themes" folder
| ASSETSPATH	- The full server path to the "assets" folder
| ASSETS		- The relative path to the "assets" folder, from the docroot
| ROOT 			- Relative path to THIS file (which determines the ExiteCMS site document root)
| ROOTPATH		- The full server path to the ExiteCMS document root
|
*/
define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
define('FCPATH', __FILE__);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('BASEPATH', $system_folder.'/');
define('ROOTPATH', realpath(dirname(__FILE__)) . '/');
define('DOCROOT', $_SERVER['DOCUMENT_ROOT']);

// installed in the docroot?
if (realpath(dirname(__FILE__)) == DOCROOT)
{
	define('ROOT', '/');
}
else
{
	define('ROOT', substr(ROOTPATH, strlen(DOCROOT)+1));
}

// location of the exitecms application
if (! isset($application_folder) OR $application_folder == '')
{
	$application_folder = 'exitecms';
}
define('APPPATH', ROOTPATH.$application_folder.'/');

// location of the data folder
if (! isset($data_folder) OR $data_folder == '')
{
	$data_folder = 'data';
}
define('DATAPATH', ROOTPATH.$data_folder.'/');

// location of the modules folder
if (! isset($modules_folder) OR $modules_folder == '')
{
	$modules_folder = 'modules';
}
define('MODULESPATH', ROOTPATH.$modules_folder.'/');

// location of the themes folder
if (! isset($themes_folder) OR $themes_folder == '')
{
	$themes_folder = 'themes';
}
define('THEMESPATH', ROOTPATH.$themes_folder.'/');

// location of the assets folder
if (isset($assets_folder) && is_dir($assets_folder))
{
	// relative path
	define('ASSETSPATH', ROOTPATH.$assets_folder.'/');
	define('ASSETS', ROOT.$assets_folder.'/');
}
else
{
	if (! isset($assets_folder) OR $assets_folder == '')
	{
		$assets_folder = 'assets';
	}

	define('ASSETSPATH', ROOTPATH.$assets_folder.'/');
	define('ASSETS', ROOT.$assets_folder.'/');
}

// check if the assets are accessable by the web browser
if (substr(ASSETSPATH, 0, strlen(ROOTPATH)) != ROOTPATH)
{
	die('ExiteCMS front controller configuration error: Asset path must be within the webserver document root!');
}

/*
|---------------------------------------------------------------
| LOAD THE FRONT CONTROLLER
|---------------------------------------------------------------
|
| And away we go...
|
*/
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;

/* End of file index.php */
/* Location: ./index.php */
Return current item: ExiteCMS