PageRenderTime 278ms CodeModel.GetById 125ms app.highlight 2ms RepoModel.GetById 150ms app.codeStats 0ms

/index.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 135 lines | 32 code | 14 blank | 89 comment | 5 complexity | 18b674570f076c1d31f677570220682a MD5 | raw file
  1<?php
  2/**
  3 * Halogy
  4 *
  5 * A user friendly, modular content management system for PHP 5.0
  6 * Built on CodeIgniter - http://codeigniter.com
  7 *
  8 * @package		Halogy
  9 * @author		Haloweb Ltd.
 10 * @copyright	Copyright (c) 2008-2011, Haloweb Ltd.
 11 * @license		http://halogy.com/license
 12 * @link		http://halogy.com/
 13 * @since		Version 1.0
 14 * @filesource
 15 */
 16
 17// ------------------------------------------------------------------------
 18
 19	
 20/*
 21|---------------------------------------------------------------
 22| PHP ERROR REPORTING LEVEL
 23|---------------------------------------------------------------
 24|
 25| By default CI runs with error reporting set to ALL.  For security
 26| reasons you are encouraged to change this when your site goes live.
 27| For more info visit:  http://www.php.net/error_reporting
 28|
 29*/
 30	error_reporting(E_ALL);
 31
 32/*
 33|---------------------------------------------------------------
 34| SYSTEM FOLDER NAME
 35|---------------------------------------------------------------
 36|
 37| This variable must contain the name of your "system" folder.
 38| Include the path if the folder is not in the same  directory
 39| as this file.
 40|
 41| NO TRAILING SLASH!
 42|
 43*/
 44
 45	$system_folder = "halogy";
 46
 47/*
 48|---------------------------------------------------------------
 49| APPLICATION FOLDER NAME
 50|---------------------------------------------------------------
 51|
 52| If you want this front controller to use a different "application"
 53| folder then the default one you can set its name here. The folder 
 54| can also be renamed or relocated anywhere on your server.
 55| For more info please see the user guide:
 56| http://codeigniter.com/user_guide/general/managing_apps.html
 57|
 58|
 59| NO TRAILING SLASH!
 60|
 61*/
 62	$application_folder = "application";
 63
 64/*
 65|===============================================================
 66| END OF USER CONFIGURABLE SETTINGS
 67|===============================================================
 68*/
 69
 70
 71/*
 72|---------------------------------------------------------------
 73| SET THE SERVER PATH
 74|---------------------------------------------------------------
 75|
 76| Let's attempt to determine the full-server path to the "system"
 77| folder in order to reduce the possibility of path problems.
 78| Note: We only attempt this if the user hasn't specified a 
 79| full server path.
 80|
 81*/
 82if (strpos($system_folder, '/') === FALSE)
 83{
 84	if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
 85	{
 86		$system_folder = realpath(dirname(__FILE__)).'/'.$system_folder;
 87	}
 88}
 89else
 90{
 91	// Swap directory separators to Unix style for consistency
 92	$system_folder = str_replace("\\", "/", $system_folder); 
 93}
 94
 95/*
 96|---------------------------------------------------------------
 97| DEFINE APPLICATION CONSTANTS
 98|---------------------------------------------------------------
 99|
100| EXT		- The file extension.  Typically ".php"
101| FCPATH	- The full server path to THIS file
102| SELF		- The name of THIS file (typically "index.php)
103| BASEPATH	- The full server path to the "system" folder
104| APPPATH	- The full server path to the "application" folder
105|
106*/
107define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
108define('FCPATH', __FILE__);
109define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
110define('BASEPATH', $system_folder.'/');
111
112if (is_dir($application_folder))
113{
114	define('APPPATH', $application_folder.'/');
115}
116else
117{
118	if ($application_folder == '')
119	{
120		$application_folder = 'application';
121	}
122
123	define('APPPATH', BASEPATH.$application_folder.'/');
124}
125
126/*
127|---------------------------------------------------------------
128| LOAD THE FRONT CONTROLLER
129|---------------------------------------------------------------
130|
131| And away we go...
132|
133*/
134
135require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;