Permalink
Browse files

Minor fixes

  • Loading branch information...
1 parent bc1ea20 commit 1a8ea500f5e8c5ed8c33582791be942aa4d96335 @cristianoc72 committed Oct 7, 2012
View
15 src/Propel/Runtime/Adapter/Pdo/MysqlAdapter.php
@@ -197,18 +197,9 @@ public function bindValue(StatementInterface $stmt, $parameter, $value, ColumnMa
protected function prepareParams($params)
{
if (isset($params['settings']['charset'])) {
- if (version_compare(PHP_VERSION, '5.3.6', '<')) {
- throw new PropelException(<<<EXCEPTION
-Connection option "charset" cannot be used for MySQL connections in PHP versions older than 5.3.6.
-Please refer to http://www.propelorm.org/ticket/1360 for instructions and details about the implications of
-using a SET NAMES statement in the "queries" setting.
-EXCEPTION
- );
- } else {
- if (false === strpos($params['dsn'], ';charset=')) {
- $params['dsn'] .= ';charset=' . $params['settings']['charset'];
- unset($params['settings']['charset']);
- }
+ if (false === strpos($params['dsn'], ';charset=')) {
+ $params['dsn'] .= ';charset=' . $params['settings']['charset'];
+ unset($params['settings']['charset']);
}
}
View
17 tests/Propel/Tests/Helpers/Bookstore/BookstoreTestBase.php
@@ -41,15 +41,6 @@ public static function setUpBeforeClass()
*/
protected function setUp()
{
- if (version_compare(PHP_VERSION, '5.3.6', '<')) {
- $adapterClass = Propel::getServiceContainer()->getAdapterClass(BookPeer::DATABASE_NAME);
- $propelConfig = Propel::getServiceContainer()->getConnectionManager(BookPeer::DATABASE_NAME)->getConfiguration();
- if (('mysql' == $adapterClass) && (isset($propelConfig['settings']['charset']))) {
- die('Connection option "charset" cannot be used for MySQL connections in PHP versions older than 5.3.6.
-Please refer to http://www.propelorm.org/ticket/1360 for instructions and details
-about the implications of using a SET NAMES statement in the "queries" setting.');
- }
- }
$this->con = Propel::getServiceContainer()->getConnection(BookPeer::DATABASE_NAME);
$this->con->beginTransaction();
}
@@ -64,10 +55,12 @@ protected function tearDown()
// and we don't want to call ConnectionInterface::commit() in that case
// since it will trigger an exception on its own
// ('Cannot commit because a nested transaction was rolled back')
- if ($this->con->isCommitable()) {
- $this->con->commit();
+ if (null !== $this->con) {
+ if ($this->con->isCommitable()) {
+ $this->con->commit();
+ }
+ $this->con = null;
}
- $this->con = null;
}
protected function getDriver()
View
8 tests/Propel/Tests/Runtime/Adapter/Pdo/MysqlAdapterTest.php
@@ -37,14 +37,6 @@ public static function getConParams()
);
}
- protected function setUp()
- {
- parent::setUp();
- if (version_compare(PHP_VERSION, '5.3.6', '<')) {
- $this->setExpectedException('Propel\Runtime\Exception\PropelException');
- }
- }
-
/**
* @dataProvider getConParams
*/

0 comments on commit 1a8ea50

Please sign in to comment.