summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/config/constants.php12
-rw-r--r--application/errors/error_php.php17
-rw-r--r--user_guide_src/source/changelog.rst1
3 files changed, 30 insertions, 0 deletions
diff --git a/application/config/constants.php b/application/config/constants.php
index 4a879d360..ee177f5ad 100644
--- a/application/config/constants.php
+++ b/application/config/constants.php
@@ -36,6 +36,18 @@ define('FOPEN_READ_WRITE_CREATE', 'a+b');
define('FOPEN_WRITE_CREATE_STRICT', 'xb');
define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
+/*
+|--------------------------------------------------------------------------
+| Display Debug backtrace
+|--------------------------------------------------------------------------
+|
+| If set to TRUE, a backtrace will be displayed along with php errors. If
+| error_reporting is disabled, the backtrace will not display, regardless
+| of this setting
+|
+*/
+define('SHOW_DEBUG_BACKTRACE', TRUE);
+
/* End of file constants.php */
/* Location: ./application/config/constants.php */ \ No newline at end of file
diff --git a/application/errors/error_php.php b/application/errors/error_php.php
index f085c2037..514e477e8 100644
--- a/application/errors/error_php.php
+++ b/application/errors/error_php.php
@@ -7,4 +7,21 @@
<p>Filename: <?php echo $filepath; ?></p>
<p>Line Number: <?php echo $line; ?></p>
+<?php if(defined('SHOW_DEBUG_BACKTRACE') && SHOW_DEBUG_BACKTRACE === TRUE): ?>
+
+ <p>Backtrace: </p>
+ <?php foreach(debug_backtrace() as $error): ?>
+
+ <?php if(isset($error['file']) && ! stristr($error['file'], SYSDIR)): ?>
+ <p style="margin-left:10px">
+ File: <?php echo $error['file'] ?><br />
+ Line: <?php echo $error['line'] ?><br />
+ Function: <?php echo $error['function'] ?>
+ </p>
+ <? endif ?>
+
+ <? endforeach ?></p>
+
+<?php endif ?>
+
</div> \ No newline at end of file
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 8598585ce..8249b63ad 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -9,6 +9,7 @@ Release Date: Not Released
- General Changes
+ - Added an optional backtrace to php-error template.
- Added Android to the list of user agents.
- Added Windows 7 to the list of user platforms.
- Callback validation rules can now accept parameters like any other