this tutorial을 사용하여 zend 어플리케이션에 mysql 테이블 (인증)을 연결하려고합니다. 그러나 DbTable의 인스턴스를 가져올 수 없습니다. 내 응용 프로그램에서 directory structure 만 변경했습니다.Zend에서 MySQL에 연결할 수 없습니다.
나는이 같은 매퍼 뭔가 :
class Model_Authentication_Mapper {
protected $_dbTable;
public function setDbTable($dbTable) {
if (is_string($dbTable)) {
$dbTable = new $dbTable();
}
if (!$dbTable instanceof Zend_Db_Table_Abstract) {
throw new Exception('Invalid table data gateway provided');
}
$this->_dbTable = $dbTable;
return $this;
}
public function getDbTable() {
if (null === $this->_dbTable) {
$this->setDbTable('Model_Authentication_DbTable');
}
return $this->_dbTable;
}
public function getRecordById($id) {
$table = $this->getDbTable();
// Other code here
}
}
그리고 을 DBTABLE이 같은 : 그것은 매퍼에 $table = $this->getDbTable();
을 실행하면
class Model_Authentication_DbTable extends Zend_Db_Table_Abstract {
protected $_name = 'Authentication';
}
그것은 나를 불을 지르고 콘솔에서 오류를 다음과 제공 :
An error occurred
Application error
Message: No adapter found for Model_Authentication_DbTable
이 DbTable에 어댑터를 설정하는 방법은 무엇입니까?
누구나 알고있는이 ??
감사
해당 줄을 주석 처리 할 필요가 없습니다. db 정보를 [production] 섹션의 끝으로 이동하십시오. 다음 섹션은 앞의 섹션에서 구성을 상속합니다. 또한 개발하는 동안 서버 구성에 SetEnv APPLICATION_ENV 개발을 추가해야합니다. 그러면 개발 섹션의 phpSettings.display_startup_errors 등이 – user570783
@ user570783에 대한 것이므로 오류를 볼 수 있습니다. 이 게시물에 관심을 가져 주셔서 감사합니다. – Awan