Other scripts, such as a CLI script, would include the bootstrap and then do whatever it needs to do (which usually doesn't involve dispatching the front controller).
--
Hector
On Fri, Jan 22, 2010 at 11:35 AM, sina miandashti <miandashti@gmail.com> wrote:
hi
i create the $db object by this code in my root index.php :
/*
* DB instance
*/
$dbConfig = $config->get ( 'db' )->toArray ();
$db = Zend_Db::factory ( $dbConfig ['adapter'], $dbConfig ['db'] );
try {
$db->query("SET NAMES 'utf8'");
} catch ( Zend_Exception $e ) {
die ( $e->getMessage () );
}
/*
* add stuff to registery
*/
//Zend_Registry::set('templateEngine',$templateEngine);
Zend_Registry::set ( 'db', $db );
Zend_Db_Table_Abstract::setDefaultAdapter($db);
$db->getProfiler()->setEnabled(true);
but
i saw lot of example that doing this in bootstrap.php
what choice is better between this 2 methods of declaring main objects like $db $cache $debug and ...?
what is the difference between using these file ?
--
________________
Sincerely
Sina Miandashti
MuSicBasE.ir & InvisionPower.ir Admin
没有评论:
发表评论