🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.php
Article #220110

Re: [ZendFramework] bootstrap i Zend_Db_Table_Abstract::getDefaultAdapter()

#220110
From: Krzysztof Szatanik
Date: Thu, 13 Aug 2009 20:24
48 lines
2651 bytes
Marcin pisze:
> Krzysztof Szatanik pisze:
>> Hmmm... W sumie nie sprawdzałem... Trzeba będzie jutro to sprawdzić 
>> debugerem.
>>
> 
> ... i jak? :) ja nie mam pomyslu jak to zdebugowac ;)


	Zarówno ordynarne echo '<pre>' . time() ; print_r( $config ); echo 
'</pre>'; w konstruktorze Zend_Db_Adapter_Pdo_Pgsql, jak i breakpoint i 
debug twierdzą że Zend_Db_Adapter_Pdo_Pgsql dla takich ustawień:

resources.db.adapter = "PDO_PGSQL"
resources.db.isdefaulttableadapter = true
resources.db.params.dbname = ###
resources.db.params.username = ###
resources.db.params.password = ###
resources.db.params.adapterNamespace = Mao_Db_Adapter
resources.db.params.charset = "utf8"

i metodzie w bootstrapie:

     protected function _initDB()
     {
         // Database
         if( $this->config->resources->db ) {
             $db = Zend_Db::factory( $this->config->db );
             Mao_Db_Table:::setDefaultAdapter( $db );

             $cache = Zend_Registry::get ( 'cache' );
             Mao_Db_Table::setDefaultMetadataCache ( $cache );

             $profiler = new Zend_Db_Profiler_Firebug ( 'Main DB' );
             $db->setProfiler ( $profiler );
             $db->getProfiler ()->setEnabled ( true );

             Zend_Registry::set( 'db', $db );

         }
     }

wykonują się tylko raz. Na razie po całym dniu walk to mi wystarczy, 
analizę działania Zend_Application_Bootstrap pozostawiam sobie na czasy 
kiedy będę miał troszkę mniej na głowie (jeśli takie nadejdą :(

-- 
K.
Technical Details
Message-ID: <h61sq3$3v8$1@inews.gazeta.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!newsfeed.pionier.net.pl!news.gazeta.pl!not-for-mail
References: <h5rl7c$4bc$1@nemesis.news.neostrada.pl> <h5sl29$77o$1@inews.gazeta.pl> <h5u6ku$25i$1@atlantis.news.neostrada.pl> <h5ul6k$2iv$1@inews.gazeta.pl> <h60tqj$i8b$1@nemesis.news.neostrada.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!newsfeed.pionier.net.pl!news.gazeta.pl!not-for-mail
From: Krzysztof Szatanik <dbl001@wytnij.o2.aby.doszlo.w.pl>
Newsgroups: pl.comp.lang.php
Subject: Re: [ZendFramework] bootstrap i Zend_Db_Table_Abstract::getDefaultAdapter()
Date: Thu, 13 Aug 2009 22:24:34 +0200
Organization: "Portal Gazeta.pl -> http://www.gazeta.pl"
Lines: 48
Message-ID: <h61sq3$3v8$1@inews.gazeta.pl>
References: <h5rl7c$4bc$1@nemesis.news.neostrada.pl> <h5sl29$77o$1@inews.gazeta.pl> <h5u6ku$25i$1@atlantis.news.neostrada.pl> <h5ul6k$2iv$1@inews.gazeta.pl> <h60tqj$i8b$1@nemesis.news.neostrada.pl>
NNTP-Posting-Host: chello089074132059.chello.pl
Mime-Version: 1.0
X-Trace: inews.gazeta.pl 1250195075 4072 89.74.132.59 (13 Aug 2009 20:24:35 GMT)
X-Complaints-To: usenet@agora.pl
NNTP-Posting-Date: Thu, 13 Aug 2009 20:24:35 +0000 (UTC)
X-User: dbl001
In-Reply-To: <h60tqj$i8b$1@nemesis.news.neostrada.pl>
User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit