diff options
author | Andrey Andreev <narf@devilix.net> | 2014-04-14 15:02:17 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-04-14 15:02:17 +0200 |
commit | db0873365aabce72390fe9ccf19081de143a1d51 (patch) | |
tree | 8368a786a4c9c7ffb57596abf66d8b80fde73c66 /system/core/Exceptions.php | |
parent | 72daa197768f5ff86e009ff7afc171da21adc8db (diff) | |
parent | 787fe1384287ff3a2360815036e70a9a79c714da (diff) |
Merge pull request #2999 from vlakoff/error-templates
Make the error templates path configurable
Diffstat (limited to 'system/core/Exceptions.php')
-rw-r--r-- | system/core/Exceptions.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php index 041869641..5bcb7c1c5 100644 --- a/system/core/Exceptions.php +++ b/system/core/Exceptions.php @@ -145,6 +145,10 @@ class CI_Exceptions { */ public function show_error($heading, $message, $template = 'error_general', $status_code = 500) { + $templates_path = config_item('error_views_path') + ? config_item('error_views_path') + : VIEWPATH.'errors'.DIRECTORY_SEPARATOR; + if (is_cli()) { $message = "\t".(is_array($message) ? implode("\n\t", $message) : $message); @@ -162,7 +166,7 @@ class CI_Exceptions { ob_end_flush(); } ob_start(); - include(VIEWPATH.'errors'.DIRECTORY_SEPARATOR.$template.'.php'); + include($templates_path.$template.'.php'); $buffer = ob_get_contents(); ob_end_clean(); return $buffer; @@ -181,6 +185,10 @@ class CI_Exceptions { */ public function show_php_error($severity, $message, $filepath, $line) { + $templates_path = config_item('error_views_path') + ? config_item('error_views_path') + : VIEWPATH.'errors'.DIRECTORY_SEPARATOR; + $severity = isset($this->levels[$severity]) ? $this->levels[$severity] : $severity; // For safety reasons we don't show the full file path in non-CLI requests @@ -205,7 +213,7 @@ class CI_Exceptions { ob_end_flush(); } ob_start(); - include(VIEWPATH.'errors'.DIRECTORY_SEPARATOR.$template.'.php'); + include($templates_path.$template.'.php'); $buffer = ob_get_contents(); ob_end_clean(); echo $buffer; |