Permalink
Browse files

update index.php.in

  • Loading branch information...
Carl Fürstenberg
Carl Fürstenberg committed Jan 8, 2013
1 parent 8f391eb commit a872b8c56ccf942ba5bba41c484edc5fbe24eff3
Showing with 23 additions and 6 deletions.
  1. +23 −6 debian/index.php.in
View
@@ -1,14 +1,31 @@
<?php
-error_reporting(E_ALL);
+define('ENVIRONMENT', 'production');
-$system_path = "/usr/share/codeigniter/system";
+if (defined('ENVIRONMENT'))
+{
+ switch (ENVIRONMENT)
+ {
+ case 'development':
+ error_reporting(E_ALL);
+ break;
+
+ case 'testing':
+ case 'production':
+ error_reporting(0);
+ break;
+
+ default:
+ exit('The application environment is not set correctly.');
+ }
+}
+
+$system_path = "/usr/share/codeigniter/system/";
$application_folder = "#APPLICATION#";
-define('EXT', '.php');
define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));
+define('BASEPATH', str_replace("\\", "/", $system_path));
define('FCPATH', str_replace(SELF, '', __FILE__));
-define('BASEPATH', $system_path.'/');
-define('APPPATH', $application_folder.'/');
define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/'));
+define('APPPATH', $application_folder.'/');
-require_once BASEPATH.'core/CodeIgniter'.EXT;
+require_once BASEPATH.'core/CodeIgniter.php';

0 comments on commit a872b8c

Please sign in to comment.