apprentice (77) [Avatar] Offline
#1
My edit view page breaks and looks like this in the browser when I try to store the $database into registry. Going from 1.7.1 code to 1.8 and above is confusing to me smilie

Edit view page - Error
http://pastebin.com/m27ec7886

application/configs/application.ini
http://pastebin.com/m4c2fd8a3

Bootstrap
http://pastebin.com/m2c247624



This ZF 1.7.1 Bootstrap code seem to be causing the Errors. How can I fix this so that it works for ZF 1.8 and above?

<pre>
protected function _initRegDatabase()
{
$db = Zend_Db::factory($this->_config->db);
Zend_Db_Table_Abstract::setDefaultAdapter($db);
Zend_Registry::set('db', $db);
}
</pre>
apprentice (77) [Avatar] Offline
#2
Re: [1.8] - How do you store $database object to the Zend_Registry?
Bootstrap
http://pastebin.com/m292f0d40

Working with Zend_Application resources doesn't require setting the $config object to the Zend_Registry anymore. Less code compared to how Bootstrap worked before ZF 1.8.

[pre]
protected function _initRegDatabase()
{
$this->bootstrap('db');
$resourceDb = $this->getResource('db');
//var_dump($resourceDb); exit;

Zend_Db_Table_Abstract::setDefaultAdapter($resourceDb);
Zend_Registry::set('db', $resourceDb);
}
[/pre]