Don't use Horde_Db.
authorJan Schneider <jan@horde.org>
Mon, 21 Sep 2009 16:09:27 +0000 (18:09 +0200)
committerJan Schneider <jan@horde.org>
Mon, 21 Sep 2009 16:09:27 +0000 (18:09 +0200)
Reduce indention.

kronolith/lib/Tagger.php

index af14dbc..995ecdc 100644 (file)
@@ -37,34 +37,34 @@ class Kronolith_Tagger
      */
     public function __construct()
     {
-        if (is_null(self::$_tagger)) {
-            // Set up the context for the tagger and related content classes
-            $GLOBALS['conf']['sql']['adapter'] = $GLOBALS['conf']['sql']['phptype'] == 'mysqli' ?
-                             'mysqli' :
-                             'pdo_' . $GLOBALS['conf']['sql']['phptype'];
+        if (self::$_tagger) {
+            return;
+        }
 
-            Horde_Db::setAdapter(Horde_Db_Adapter::factory($GLOBALS['conf']['sql']));
+        // Set up the context for the tagger and related content classes
+        $GLOBALS['conf']['sql']['adapter'] = $GLOBALS['conf']['sql']['phptype'] == 'mysqli'
+            ? 'mysqli'
+            : 'pdo_' . $GLOBALS['conf']['sql']['phptype'];
 
-            $context = array('dbAdapter' => Horde_Db::getAdapter());
-            $user_mgr = new Content_Users_Manager($context);
-            $type_mgr = new Content_Types_Manager($context);
+        $context = array('dbAdapter' => Horde_Db_Adapter::factory($GLOBALS['conf']['sql']));
+        $user_mgr = new Content_Users_Manager($context);
+        $type_mgr = new Content_Types_Manager($context);
 
-            // Objects_Manager requires a Types_Manager
-            $context['typeManager'] = $type_mgr;
-            $object_mgr = new Content_Objects_Manager($context);
+        // Objects_Manager requires a Types_Manager
+        $context['typeManager'] = $type_mgr;
+        $object_mgr = new Content_Objects_Manager($context);
 
-            // Create the Content_Tagger
-            $context['userManager'] = $user_mgr;
-            $context['objectManager'] = $object_mgr;
+        // Create the Content_Tagger
+        $context['userManager'] = $user_mgr;
+        $context['objectManager'] = $object_mgr;
 
-            // Cache the object statically
-            self::$_tagger = new Content_Tagger($context);
-            $types = $type_mgr->ensureTypes(array('calendar', 'event'));
+        // Cache the object statically
+        self::$_tagger = new Content_Tagger($context);
+        $types = $type_mgr->ensureTypes(array('calendar', 'event'));
 
-            // Remember the types to avoid having Content query them again.
-            self::$_type_ids = array('calendar' => (int)$types[0],
-                                     'event' => (int)$types[1]);
-        }
+        // Remember the types to avoid having Content query them again.
+        self::$_type_ids = array('calendar' => (int)$types[0],
+                                 'event' => (int)$types[1]);
     }
 
     /**