2009年10月7日星期三

Re: [fw-db] Fatal error: Uncaught exception 'Zend_Db_Exception' with message 'Adapter name must be specified in a string'

Thanks Duo for the pointers I finally managed to make some sense out of that Zend manual :-P
Reading that manual is like 99% theoretical mumbo jumbo and 1% practical examples.


Solution

Bootstrap
http://pastebin.com/m63044980

  1.         protected function _initRegDatabase()
  2.         {
  3. //_________
  4. //
  5. //   DUO
  6. //_________
  7.  
  8. /*
  9. $resource = $bootstrap->getPluginResource('db');
  10. $db = $resource->getDbAdapter();
  11. var_dump($db); exit;
  12. */
  13.  
  14. $this->bootstrap('db');
  15. $resourceDb = $this->getResource('db');
  16. //var_dump($resourceDb); exit;
  17.  
  18. Zend_Db_Table_Abstract::setDefaultAdapter($resourceDb);
  19. Zend_Registry::set('db', $resourceDb);
  20.  
  21.         }

/apprentice

没有评论: