2010年1月22日星期五

Re: [fw-mvc] difference between coding in index.php & bootstrap.php

Queres hacer laburar a los de sistemas?

Estas loco no te van a dar bola :P





----------------------------------------
Pablo Morales
blog: http://blog.pablo-morales.com
linkedln: http://www.linkedin.com/pub/9/528/21
skype: pablofmorales
gtalk: pablofmorales@gmail.com
msn: pfm_mc@hotmail.com



On Fri, Jan 22, 2010 at 16:35, 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

没有评论: