Browse Source

adjusted cubrid version in schema quote

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
28d9ee7c31
  1. 3
      framework/yii/db/cubrid/Schema.php
  2. 15
      tests/unit/data/travis/cubrid-setup.sh

3
framework/yii/db/cubrid/Schema.php

@ -101,7 +101,8 @@ class Schema extends \yii\db\Schema
$this->db->open();
// workaround for broken PDO::quote() implementation in CUBRID 9.1.0 http://jira.cubrid.org/browse/APIS-658
if (version_compare($this->db->pdo->getAttribute(\PDO::ATTR_CLIENT_VERSION), '9.1.0', '<=')) {
$version = $this->db->pdo->getAttribute(\PDO::ATTR_CLIENT_VERSION);
if (version_compare($version, '8.4.4.0002', '<') || $version[0] == '9' && version_compare($version, '9.2.0.0002', '<=')) {
return "'" . addcslashes(str_replace("'", "''", $str), "\000\n\r\\\032") . "'";
} else {
return $this->db->pdo->quote($str);

15
tests/unit/data/travis/cubrid-setup.sh

@ -10,7 +10,16 @@ sudo apt-get install cubrid
sudo apt-get install cubrid-demodb
# cubrid pdo
sudo apt-get install php5-cubrid
echo '/opt/cubrid/' | pecl install pdo_cubrid
install_pdo_cubrid() {
wget "http://pecl.php.net/get/PDO_CUBRID-9.2.0.0001.tgz" &&
tar -zxf "PDO_CUBRID-9.2.0.0001.tgz" &&
sh -c "cd PDO_CUBRID-9.2.0.0001 && phpize && ./configure && make && sudo make install"
echo "extension=pdo_cubrid.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
/etc/profile.d/cubrid.sh
return $?
}
install_pdo_cubrid > ~/pdo_cubrid.log || ( echo "=== PDO CUBRID BUILD FAILED ==="; cat ~/pdo_cubrid.log )
echo "Installed CUBRID `dpkg -s cubrid |grep Version`"

Loading…
Cancel
Save