instantiate all managers in the ApplicationController
authorChuck Hagenbuch <chuck@horde.org>
Sat, 3 Jan 2009 04:33:28 +0000 (23:33 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Sat, 3 Jan 2009 04:33:28 +0000 (23:33 -0500)
content/app/controllers/ApplicationController.php
content/app/controllers/TagController.php

index b0b27ed..c8ef645 100644 (file)
@@ -6,8 +6,20 @@ class Content_ApplicationController extends Horde_Controller_Base
         $CONTENT_DIR = dirname(__FILE__) . '/../';
 
         $GLOBALS['conf']['sql']['adapter'] = $GLOBALS['conf']['sql']['phptype'] == 'mysqli' ? 'mysqli' : 'pdo_' . $GLOBALS['conf']['sql']['phptype'];
-        Horde_Rdo::setAdapter(Horde_Rdo_Adapter::factory('pdo', $GLOBALS['conf']['sql']));
-        Horde_Db::setAdapter(Horde_Db_Adapter::factory($GLOBALS['conf']['sql']));
+
+        $db = Horde_Db_Adapter::factory($GLOBALS['conf']['sql']);
+        $context = array('dbAdapter' => $db);
+
+        $this->typeManager = new Content_Types_Manager($context);
+        $context['typeManager'] = $this->typeManager;
+
+        $this->userManager = new Content_Users_Manager($context);
+        $context['userManager'] = $this->userManager;
+
+        $this->objectManager = new Content_Objects_Manager($context);
+        $context['objectManager'] = $this->objectManager;
+
+        $this->tagger = new Content_Tagger($context);
     }
 
 }
index d90b117..196e486 100644 (file)
@@ -13,13 +13,6 @@ class TagController extends Content_ApplicationController
 {
     /**
      */
-    protected function _initialize()
-    {
-        $this->tagger = new Content_Tagger(array('dbAdapter' => Horde_Db::getAdapter()));
-    }
-
-    /**
-     */
     public function searchTags()
     {
         $this->tags = $this->tagger->getTags(array(