consolidate some code
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Sep 2010 21:03:02 +0000 (15:03 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 9 Sep 2010 23:10:09 +0000 (17:10 -0600)
framework/Core/lib/Horde.php

index e0fcc2d..6a2460e 100644 (file)
@@ -1680,19 +1680,12 @@ HTML;
         if (!class_exists($hook_class)) {
             try {
                 self::loadConfiguration('hooks.php', null, $app);
-            } catch (Horde_Exception $e) {
-                $error = true;
-            }
-        }
-
-        if (class_exists($hook_class)) {
-            $hook_ob = new $hook_class;
-            $error = !method_exists($hook_ob, $hook);
-        } else {
-            $error = true;
+            } catch (Horde_Exception $e) {}
         }
 
-        if ($error) {
+        if (!class_exists($hook_class) ||
+            !($hook_ob = new $hook_class) ||
+            !method_exists($hook_ob, $hook)) {
             throw new Horde_Exception_HookNotSet();
         }