2012-06-01 3 views

답변

0

이 작업을 수행하는 대신

$params = Zend_Db_Table::getDefaultAdapter()->getConfig(); //return associative array 
0

그것은 당신이 내가 발견 한 가장 쉬운 방법은 부트 스트랩 동안 레지스트리에 모든 것을 넣어하는 것입니다 대해 질문 방식으로 수행합니다

//bootstrap.php 
public function _initConfig { 
    $config = new Zend_Config($this->getOptions()); 
    Zend_Registry::set('config', $config); 
} 

하는 것은 이러한 사용을 애플리케이션의 다른 곳에서 구성 :

$db = Zend_Registry::get('config')->resources->db; 

어댑터 등록기에 액세스하려는 경우 application.ini의 빨간색 :

$db = Zend_Db_Table::getDefaultAdapter(); 
관련 문제