From 625ba59e00bee7348bbab2c417a83193ba0a8326 Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Fri, 16 Mar 2012 12:21:33 +0100 Subject: [PATCH 1/2] Fix parsing of charset by PDO at runtime Since the removal of Phing, the runtime configuration settings are not passed the same way as before. The generated PHP configuration shows something like: $conf = array( ... 'settings' => array('charset' => 'utf8') ); while it used to be: $conf = array( ... 'settings' => array('charset' => array('value' => 'utf8')) ); Dunno exactly when that changed, but updating to master broke the tests, and the only way to fix them is the attached changes. --- src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php | 4 ++-- src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php b/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php index bf7c86690b..59a78ae25d 100644 --- a/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php +++ b/src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php @@ -196,7 +196,7 @@ public function bindValue(StatementInterface $stmt, $parameter, $value, ColumnMa */ protected function prepareParams($params) { - if (isset($params['settings']['charset']['value'])) { + if (isset($params['settings']['charset'])) { if (version_compare(PHP_VERSION, '5.3.6', '<')) { throw new PropelException(<<setCharset($con, $settings['charset']['value']); + if (isset($settings['charset'])) { + $this->setCharset($con, $settings['charset']); } if (isset($settings['queries']) && is_array($settings['queries'])) { From 5995aa47894a620aa9712b0fea309ab51a97606d Mon Sep 17 00:00:00 2001 From: Francois Zaninotto Date: Fri, 16 Mar 2012 12:33:19 +0100 Subject: [PATCH 2/2] Update DSN charset parsing test for MySQL to accomodate change from 625ba59e00bee7348bbab2c417a83193ba0a8326 --- tests/Propel/Tests/Runtime/Adapter/Pdo/MysqlAdapterTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/Propel/Tests/Runtime/Adapter/Pdo/MysqlAdapterTest.php b/tests/Propel/Tests/Runtime/Adapter/Pdo/MysqlAdapterTest.php index 1d626f152e..eaadd2f992 100644 --- a/tests/Propel/Tests/Runtime/Adapter/Pdo/MysqlAdapterTest.php +++ b/tests/Propel/Tests/Runtime/Adapter/Pdo/MysqlAdapterTest.php @@ -30,9 +30,7 @@ static public function getConParams() array( 'dsn' => 'dsn=my_dsn', 'settings' => array( - 'charset' => array( - 'value' => 'foobar' - ) + 'charset' => 'foobar' ) ) )