From: Jan Schneider Date: Mon, 21 Sep 2009 16:09:27 +0000 (+0200) Subject: Don't use Horde_Db. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=048fd2907ef4ace8bce776d35fff2427ca173825;p=horde.git Don't use Horde_Db. Reduce indention. --- diff --git a/kronolith/lib/Tagger.php b/kronolith/lib/Tagger.php index af14dbc77..995ecdc52 100644 --- a/kronolith/lib/Tagger.php +++ b/kronolith/lib/Tagger.php @@ -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]); } /**