From: Jan Schneider Date: Wed, 11 Aug 2010 21:27:09 +0000 (+0200) Subject: Show backtrace in fatal(). X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e982ba84014b73a18ca658d5c9adf95cfa34a309;p=horde.git Show backtrace in fatal(). --- diff --git a/framework/Cli/lib/Horde/Cli.php b/framework/Cli/lib/Horde/Cli.php index bdf203fe6..5d4ac48c2 100644 --- a/framework/Cli/lib/Horde/Cli.php +++ b/framework/Cli/lib/Horde/Cli.php @@ -305,6 +305,12 @@ class Horde_Cli */ public function fatal($error) { + if ($error instanceof Exception) { + $trace = $error; + } else { + $trace = debug_backtrace(); + } + $backtrace = new Horde_Support_Backtrace($trace); if (is_object($error) && method_exists($error, 'getMessage')) { $error = $error->getMessage(); } @@ -313,6 +319,7 @@ class Horde_Cli $this->writeln($this->red(_("Fatal Error:"))); $this->writeln($this->red($error)); $this->writeln(); + $this->writeln($backtrace->getMap()); $this->writeln($this->red('====================')); exit(1); } diff --git a/framework/Cli/package.xml b/framework/Cli/package.xml index eceada0d5..0574bca4a 100644 --- a/framework/Cli/package.xml +++ b/framework/Cli/package.xml @@ -60,6 +60,10 @@ http://pear.php.net/dtd/package-2.0.xsd"> gettext + + Support + pear.horde.org +