From 35ac46d4aad12fe723229feca403b4dee3efcc27 Mon Sep 17 00:00:00 2001 From: Root Date: Fri, 25 May 2012 18:51:48 -0400 Subject: Changed instead of turning off of the error messaging to hide them --- index.php | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 5a1190112..6ffe4864e 100644 --- a/index.php +++ b/index.php @@ -52,20 +52,23 @@ * By default development will show errors but testing and live will hide them. */ -if (defined('ENVIRONMENT')) +// By default show all except notifications, deprecated and strict errors +error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT); + +// Show or hide errors depending on current environment +switch (ENVIRONMENT) { - switch (ENVIRONMENT) - { - case 'development': - error_reporting(-1); - break; - case 'testing': - case 'production': - error_reporting(0); - break; - default: - exit('The application environment is not set correctly.'); - } + case 'development': + ini_set('display_errors', 1); + break; + + case 'testing': + case 'production': + ini_set('display_errors', 0); + break; + + default: + exit('The application environment is not set correctly.'); } /* -- cgit v1.2.3-24-g4f1b From 3cc8502b48946f7298797393cea0a7183c325244 Mon Sep 17 00:00:00 2001 From: Root Date: Sun, 27 May 2012 20:06:10 -0400 Subject: Changed to show all the errors on dev --- index.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 6ffe4864e..c212cac84 100644 --- a/index.php +++ b/index.php @@ -52,18 +52,16 @@ * By default development will show errors but testing and live will hide them. */ -// By default show all except notifications, deprecated and strict errors -error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT); - -// Show or hide errors depending on current environment switch (ENVIRONMENT) { case 'development': + error_reporting(E_ALL); ini_set('display_errors', 1); break; case 'testing': case 'production': + error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT); ini_set('display_errors', 0); break; -- cgit v1.2.3-24-g4f1b From 8d021e647f6a094b6097d1ea89119a4047efc8dd Mon Sep 17 00:00:00 2001 From: Gints Murans Date: Wed, 30 May 2012 21:15:08 +0300 Subject: E_ALL -> -1 --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'index.php') diff --git a/index.php b/index.php index c212cac84..a11c5c1f2 100644 --- a/index.php +++ b/index.php @@ -55,7 +55,7 @@ switch (ENVIRONMENT) { case 'development': - error_reporting(E_ALL); + error_reporting(-1); ini_set('display_errors', 1); break; -- cgit v1.2.3-24-g4f1b From dda21f6abc76451997b12c07e6066aa49c2d423d Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sun, 3 Jun 2012 10:36:36 -0500 Subject: Added support for $_SERVER['CI_ENV'] in index.php Remember this is entirely optional, nothing will change if you do not which to use Multiple Environments just like right now. If you DO set CI_ENV you can manipulate the switch that controls error reporting, etc, so set it to "production" on your live site to hide errors from users. If you don't require this logic you can remove it, or change it entirely to check HTTP_HOST for environment subdomains, or check IP address, etc. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'index.php') diff --git a/index.php b/index.php index 5a1190112..3b00dd360 100644 --- a/index.php +++ b/index.php @@ -42,7 +42,7 @@ * * NOTE: If you change these, also change the error_reporting() code below */ - define('ENVIRONMENT', 'development'); + define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); /* *--------------------------------------------------------------- * ERROR REPORTING -- cgit v1.2.3-24-g4f1b From 079fbfcde095230f304e889217f897031a948f61 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 12 Jun 2012 02:26:58 +0300 Subject: Changed APPPATH, BASEPATH and VIEWPATH to be absolute paths (fixes issue #1321) and removed EXT constant --- index.php | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 3b00dd360..680dccfea 100644 --- a/index.php +++ b/index.php @@ -178,9 +178,11 @@ if (defined('ENVIRONMENT')) { $system_path = realpath($system_path).'/'; } - - // ensure there's a trailing slash - $system_path = rtrim($system_path, '/').'/'; + else + { + // Ensure there's a trailing slash + $system_path = rtrim($system_path, '/').'/'; + } // Is the system path correct? if ( ! is_dir($system_path)) @@ -196,10 +198,6 @@ if (defined('ENVIRONMENT')) // The name of THIS file define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); - // The PHP file extension - // this global constant is deprecated. - define('EXT', '.php'); - // Path to the system folder define('BASEPATH', str_replace('\\', '/', $system_path)); @@ -212,6 +210,11 @@ if (defined('ENVIRONMENT')) // The path to the "application" folder if (is_dir($application_folder)) { + if (realpath($system_path) !== FALSE) + { + $application_folder = realpath($application_folder); + } + define('APPPATH', $application_folder.'/'); } else @@ -226,20 +229,33 @@ if (defined('ENVIRONMENT')) } // The path to the "views" folder - if (is_dir($view_folder)) - { - define ('VIEWPATH', $view_folder .'/'); - } - else + if ( ! is_dir($view_folder)) { - if ( ! is_dir(APPPATH.'views/')) + if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.'/')) + { + $view_folder = APPPATH.$view_folder; + } + elseif ( ! is_dir(APPPATH.'views/')) { header('HTTP/1.1 503 Service Unavailable.', TRUE, '503'); exit('Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF); } + else + { + $view_folder = APPPATH.'views'; + } + } - define ('VIEWPATH', APPPATH.'views/' ); + if (realpath($view_folder) !== FALSE) + { + $view_folder = realpath($view_folder).'/'; } + else + { + $view_folder = rtrim($view_folder, '/').'/'; + } + + define ('VIEWPATH', $view_folder); /* * -------------------------------------------------------------------- @@ -251,4 +267,4 @@ if (defined('ENVIRONMENT')) require_once BASEPATH.'core/CodeIgniter.php'; /* End of file index.php */ -/* Location: ./index.php */ +/* Location: ./index.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 806ca600d3669343ee7ae90a9b5d65be9dfdbefe Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 12 Jun 2012 12:51:27 +0300 Subject: Some more index.php improvements --- index.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 680dccfea..380d1017b 100644 --- a/index.php +++ b/index.php @@ -174,9 +174,9 @@ if (defined('ENVIRONMENT')) chdir(dirname(__FILE__)); } - if (realpath($system_path) !== FALSE) + if (($_temp = realpath($system_path)) !== FALSE) { - $system_path = realpath($system_path).'/'; + $system_path = $_temp.'/'; } else { @@ -187,6 +187,7 @@ if (defined('ENVIRONMENT')) // Is the system path correct? if ( ! is_dir($system_path)) { + header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); exit('Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME)); } @@ -210,9 +211,9 @@ if (defined('ENVIRONMENT')) // The path to the "application" folder if (is_dir($application_folder)) { - if (realpath($system_path) !== FALSE) + if (($_temp = realpath($system_path)) !== FALSE) { - $application_folder = realpath($application_folder); + $application_folder = $_temp; } define('APPPATH', $application_folder.'/'); @@ -221,7 +222,7 @@ if (defined('ENVIRONMENT')) { if ( ! is_dir(BASEPATH.$application_folder.'/')) { - header('HTTP/1.1 503 Service Unavailable.', TRUE, '503'); + header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); exit('Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF); } @@ -237,7 +238,7 @@ if (defined('ENVIRONMENT')) } elseif ( ! is_dir(APPPATH.'views/')) { - header('HTTP/1.1 503 Service Unavailable.', TRUE, '503'); + header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); exit('Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF); } else @@ -246,7 +247,7 @@ if (defined('ENVIRONMENT')) } } - if (realpath($view_folder) !== FALSE) + if (($_temp = realpath($view_folder)) !== FALSE) { $view_folder = realpath($view_folder).'/'; } -- cgit v1.2.3-24-g4f1b From cce918033a99186cd76019d022571a8d9321d899 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 12 Jun 2012 13:25:31 +0300 Subject: Fix APPPATH --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 380d1017b..ad98013ca 100644 --- a/index.php +++ b/index.php @@ -211,7 +211,7 @@ if (defined('ENVIRONMENT')) // The path to the "application" folder if (is_dir($application_folder)) { - if (($_temp = realpath($system_path)) !== FALSE) + if (($_temp = realpath($application_folder)) !== FALSE) { $application_folder = $_temp; } @@ -256,7 +256,7 @@ if (defined('ENVIRONMENT')) $view_folder = rtrim($view_folder, '/').'/'; } - define ('VIEWPATH', $view_folder); + define('VIEWPATH', $view_folder); /* * -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From cbb654d9b332b65c5e2ae6f7bf8936b425b709ac Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 10 Jul 2012 11:36:32 +0300 Subject: Follow-up to #1398, #1548 --- index.php | 1 + 1 file changed, 1 insertion(+) (limited to 'index.php') diff --git a/index.php b/index.php index c379f72d0..aa1df441b 100644 --- a/index.php +++ b/index.php @@ -66,6 +66,7 @@ switch (ENVIRONMENT) break; default: + header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); exit('The application environment is not set correctly.'); } -- cgit v1.2.3-24-g4f1b From fe8324934f4bd15c86460975d265f72362cbbb3a Mon Sep 17 00:00:00 2001 From: vlakoff Date: Fri, 13 Jul 2012 20:40:06 +0200 Subject: Some adjustments in inline documentation --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'index.php') diff --git a/index.php b/index.php index aa1df441b..4955437bf 100644 --- a/index.php +++ b/index.php @@ -43,6 +43,7 @@ * NOTE: If you change these, also change the error_reporting() code below */ define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); + /* *--------------------------------------------------------------- * ERROR REPORTING @@ -51,7 +52,6 @@ * Different environments will require different levels of error reporting. * By default development will show errors but testing and live will hide them. */ - switch (ENVIRONMENT) { case 'development': -- cgit v1.2.3-24-g4f1b From e40e56f9bc77665b4b55549bd753424b770e3dfd Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sun, 15 Jul 2012 12:57:38 +0200 Subject: Fix in index.php inline documentation $routing['controller'] has to respect the capitalization of the filename, which is in lowercase. Otherwise, the application fails on case-sensitive servers. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'index.php') diff --git a/index.php b/index.php index 4955437bf..107a2095b 100644 --- a/index.php +++ b/index.php @@ -135,7 +135,7 @@ switch (ENVIRONMENT) // if your controller is not in a sub-folder within the "controllers" folder // $routing['directory'] = ''; - // The controller class file name. Example: Mycontroller + // The controller class file name. Example: mycontroller // $routing['controller'] = ''; // The controller function you wish to be called. -- cgit v1.2.3-24-g4f1b From 2eaeee5aa3971932e58ffac48554e554d799249f Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 21 Nov 2012 14:31:26 +0200 Subject: Change fs permissions and add some missing index.html files (#2017) --- index.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 index.php (limited to 'index.php') diff --git a/index.php b/index.php old mode 100644 new mode 100755 -- cgit v1.2.3-24-g4f1b