throw an exception if an API class doesn't exist, instead of a fatal error
authorChuck Hagenbuch <chuck@horde.org>
Mon, 17 Aug 2009 02:27:43 +0000 (22:27 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Mon, 17 Aug 2009 02:27:43 +0000 (22:27 -0400)
framework/Core/lib/Horde/Registry.php

index 771c25f..b90ad11 100644 (file)
@@ -384,8 +384,11 @@ class Horde_Registry
             $classname = 'Horde_Registry_' . $cname;
         }
 
-        $this->_cache['ob'][$app][$type] = new $classname;
+        if (!class_exists($classname, false)) {
+            throw new Horde_Exception("$app does not have an API");
+        }
 
+        $this->_cache['ob'][$app][$type] = new $classname;
         return $this->_cache['ob'][$app][$type];
     }