Check for, and throw exception if Content_Tagger class cannot be found
authorMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 4 Nov 2009 06:51:53 +0000 (01:51 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Wed, 4 Nov 2009 06:51:53 +0000 (01:51 -0500)
from base.php. Temporary measure until Content_* system is better integrated
with framework/autoloading etc...

Bug: 7936

kronolith/lib/Tagger.php
kronolith/lib/base.php

index 995ecdc..f45c578 100644 (file)
@@ -8,13 +8,6 @@
  *
  * @package Kronolith
  */
-
-// NOTE: For now, autoloading depends on there being a registry entry for the
-//       'content' application.
-
-Horde_Autoloader::addClassPattern('/^Content_/',
-                                  $GLOBALS['registry']->get('fileroot', 'content') . '/lib/');
-
 class Kronolith_Tagger
 {
 
index 1774af7..1414276 100644 (file)
@@ -47,6 +47,14 @@ try {
 $conf = &$GLOBALS['conf'];
 define('KRONOLITH_TEMPLATES', $registry->get('templates'));
 
+/* For now, autoloading the Content_* classes depend on there being a registry
+ * entry for the 'content' application that contains at least the fileroot
+ * entry. */
+Horde_Autoloader::addClassPattern('/^Content_/', $GLOBALS['registry']->get('fileroot', 'content') . '/lib/');
+if (!class_exists('Content_Tagger')) {
+    throw new Horde_Exception(_("The Content_Tagger class could not be found. Make sure the registry entry for the Content system is present."));
+}
+
 /* Notification system. */
 $GLOBALS['notification'] = Horde_Notification::singleton();
 $GLOBALS['kronolith_notify'] = $GLOBALS['notification']->attach('status', null, 'Kronolith_Notification_Listener_Status');