SOURCES: ZendFramework-db_charset.patch (NEW) - http://framework.zend.com/i...
glen
glen at pld-linux.org
Fri Jan 9 15:45:48 CET 2009
Author: glen Date: Fri Jan 9 14:45:47 2009 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- http://framework.zend.com/issues/secure/attachment/11545/charset.diff
from http://framework.zend.com/issues/browse/ZF-1541
---- Files affected:
SOURCES:
ZendFramework-db_charset.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/ZendFramework-db_charset.patch
diff -u /dev/null SOURCES/ZendFramework-db_charset.patch:1.1
--- /dev/null Fri Jan 9 15:45:48 2009
+++ SOURCES/ZendFramework-db_charset.patch Fri Jan 9 15:45:42 2009
@@ -0,0 +1,65 @@
+Index: Zend/Db/Adapter/Mysqli.php
+===================================================================
+--- Zend/Db/Adapter/Mysqli.php (revision 11422)
++++ Zend/Db/Adapter/Mysqli.php (working copy)
+@@ -313,6 +313,10 @@
+ require_once 'Zend/Db/Adapter/Mysqli/Exception.php';
+ throw new Zend_Db_Adapter_Mysqli_Exception(mysqli_connect_error());
+ }
++
++ if(array_key_exists('charset', $this->_config)) {
++ $this->_connection->set_charset($this->_config['charset']);
++ }
+ }
+
+ /**
+Index: Zend/Db/Adapter/Pdo/Mysql.php
+===================================================================
+--- Zend/Db/Adapter/Pdo/Mysql.php (revision 11422)
++++ Zend/Db/Adapter/Pdo/Mysql.php (working copy)
+@@ -93,6 +93,20 @@
+ {
+ return $this->fetchCol('SHOW TABLES');
+ }
++
++ /**
++ * @return void
++ */
++ protected function _connect()
++ {
++ if ($this->_connection) {
++ return;
++ }
++ parent::_connect();
++ if (array_key_exists('charset', $this->_config)) {
++ $this->_connection->exec('SET NAMES ' . $this->_quote($this->_config['charset']));
++ }
++ }
+
+ /**
+ * Returns the column descriptions for a table.
+Index: Zend/Db/Adapter/Pdo/Pgsql.php
+===================================================================
+--- Zend/Db/Adapter/Pdo/Pgsql.php (revision 11422)
++++ Zend/Db/Adapter/Pdo/Pgsql.php (working copy)
+@@ -71,6 +71,20 @@
+ 'NUMERIC' => Zend_Db::FLOAT_TYPE,
+ 'REAL' => Zend_Db::FLOAT_TYPE
+ );
++
++ /**
++ * @return void
++ */
++ protected function _connect()
++ {
++ if ($this->_connection) {
++ return;
++ }
++ parent::_connect();
++ if (array_key_exists('charset', $this->_config)) {
++ $this->_connection->exec('SET NAMES ' . $this->_quote($this->_config['charset']));
++ }
++ }
+
+ /**
+ * Returns a list of the tables in the database.
================================================================
More information about the pld-cvs-commit
mailing list