summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php91
1 files changed, 59 insertions, 32 deletions
diff --git a/index.php b/index.php
index 6c839ec54..315b43c8e 100644
--- a/index.php
+++ b/index.php
@@ -7,9 +7,10 @@
|
| 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);
+ error_reporting(E_ALL);
/*
|---------------------------------------------------------------
@@ -23,7 +24,6 @@ error_reporting(E_ALL);
| NO TRAILING SLASH!
|
*/
-
$system_folder = "system";
/*
@@ -32,65 +32,92 @@ error_reporting(E_ALL);
|---------------------------------------------------------------
|
| 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 relocated anywhere on your server. For
-| more info please see the user guide:
+| folder then the default one you can set its name here. The folder
+| can also be renamed or relocated anywhere on your server.
+| For more info please see the user guide:
| http://www.codeigniter.com/user_guide/general/managing_apps.html
|
|
| NO TRAILING SLASH!
|
*/
-
$application_folder = "application";
+
/*
|===============================================================
-| END OF USER CONFIGURABLE SETTINGS
+| END OF USER CONFIGURABLE SETTINGS
|===============================================================
*/
-// Let's attempt to determine the full-server path to the "system"
-// folder in order to reduce the possibility of path problems.
+
+/*
+|---------------------------------------------------------------
+| 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.
+|
+*/
if (function_exists('realpath') AND @realpath(dirname(__FILE__)) !== FALSE)
{
$system_folder = str_replace("\\", "/", realpath(dirname(__FILE__))).'/'.$system_folder;
}
-// Is the $aplication variable blank? If so, we'll assume the folder is called "application"
-if ($application_folder == '')
-{
- $application_folder = 'application';
-}
-
-// Some versions of PHP don't support the E_STRICT constant so we'll
-// explicitly define it so that it will be available to the Exception class
-if ( ! defined('E_STRICT'))
-{
- define('E_STRICT', 2048);
-}
-
-// Define a few constants that we use througout the framework.
-// EXT - contains the file extension. Typically ".php"
-// FCPATH - contains the full server path to THIS file.
-// SELF - contains the name of THIS file.
-// BASEPATH - contains the full server path to the "system" folder
-// APPPATH - contains the full server path to the "application" 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 "application" folder
+|
+*/
define('EXT', '.'.pathinfo(__FILE__, PATHINFO_EXTENSION));
define('FCPATH', __FILE__);
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
define('BASEPATH', $system_folder.'/');
-if ( ! is_dir($application_folder))
+if (is_dir($application_folder))
{
- define($application_folder.'/');
+ define('APPPATH', $application_folder.'/');
}
else
{
+ if ($application_folder == '')
+ {
+ $application_folder = 'application';
+ }
+
define('APPPATH', BASEPATH.$application_folder.'/');
}
-// Load the front controller and away we go!....
+/*
+|---------------------------------------------------------------
+| DEFINE E_STRICT
+|---------------------------------------------------------------
+|
+| Some older versions of PHP don't support the E_STRICT constant
+| so we need to explicitly define it otherwise the Exception class
+| will generate errors.
+|
+*/
+if ( ! defined('E_STRICT'))
+{
+ define('E_STRICT', 2048);
+}
+
+/*
+|---------------------------------------------------------------
+| LOAD THE FRONT CONTROLLER
+|---------------------------------------------------------------
+|
+| And away we go...
+|
+*/
require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;
?> \ No newline at end of file