Skip to content

Commit

Permalink
Fix #19902: Remove support for CUBRID
Browse files Browse the repository at this point in the history
  • Loading branch information
mtangoo authored Jul 18, 2023
1 parent c9c100a commit 96f61b7
Show file tree
Hide file tree
Showing 56 changed files with 178 additions and 2,001 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Thumbs.db

# composer vendor dir
/vendor
# cubrid install dir
/cubrid

# composer itself is not needed
composer.phar
Expand Down
19 changes: 2 additions & 17 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ db:
- tests/full
script:
- docker-compose up --build -d
- docker-compose run --rm php vendor/bin/phpunit -v --group db --exclude caching,mysql,pgsql,mssql,cubrid,oci
- docker-compose run --rm php vendor/bin/phpunit -v --group db --exclude caching,mysql,pgsql,mssql,oci


mysql:
Expand Down Expand Up @@ -69,21 +69,6 @@ pgsql:
- docker-compose run --rm php bash -c 'while [ true ]; do curl postgres:5432; if [ $? == 52 ]; then break; fi; ((c++)) && ((c==25)) && break; sleep 2; done'
- docker-compose run --rm php vendor/bin/phpunit -v --group pgsql


cubrid:
stage: test
only:
- tests/cubrid
- tests/extra
script:
- cd cubrid
- docker-compose up --build -d
# wait for db (retry X times)
- docker-compose run --rm php bash -c 'while [ true ]; do curl cubrid:1523; if [ $? == 56 ]; then break; fi; ((c++)) && ((c==20)) && break; sleep 3; done'
- sleep 5
- docker-compose run --rm php /project/vendor/bin/phpunit -v --group cubrid


mssql:
stage: test
only:
Expand All @@ -109,5 +94,5 @@ travis:
- docker-compose up --build -d
# wait for dbs ...
- sleep 10
- docker-compose run --rm php vendor/bin/phpunit -v --exclude mssql,cubrid,oci,wincache,xcache,zenddata,cubrid
- docker-compose run --rm php vendor/bin/phpunit -v --exclude mssql,oci,wincache,xcache,zenddata

2 changes: 0 additions & 2 deletions docs/guide-es/db-dao.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Yii DAO soporta las siguientes bases de datos:
- [MariaDB](https://mariadb.com/)
- [SQLite](https://sqlite.org/)
- [PostgreSQL](https://www.postgresql.org/): versión 8.4 o superior.
- [CUBRID](https://www.cubrid.org/): versión 9.3 o superior.
- [Oracle](https://www.oracle.com/database/)
- [MSSQL](https://www.microsoft.com/en-us/sqlserver/default.aspx): versión 2008 o superior.

Expand Down Expand Up @@ -65,7 +64,6 @@ propiedad [[yii\db\Connection::dsn|dsn]]. El formato del DSN varia para cada dif
* MySQL, MariaDB: `mysql:host=localhost;dbname=mydatabase`
* SQLite: `sqlite:/path/to/database/file`
* PostgreSQL: `pgsql:host=localhost;port=5432;dbname=mydatabase`
* CUBRID: `cubrid:dbname=demodb;host=localhost;port=33000`
* MS SQL Server (mediante sqlsrv driver): `sqlsrv:Server=localhost;Database=mydatabase`
* MS SQL Server (mediante dblib driver): `dblib:host=localhost;dbname=mydatabase`
* MS SQL Server (mediante mssql driver): `mssql:host=localhost;dbname=mydatabase`
Expand Down
2 changes: 0 additions & 2 deletions docs/guide-fr/db-active-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Yii assure la prise en charge de l'enregistrement actif (*Active Record*) pour l
* SQLite 2 et 3 : via [[yii\db\ActiveRecord]]
* Microsoft SQL Server 2008 ou versions postérieures : via [[yii\db\ActiveRecord]]
* Oracle : via [[yii\db\ActiveRecord]]
* CUBRID 9.3 ou versions postérieures : via [[yii\db\ActiveRecord]]
(Notez que, à cause d'un [bogue](https://jira.cubrid.org/browse/APIS-658) dans l'extension CUBRID 9.3, l'entourage des valeurs par des marques de citation ne fonctionne pas, c'est pourquoi vous avez besoin de CUBRID 9.3 à la fois comme client et comme serveur)
* Sphinx : via [[yii\sphinx\ActiveRecord]], requiert l'extension `yii2-sphinx`
* ElasticSearch : via [[yii\elasticsearch\ActiveRecord]], requiert l'extension `yii2-elasticsearch`

Expand Down
4 changes: 1 addition & 3 deletions docs/guide-fr/db-dao.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ Dans Yii 2.0, les objets d'accès aux bases de données prennent en charge les b
- [MariaDB](https://mariadb.com/)
- [SQLite](https://sqlite.org/)
- [PostgreSQL](https://www.postgresql.org/): version 8.4 ou plus récente.
- [CUBRID](https://www.cubrid.org/): version 9.3 ou plus récente.
- [Oracle](https://www.oracle.com/database/)
- [MSSQL](https://www.microsoft.com/en-us/sqlserver/default.aspx): version 2008 ou plus récente.

> Info: depuis Yii 2.1, la prise en charge des objets d'accès aux bases de données pour CUBRID, Oracle et MSSQL n'est plus fournie en tant que composants du noyau. Cette prise en charge nécessite l'installation d'[extensions](structure-extensions.md) séparées.
> Info: depuis Yii 2.1, la prise en charge des objets d'accès aux bases de données pour Oracle et MSSQL n'est plus fournie en tant que composants du noyau. Cette prise en charge nécessite l'installation d'[extensions](structure-extensions.md) séparées.
Parmi les [extensions officielles](https://www.yiiframework.com/extensions/official), on trouve [yiisoft/yii2-oracle](https://www.yiiframework.com/extension/yiisoft/yii2-oracle) et
[yiisoft/yii2-mssql](https://www.yiiframework.com/extension/yiisoft/yii2-mssql).

Expand Down Expand Up @@ -64,7 +63,6 @@ Lorsque vous configurez une connexion à une base de données, vous devez toujou
* MySQL, MariaDB: `mysql:host=localhost;dbname=mydatabase`
* SQLite: `sqlite:/path/to/database/file`
* PostgreSQL: `pgsql:host=localhost;port=5432;dbname=mydatabase`
* CUBRID: `cubrid:dbname=demodb;host=localhost;port=33000`
* MS SQL Server (via sqlsrv driver): `sqlsrv:Server=localhost;Database=mydatabase`
* MS SQL Server (via dblib driver): `dblib:host=localhost;dbname=mydatabase`
* MS SQL Server (via mssql driver): `mssql:host=localhost;dbname=mydatabase`
Expand Down
2 changes: 0 additions & 2 deletions docs/guide-ja/db-active-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Yii は次のリレーショナル・データベースに対して、アクテ
* SQLite 2 および 3: [[yii\db\ActiveRecord]] による。
* Microsoft SQL Server 2008 以降: [[yii\db\ActiveRecord]] による。
* Oracle: [[yii\db\ActiveRecord]] による。
* CUBRID 9.3 以降: [[yii\db\ActiveRecord]] による。(cubrid PDO 拡張の [バグ](http://jira.cubrid.org/browse/APIS-658)
のために、値を引用符で囲む機能が動作しません。そのため、サーバだけでなくクライアントも CUBRID 9.3 が必要になります)
* Sphinx: [[yii\sphinx\ActiveRecord]] による。`yii2-sphinx` エクステンションが必要。
* ElasticSearch: [[yii\elasticsearch\ActiveRecord]] による。`yii2-elasticsearch` エクステンションが必要。

Expand Down
2 changes: 0 additions & 2 deletions docs/guide-ja/db-dao.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Yii 2.0 では、DAO は下記の DBMS のサポートを内蔵しています
- [MariaDB](https://mariadb.com/)
- [SQLite](https://sqlite.org/)
- [PostgreSQL](https://www.postgresql.org/): バージョン 8.4 以上。
- [CUBRID](https://www.cubrid.org/): バージョン 9.3 以上。
- [Oracle](https://www.oracle.com/database/)
- [MSSQL](https://www.microsoft.com/en-us/sqlserver/default.aspx): バージョン 2008 以上。

Expand Down Expand Up @@ -67,7 +66,6 @@ DSN の形式はデータベースによってさまざまに異なります。
* MySQL, MariaDB: `mysql:host=localhost;dbname=mydatabase`
* SQLite: `sqlite:/path/to/database/file`
* PostgreSQL: `pgsql:host=localhost;port=5432;dbname=mydatabase`
* CUBRID: `cubrid:dbname=demodb;host=localhost;port=33000`
* MS SQL Server (sqlsrv ドライバ経由): `sqlsrv:Server=localhost;Database=mydatabase`
* MS SQL Server (dblib ドライバ経由): `dblib:host=localhost;dbname=mydatabase`
* MS SQL Server (mssql ドライバ経由): `mssql:host=localhost;dbname=mydatabase`
Expand Down
3 changes: 0 additions & 3 deletions docs/guide-pl/db-active-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ Yii zapewnia wsparcie Active Record dla następujących typów relacyjnych baz d
* SQLite 2 i 3: poprzez [[yii\db\ActiveRecord]]
* Microsoft SQL Server 2008 lub nowszy: poprzez [[yii\db\ActiveRecord]]
* Oracle: poprzez [[yii\db\ActiveRecord]]
* CUBRID 9.3 lub nowszy: poprzez [[yii\db\ActiveRecord]] (zwróć uwagę, że z powodu [błędu](https://jira.cubrid.org/browse/APIS-658)
w rozszerzeniu PDO cubrid, umieszczanie wartości w cudzysłowie nie będzie działać, zatem wymagane jest zainstalowanie CUBRID 9.3 zarówno
jako klienta jak i serwer)
* Sphinx: poprzez [[yii\sphinx\ActiveRecord]], wymaga rozszerzenia `yii2-sphinx`
* ElasticSearch: poprzez [[yii\elasticsearch\ActiveRecord]], wymaga rozszerzenia `yii2-elasticsearch`

Expand Down
1 change: 0 additions & 1 deletion docs/guide-pt-BR/db-active-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ O Yii fornece suporte Active Record para os seguintes bancos de dados relacionai
* SQLite 2 e 3: via [[yii\db\ActiveRecord]]
* Microsoft SQL Server 2008 ou superior: via [[yii\db\ActiveRecord]]
* Oracle: via [[yii\db\ActiveRecord]]
* CUBRID 9.3 ou superior: via [[yii\db\ActiveRecord]] (observe que devido a um [bug](http://jira.cubrid.org/browse/APIS-658) na extensão PDO do cubrid, o tratamento de aspas não funciona, então você precisa do CUBRID 9.3 como o cliente, bem como servidor)
* Sphinx: via [[yii\sphinx\ActiveRecord]], requer a extensão `yii2-sphinx`
* ElasticSearch: via [[yii\elasticsearch\ActiveRecord]], requer a extensão `yii2-elasticsearch`. Adicionalmente, o Yii também suporta o uso de Active Record com os seguintes bancos de dados NoSQL:

Expand Down
3 changes: 0 additions & 3 deletions docs/guide-ru/db-active-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ Yii поддерживает работу с Active Record для следующ
* SQLite 2 и 3: посредством [[yii\db\ActiveRecord]]
* Microsoft SQL Server 2008 и выше: посредством [[yii\db\ActiveRecord]]
* Oracle: посредством [[yii\db\ActiveRecord]]
* CUBRID 9.3 и выше: посредством [[yii\db\ActiveRecord]] (Имейте в виду, что вследствие
[бага](http://jira.cubrid.org/browse/APIS-658) в PDO-расширении для CUBRID, заключение значений в кавычки не работает,
поэтому необходимо использовать CUBRID версии 9.3 как на клиентской стороне, так и на сервере)
* Sphinx: посредством [[yii\sphinx\ActiveRecord]], потребуется расширение `yii2-sphinx`
* ElasticSearch: посредством [[yii\elasticsearch\ActiveRecord]], потребуется расширение `yii2-elasticsearch`

Expand Down
2 changes: 0 additions & 2 deletions docs/guide-ru/db-dao.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Yii DAO из коробки поддерживает следующие базы
- [MariaDB](https://mariadb.com/)
- [SQLite](https://sqlite.org/)
- [PostgreSQL](https://www.postgresql.org/): версии 8.4 или выше.
- [CUBRID](https://www.cubrid.org/): версии 9.3 или выше.
- [Oracle](https://www.oracle.com/database/)
- [MSSQL](https://www.microsoft.com/en-us/sqlserver/default.aspx): версии 2008 или выше.

Expand Down Expand Up @@ -68,7 +67,6 @@ return [
* MySQL, MariaDB: `mysql:host=localhost;dbname=mydatabase`
* SQLite: `sqlite:/path/to/database/file`
* PostgreSQL: `pgsql:host=localhost;port=5432;dbname=mydatabase`
* CUBRID: `cubrid:dbname=demodb;host=localhost;port=33000`
* MS SQL Server (via sqlsrv driver): `sqlsrv:Server=localhost;Database=mydatabase`
* MS SQL Server (via dblib driver): `dblib:host=localhost;dbname=mydatabase`
* MS SQL Server (via mssql driver): `mssql:host=localhost;dbname=mydatabase`
Expand Down
2 changes: 0 additions & 2 deletions docs/guide-zh-CN/db-active-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Yii 为以下关系数据库提供 Active Record 支持:
* SQLite 2 and 3:通过 [[yii\db\ActiveRecord]] 支持
* Microsoft SQL Server 2008 及以上:通过 [[yii\db\ActiveRecord]] 支持
* Oracle:通过 [[yii\db\ActiveRecord]] 支持
* CUBRID 9.3 及以上:通过 [[yii\db\ActiveRecord]] 支持 (提示, 由于 CUBRID PDO 扩展的 [bug](http://jira.cubrid.org/browse/APIS-658)
给变量加引用将不起作用,所以你得使用 CUBRID 9.3 客户端及服务端。
* Sphinx:通过 [[yii\sphinx\ActiveRecord]] 支持,依赖 `yii2-sphinx` 扩展
* ElasticSearch:通过 [[yii\elasticsearch\ActiveRecord]] 支持, 依赖 `yii2-elasticsearch` 扩展

Expand Down
4 changes: 1 addition & 3 deletions docs/guide-zh-CN/db-dao.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ Yii DAO 支持下列现成的数据库:
- [MariaDB](https://mariadb.com/)
- [SQLite](https://sqlite.org/)
- [PostgreSQL](https://www.postgresql.org/):版本 8.4 或更高
- [CUBRID](https://www.cubrid.org/):版本 9.3 或更高。
- [Oracle](https://www.oracle.com/database/)
- [MSSQL](https://www.microsoft.com/en-us/sqlserver/default.aspx):版本 2008 或更高。

> Info: 在Yii 2.1及更高版本中,DAO 支持 CUBRID,Oracle 和 MSSQL
> Info: 在Yii 2.1及更高版本中,DAO 支持 Oracle 和 MSSQL
不再作为框架的内置核心组件提供。它们必须作为独离的 [扩展](structure-extensions.md) 安装。
[yiisoft/yii2-oracle](https://www.yiiframework.com/extension/yiisoft/yii2-oracle)
[yiisoft/yii2-mssql](https://www.yiiframework.com/extension/yiisoft/yii2-mssql) 都属于
Expand Down Expand Up @@ -73,7 +72,6 @@ return [
* MySQL, MariaDB: `mysql:host=localhost;dbname=mydatabase`
* SQLite: `sqlite:/path/to/database/file`
* PostgreSQL: `pgsql:host=localhost;port=5432;dbname=mydatabase`
* CUBRID: `cubrid:dbname=demodb;host=localhost;port=33000`
* MS SQL Server (via sqlsrv driver): `sqlsrv:Server=localhost;Database=mydatabase`
* MS SQL Server (via dblib driver): `dblib:host=localhost;dbname=mydatabase`
* MS SQL Server (via mssql driver): `mssql:host=localhost;dbname=mydatabase`
Expand Down
2 changes: 0 additions & 2 deletions docs/guide/db-active-record.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ Yii provides the Active Record support for the following relational databases:
* SQLite 2 and 3: via [[yii\db\ActiveRecord]]
* Microsoft SQL Server 2008 or later: via [[yii\db\ActiveRecord]]
* Oracle: via [[yii\db\ActiveRecord]]
* CUBRID 9.3 or later: via [[yii\db\ActiveRecord]] (Note that due to a [bug](http://jira.cubrid.org/browse/APIS-658) in
the cubrid PDO extension, quoting of values will not work, so you need CUBRID 9.3 as the client as well as the server)
* Sphinx: via [[yii\sphinx\ActiveRecord]], requires the `yii2-sphinx` extension
* ElasticSearch: via [[yii\elasticsearch\ActiveRecord]], requires the `yii2-elasticsearch` extension

Expand Down
2 changes: 0 additions & 2 deletions docs/guide/db-dao.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ In Yii 2.0, DAO supports the following databases out of the box:
- [MariaDB](https://mariadb.com/)
- [SQLite](https://sqlite.org/)
- [PostgreSQL](https://www.postgresql.org/): version 8.4 or higher
- [CUBRID](https://www.cubrid.org/): version 9.3 or higher.
- [Oracle](https://www.oracle.com/database/)
- [MSSQL](https://www.microsoft.com/en-us/sqlserver/default.aspx): version 2008 or higher.

Expand Down Expand Up @@ -67,7 +66,6 @@ for more details. Below are some examples:
* MySQL, MariaDB: `mysql:host=localhost;dbname=mydatabase`
* SQLite: `sqlite:/path/to/database/file`
* PostgreSQL: `pgsql:host=localhost;port=5432;dbname=mydatabase`
* CUBRID: `cubrid:dbname=demodb;host=localhost;port=33000`
* MS SQL Server (via sqlsrv driver): `sqlsrv:Server=localhost;Database=mydatabase`
* MS SQL Server (via dblib driver): `dblib:host=localhost;dbname=mydatabase`
* MS SQL Server (via mssql driver): `mssql:host=localhost;dbname=mydatabase`
Expand Down
8 changes: 8 additions & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
Yii Framework 2 Change Log
==========================

2.2 under development
------------------------

- Chg #19902: Remove support for CUBRID (mtangoo)


2.0.49 under development
------------------------

- Bug #19857: Fix AttributeTypecastBehavior::resetOldAttributes() causes "class has no attribute named" InvalidArgumentException (uaoleg)
- Bug #18859: Fix `yii\web\Controller::bindInjectedParams()` to not throw error when argument of `ReflectionUnionType` type is passed (bizley)
- Enh #19841: Allow jQuery 3.7 to be installed (wouter90)
- Enh #19853: Added support for default value for `\yii\helpers\Console::select()` (rhertogh)
- Bug #19868: Added whitespace sanitation for tests, due to updates in ICU 72 (schmunk42)
- Enh #19884: Added support Enums in Query Builder (sk1t0n)


2.0.48.1 May 24, 2023
Expand Down
9 changes: 7 additions & 2 deletions framework/behaviors/AttributeTypecastBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,10 @@ public function afterFind($event)
$this->resetOldAttributes();
}

private function resetOldAttributes()
/**
* Resets the old values of the named attributes.
*/
protected function resetOldAttributes()
{
if ($this->attributeTypes === null) {
return;
Expand All @@ -375,7 +378,9 @@ private function resetOldAttributes()
$attributes = array_keys($this->attributeTypes);

foreach ($attributes as $attribute) {
$this->owner->setOldAttribute($attribute, $this->owner->{$attribute});
if ($this->owner->canSetOldAttribute($attribute)) {
$this->owner->setOldAttribute($attribute, $this->owner->{$attribute});
}
}
}
}
5 changes: 1 addition & 4 deletions framework/classes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Yii core class map.
*
Expand Down Expand Up @@ -168,10 +169,6 @@
'yii\db\conditions\OrCondition' => YII2_PATH . '/db/conditions/OrCondition.php',
'yii\db\conditions\SimpleCondition' => YII2_PATH . '/db/conditions/SimpleCondition.php',
'yii\db\conditions\SimpleConditionBuilder' => YII2_PATH . '/db/conditions/SimpleConditionBuilder.php',
'yii\db\cubrid\ColumnSchemaBuilder' => YII2_PATH . '/db/cubrid/ColumnSchemaBuilder.php',
'yii\db\cubrid\QueryBuilder' => YII2_PATH . '/db/cubrid/QueryBuilder.php',
'yii\db\cubrid\Schema' => YII2_PATH . '/db/cubrid/Schema.php',
'yii\db\cubrid\conditions\LikeConditionBuilder' => YII2_PATH . '/db/cubrid/conditions/LikeConditionBuilder.php',
'yii\db\mssql\ColumnSchema' => YII2_PATH . '/db/mssql/ColumnSchema.php',
'yii\db\mssql\ColumnSchemaBuilder' => YII2_PATH . '/db/mssql/ColumnSchemaBuilder.php',
'yii\db\mssql\DBLibPDO' => YII2_PATH . '/db/mssql/DBLibPDO.php',
Expand Down
13 changes: 12 additions & 1 deletion framework/db/BaseActiveRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,24 @@ public function getOldAttribute($name)
*/
public function setOldAttribute($name, $value)
{
if (isset($this->_oldAttributes[$name]) || $this->hasAttribute($name)) {
if ($this->canSetOldAttribute($name)) {
$this->_oldAttributes[$name] = $value;
} else {
throw new InvalidArgumentException(get_class($this) . ' has no attribute named "' . $name . '".');
}
}

/**
* Returns if the old named attribute can be set.
* @param string $name the attribute name
* @return bool whether the old attribute can be set
* @see setOldAttribute()
*/
public function canSetOldAttribute($name)
{
return (isset($this->_oldAttributes[$name]) || $this->hasAttribute($name));
}

/**
* Marks an attribute dirty.
* This method may be called to force updating a record when calling [[update()]],
Expand Down
5 changes: 3 additions & 2 deletions framework/db/ColumnSchemaBuilder.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @link https://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
Expand Down Expand Up @@ -226,7 +227,7 @@ public function unsigned()

/**
* Adds an `AFTER` constraint to the column.
* Note: MySQL, Oracle and Cubrid support only.
* Note: MySQL and Oracle support only.
* @param string $after the column after which $this column will be added.
* @return $this
* @since 2.0.8
Expand All @@ -239,7 +240,7 @@ public function after($after)

/**
* Adds an `FIRST` constraint to the column.
* Note: MySQL, Oracle and Cubrid support only.
* Note: MySQL and Oracle support only.
* @return $this
* @since 2.0.8
*/
Expand Down
Loading

0 comments on commit 96f61b7

Please sign in to comment.