Made Environment Support optional. Comment out or delete the constant to stop environment checks.
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index e537cde..f8073d2 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -58,7 +58,7 @@
$extension = end($x);
// Load the mime types
- if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+ if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
{
include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
}
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 7a35c3f..4434494 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -352,7 +352,7 @@
if ( ! is_array($mimes))
{
- if (is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
+ if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT))
{
include(APPPATH.'config/'.ENVIRONMENT.'/mimes'.EXT);
}
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index 53fc899..c6103ab 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -258,7 +258,7 @@
if ( ! is_array($_doctypes))
{
- if (is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT))
+ if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT))
{
include(APPPATH.'config/'.ENVIRONMENT.'/doctypes'.EXT);
}
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index 6c90151..a2d1031 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -229,26 +229,21 @@
{
function _get_smiley_array()
{
- if ( ! file_exists(APPPATH.'config/smileys'.EXT) AND ! file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT))
- {
- return FALSE;
- }
-
- if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT))
+ if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT))
{
include(APPPATH.'config/'.ENVIRONMENT.'/smileys'.EXT);
}
- else
+ elseif (file_exists(APPPATH.'config/smileys'.EXT))
{
include(APPPATH.'config/smileys'.EXT);
}
- if ( ! isset($smileys) OR ! is_array($smileys))
+ if (isset($smileys) AND is_array($smileys))
{
- return FALSE;
+ return $smileys;
}
- return $smileys;
+ return FALSE;
}
}
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 6644089..cca0939 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -366,7 +366,7 @@
{
function convert_accented_characters($str)
{
- if (is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT))
+ if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT))
{
include(APPPATH.'config/'.ENVIRONMENT.'/foreign_chars'.EXT);
}