ZF-6881: Cannot redeclare Zend_Db_Adapter_Pdo_Mysql::_connect() in library/Zend/Db/Adapter/Pdo/Mysql.php on line 120
Description
Cannot redeclare Zend_Db_Adapter_Pdo_Mysql::_connect() in library/Zend/Db/Adapter/Pdo/Mysql.php on line 120
this happens because _connect() really is defined twice:
79 /**
80 * Creates a PDO object and connects to the database.
81 *
82 * @return void
83 * @throws Zend_Db_Adapter_Exception
84 */
85 protected function _connect()
86 {
87 if ($this->_connection) {
88 return;
89 }
90
91 if (!empty($this->_config['charset'])) {
92 $initCommand = "SET NAMES '" . $this->_config['charset'] . "'";
93 $this->_config['driver_options'][PDO::MYSQL_ATTR_INIT_COMMAND] = $initCommand;
94 }
95
96 parent::_connect();
97 }
98
/.../
117 /**
118 * @return void
119 */
120 protected function _connect()
121 {
122 if ($this->_connection) {
123 return;
124 }
125 parent::_connect();
126 if (array_key_exists('charset', $this->_config)) {
127 $this->_connection->exec('SET NAMES ' . $this->_quote($this->_config['charset']));
128 }
129 }
130
this error could be easily identified by syntax lint: $ php -l library/Zend/Db/Adapter/Pdo/Mysql.php PHP Fatal error: Cannot redeclare Zend_Db_Adapter_Pdo_Mysql::_connect() in library/Zend/Db/Adapter/Pdo/Mysql.php on line 120 Errors parsing library/Zend/Db/Adapter/Pdo/Mysql.php
so perhaps integrate the syntax lint also in your ZF build/release system.
ps: Zend_Db_Adapter_Mysql seems not listed in issue tracker components
Comments
Posted by Elan Ruusamäe (glen) on 2009-06-02T03:04:20.000+0000
i'm sorry, i had incompatible patch applied from ZF-1541 so this issue is bogus
Posted by Elan Ruusamäe (glen) on 2009-06-02T03:09:20.000+0000
please kill this issue, it's bogus
Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-06-02T06:13:18.000+0000
Close this for Elan.