protected function getDb2()
    {
        if (!$this->db2 instanceof Adapter) {
            $config = Zend_Controller_Front::getInstance()->getParam('bootstrap');
            $resources = $config->getOption('resources');
            $dbConfig = array(
                'driver'   => $resources['db']['adapter'],
                'hostname' => $resources['db']['params']['host'],
                'database' => $resources['db']['params']['dbname'],
                'username' => $resources['db']['params']['username'],
                'password' => $resources['db']['params']['password'],
                'charset'  => $resources['db']['params']['charset'],
            );

            $this->db2 = new Adapter($dbConfig);
        }

        return $this->db2;
    }
protected function getDb2()
    {
        if (!$this->db2 instanceof Adapter) {
            $config = Zend_Controller_Front::getInstance()->getParam('bootstrap');
            $resources = $config->getOption('resources');
            $dbConfig = array(
                'driver'   => $resources['db']['adapter'],
                'hostname' => $resources['db']['params']['host'],
                'database' => $resources['db']['params']['dbname'],
                'username' => $resources['db']['params']['username'],
                'password' => $resources['db']['params']['password'],
                'charset'  => $resources['db']['params']['charset'],
            );

            $this->db2 = new Adapter($dbConfig);
        }

        return $this->db2;
    }
protected function getDb2 ( ) { if ( ! $ this -> db2 instanceof Adapter ) { $ config = Zend_Controller_Front :: getInstance ( ) -> getParam ( 'bootstrap' ) ; $ resources = $ config -> getOption ( 'resources' ) ; $ dbConfig = array ( 'driver' => $ resources [ 'db' ] [ 'adapter' ] , 'hostname' => $ resources [ 'db' ] [ 'params' ] [ 'host' ] , 'database' => $ resources [ 'db' ] [ 'params' ] [ 'dbname' ] , 'username' => $ resources [ 'db' ] [ 'params' ] [ 'username' ] , 'password' => $ resources [ 'db' ] [ 'params' ] [ 'password' ] , 'charset' => $ resources [ 'db' ] [ 'params' ] [ 'charset' ] , ) ; $ this -> db2 = new Adapter ( $ dbConfig ) ; } return $ this -> db2 ; }
Create a Zend DB 2 Adapter needed for the Zend\Authentication library
@return Zend\Db\Adapter\Adapter Zend Db Adapter
Create a Zend DB 2 Adapter needed for the Zend \ Authentication library