From: Chuck Hagenbuch Date: Sat, 3 Jan 2009 04:33:28 +0000 (-0500) Subject: instantiate all managers in the ApplicationController X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=48328bc488190c4ef59dd93a49ef76a5a187d108;p=horde.git instantiate all managers in the ApplicationController --- diff --git a/content/app/controllers/ApplicationController.php b/content/app/controllers/ApplicationController.php index b0b27ed7a..c8ef64512 100644 --- a/content/app/controllers/ApplicationController.php +++ b/content/app/controllers/ApplicationController.php @@ -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); } } diff --git a/content/app/controllers/TagController.php b/content/app/controllers/TagController.php index d90b117de..196e486dc 100644 --- a/content/app/controllers/TagController.php +++ b/content/app/controllers/TagController.php @@ -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(