summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorvlakoff <vlakoff@gmail.com>2014-04-12 07:33:42 +0200
committervlakoff <vlakoff@gmail.com>2014-04-12 07:33:42 +0200
commitcdf3dfae82acf2dde5db1adb3b87c642a894d4d4 (patch)
treedbf10e70e22fab8f893b218b1986a9163c7ce598 /system
parent119d94f829ea54e6c3d2f9d03c46d9b74e8a453e (diff)
Make the error templates path configurable
Diffstat (limited to 'system')
-rw-r--r--system/core/Exceptions.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php
index 041869641..398459d54 100644
--- a/system/core/Exceptions.php
+++ b/system/core/Exceptions.php
@@ -45,6 +45,13 @@ class CI_Exceptions {
public $ob_level;
/**
+ * Path to the error templates
+ *
+ * @var string
+ */
+ protected $_templates_path;
+
+ /**
* List if available error levels
*
* @var array
@@ -73,6 +80,12 @@ class CI_Exceptions {
{
$this->ob_level = ob_get_level();
// Note: Do not log messages from this constructor.
+
+ $config =& get_config();
+
+ $this->_templates_path = (isset($config['error_templates_path']) && $config['error_templates_path'] !== '')
+ ? $config['error_templates_path']
+ : VIEWPATH.'errors'.DIRECTORY_SEPARATOR;
}
// --------------------------------------------------------------------
@@ -162,7 +175,7 @@ class CI_Exceptions {
ob_end_flush();
}
ob_start();
- include(VIEWPATH.'errors'.DIRECTORY_SEPARATOR.$template.'.php');
+ include($this->_templates_path.$template.'.php');
$buffer = ob_get_contents();
ob_end_clean();
return $buffer;
@@ -205,7 +218,7 @@ class CI_Exceptions {
ob_end_flush();
}
ob_start();
- include(VIEWPATH.'errors'.DIRECTORY_SEPARATOR.$template.'.php');
+ include($this->_templates_path.$template.'.php');
$buffer = ob_get_contents();
ob_end_clean();
echo $buffer;