Disabled debug_backtrace logging for PHP < 5.3.6

This commit is contained in:
Josh Sherman 2012-11-08 13:54:35 -05:00
parent 6c7d48278c
commit de89ef85d1
2 changed files with 26 additions and 12 deletions

View file

@ -152,6 +152,12 @@ class Database_PDO_Common extends Database_Common
if ($sql != '')
{
$files = array();
// Ubuntu 10.04 is a bit behind on PHP 5.3.x and the IGNORE_ARGS
// constant doesn't exist. To conserve memory, the backtrace will
// Only be used on servers running PHP 5.3.6 or above.
if (version_compare(PHP_VERSION, '5.3.6', '>='))
{
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
krsort($backtrace);
@ -162,6 +168,7 @@ class Database_PDO_Common extends Database_Common
$files[] = $file['class'] . ':' . $file['line'];
}
}
}
$sql .= "\n" . '/* [' . implode('|', $files) . '] */';

View file

@ -1927,6 +1927,12 @@ class Database_PDO_Common extends Database_Common
if ($sql != '')
{
$files = array();
// Ubuntu 10.04 is a bit behind on PHP 5.3.x and the IGNORE_ARGS
// constant doesn't exist. To conserve memory, the backtrace will
// Only be used on servers running PHP 5.3.6 or above.
if (version_compare(PHP_VERSION, '5.3.6', '>='))
{
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
krsort($backtrace);
@ -1937,6 +1943,7 @@ class Database_PDO_Common extends Database_Common
$files[] = $file['class'] . ':' . $file['line'];
}
}
}
$sql .= "\n" . '/* [' . implode('|', $files) . '] */';