From 533d44b3d17aa8467d034e37d4b1afa1832509f5 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 25 Mar 2010 00:45:49 -0600 Subject: [PATCH] Remove unused code --- framework/Core/lib/Horde.php | 39 +++++++++------------------------------ 1 file changed, 9 insertions(+), 30 deletions(-) diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index 3fe74d85f..39155c58f 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -85,42 +85,21 @@ class Horde $cli = Horde_Cli::runningFromCLI(); $errortext = '

' . _("A fatal error has occurred") . '

'; - if ($error instanceof PEAR_Error) { - $info = array_merge(array('file' => 'conf.php', 'variable' => '$conf'), - array($error->getUserInfo())); - - switch ($error->getCode()) { - case Horde_Util::HORDE_ERROR_DRIVER_CONFIG_MISSING: - $message = sprintf(_("No configuration information specified for %s."), $info['name']) . '
' . - sprintf(_("The file %s should contain some %s settings."), - $GLOBALS['registry']->get('fileroot') . '/config/' . $info['file'], - sprintf("%s['%s']['params']", $info['variable'], $info['driver'])); - break; - - case Horde_Util::HORDE_ERROR_DRIVER_CONFIG: - $message = sprintf(_("Required \"%s\" not specified in %s configuration."), $info['field'], $info['name']) . '
' . - sprintf(_("The file %s should contain a %s setting."), - $GLOBALS['registry']->get('fileroot') . '/config/' . $info['file'], - sprintf("%s['%s']['params']['%s']", $info['variable'], $info['driver'], $info['field'])); - break; - - default: - $message = $error->getMessage(); - break; - } - $errortext .= '

' . htmlspecialchars($message) . '

'; - } elseif (is_object($error) && method_exists($error, 'getMessage')) { + if (($error instanceof PEAR_Error) || + (is_object($error) && method_exists($error, 'getMessage'))) { $errortext .= '

' . htmlspecialchars($error->getMessage()) . '

'; } elseif (is_string($error)) { $errortext .= '

' . htmlspecialchars($error) . '

'; } - if (is_null($file) && $error instanceof Exception) { - $file = $error->getFile(); - } - if (is_null($line) && $error instanceof Exception) { - $line = $error->getLine(); + if ($error instanceof Exception) { + if (is_null($file)) { + $file = $error->getFile(); + } + if (is_null($line)) { + $line = $error->getLine(); + } } if ($admin) { -- 2.11.0