diff --git a/classes/Tools.php b/classes/Tools.php
index 1b7ce1d66..2b9310b1d 100644
--- a/classes/Tools.php
+++ b/classes/Tools.php
@@ -776,6 +776,33 @@ class ToolsCore
{
return (Tools::dieObject($object, $kill));
}
+
+ public static function debug_backtrace($start = 0, $limit = null)
+ {
+ $backtrace = debug_backtrace();
+ array_shift($backtrace);
+ for ($i = 0; $i < $start; ++$i)
+ array_shift($backtrace);
+
+ echo '
+
+
';
+ $i = 0;
+ foreach ($backtrace as $id => $trace)
+ {
+ if ((int)$limit && (++$i > $limit ))
+ break;
+ $relative_file = (isset($trace['file'])) ? 'in /'.ltrim(str_replace(array(_PS_ROOT_DIR_, '\\'), array('', '/'), $trace['file']), '/') : '';
+ $current_line = (isset($trace['line'])) ? ':'.$trace['line'] : '';
+
+ echo '-
+ '.((isset($trace['class'])) ? $trace['class'] : '').((isset($trace['type'])) ? $trace['type'] : '').$trace['function'].'
+ '.$relative_file.$current_line.'
+
';
+ }
+ echo '
+
';
+ }
/**
* ALIAS OF dieObject() - Display an error with detailed object but don't stop the execution
diff --git a/classes/exception/PrestaShopException.php b/classes/exception/PrestaShopException.php
index 1476cd612..465bf0ddd 100644
--- a/classes/exception/PrestaShopException.php
+++ b/classes/exception/PrestaShopException.php
@@ -51,7 +51,7 @@ class PrestaShopExceptionCore extends Exception
';
echo '';
echo '
['.get_class($this).']
';
- echo $this->getExentedMessage();
+ echo $this->getExtendedMessage();
$this->displayFileDebug($this->getFile(), $this->getLine());
@@ -145,14 +145,23 @@ class PrestaShopExceptionCore extends Exception
{
$logger = new FileLogger();
$logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_exception.log');
- $logger->logError($this->getExentedMessage(false));
+ $logger->logError($this->getExtendedMessage(false));
+ }
+
+ /**
+ * @deprecated 1.5.5
+ */
+ protected function getExentedMessage($html = true)
+ {
+ Tools::displayAsDeprecated();
+ return $this->getExtendedMessage($html);
}
/**
* Return the content of the Exception
* @return string content of the exception
*/
- protected function getExentedMessage($html = true)
+ protected function getExtendedMessage($html = true)
{
$format = '
%s
at line %d in file %s
';
if (!$html)