From 1d14e35c28534043a1e3cc18f1f1c8825bfa5d89 Mon Sep 17 00:00:00 2001 From: Luiz Marin <67489841+luizcmarin@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:56:06 -0300 Subject: [PATCH 1/4] Docs folder standardization and other fixes (#332) --- LICENSE.md | 8 ++++---- README.md | 25 ++++++++++++++++++------- docs/{en/testing.md => internals.md} | 12 ++++++------ phpunit.xml.dist | 2 +- 4 files changed, 29 insertions(+), 18 deletions(-) rename docs/{en/testing.md => internals.md} (89%) diff --git a/LICENSE.md b/LICENSE.md index bc5674fe4..6a920d605 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,17 +1,17 @@ -Copyright © 2008 by Yii Software (https://www.yiiframework.com/) +Copyright © 2008 by Yii Software () All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright +* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Yii Software nor the names of its +* Neither the name of Yii Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/README.md b/README.md index 3aaab8773..c0bc92e6f 100644 --- a/README.md +++ b/README.md @@ -39,19 +39,30 @@ It is used in [Yii Framework] but can be used separately. The package could be installed via composer: -```php +```shell composer require yiisoft/db-mysql ``` -## Usage +## Documentation -For config connection to Mysql, MariaDb database check [Connecting MySQL/MariaDb](https://github.com/yiisoft/db/blob/master/docs/en/connection/mysql.md). +English: -[Check the documentation](https://github.com/yiisoft/db/blob/master/docs/en/README.md) to learn about usage. +- [Connection config for MySQL and MariaDb](https://github.com/yiisoft/db/blob/master/docs/en/connection/mysql.md). +- [Check the documentation](https://github.com/yiisoft/db/blob/master/docs/en/README.md) to learn about usage. -## Testing +Português - Brasil: -[Check the documentation](/docs/en/testing.md) to learn about testing. +- Para configurar a conexão com Mysql, MariaDb leia [Connecting MySQL/MariaDb](https://github.com/yiisoft/db/blob/master/docs/pt-BR/connection/mysql.md). +- [Confira a documentação](https://github.com/yiisoft/db/blob/master/docs/pt-BR/README.md) para aprender como usar. + +Testing: + +- [Internals](docs/internals.md) + +## Support + +If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that. +You may also check out other [Yii Community Resources](https://www.yiiframework.com/community). ## Support the project @@ -67,7 +78,7 @@ For config connection to Mysql, MariaDb database check [Connecting MySQL/MariaDb ## License -The Yii DataBase MySQL Extension is free software. It is released under the terms of the BSD License. +The Yii DataBase MySQL, MariaDb Extension is free software. It is released under the terms of the BSD License. Please see [`LICENSE`](./LICENSE.md) for more information. Maintained by [Yii Software](https://www.yiiframework.com/). diff --git a/docs/en/testing.md b/docs/internals.md similarity index 89% rename from docs/en/testing.md rename to docs/internals.md index 810bbf829..35d48c72e 100644 --- a/docs/en/testing.md +++ b/docs/internals.md @@ -1,4 +1,4 @@ -# Testing +# Internals ## Github actions @@ -10,8 +10,8 @@ All our packages have github actions by default, so you can test your [contribut For greater ease it is recommended to use docker containers, for this you can use the [docker-compose.yml](https://docs.docker.com/compose/compose-file/) file that is in the docs folder. -1. [MySQL 8](/docker-compose.yml) -2. [MariaDB 10.11](/docker-compose-mariadb.yml) +1. [MySQL 8](../../../docker-compose.yml) +2. [MariaDB 10.11](../../../docker-compose-mariadb.yml) For running the docker containers you can use the following command: @@ -41,7 +41,7 @@ The following steps are required to run the tests: vendor/bin/phpunit ``` -### Mutation testing +## Mutation testing The package tests are checked with [Infection](https://infection.github.io/) mutation framework with [Infection Static Analysis Plugin](https://github.com/Roave/infection-static-analysis-plugin). To run it: @@ -60,8 +60,8 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static ## Rector -Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or -use either newest or any specific version of PHP: +Use [Rector](https://github.com/rectorphp/rector) to make codebase follow some specific rules or +use either newest or any specific version of PHP: ```shell ./vendor/bin/rector diff --git a/phpunit.xml.dist b/phpunit.xml.dist index e572721ea..4bc8a5cbe 100755 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ - + From b8c40abbe51ab905d56f2619b646d996028cfa66 Mon Sep 17 00:00:00 2001 From: Sergei Tigrov Date: Sat, 27 Apr 2024 19:29:39 +0700 Subject: [PATCH 2/4] Remove Scrutinizer (#333) --- .gitattributes | 1 - .scrutinizer.yml | 58 ------------------------------------------------ 2 files changed, 59 deletions(-) delete mode 100644 .scrutinizer.yml diff --git a/.gitattributes b/.gitattributes index 0e7b20472..e2b21a8d7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -26,7 +26,6 @@ /.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.scrutinizer.yml export-ignore /phpunit.xml.dist export-ignore /docs export-ignore diff --git a/.scrutinizer.yml b/.scrutinizer.yml deleted file mode 100644 index fdf19d9c3..000000000 --- a/.scrutinizer.yml +++ /dev/null @@ -1,58 +0,0 @@ -checks: - php: true - -filter: - paths: - - src/ - -build: - image: default-bionic - - environment: - php: - version: 8.1.18 - ini: - xdebug.mode: coverage - - nodes: - analysis: - tests: - override: - - php-scrutinizer-run - - phpunit: - services: - db-mysql: - image: mysql:8.0.29 - - # Define any additional environment variables that are needed by the service. - env: - MYSQL_ALLOW_EMPTY_PASSWORD: 1 - MYSQL_ROOT_PASSWORD: '' - MYSQL_DATABASE: yiitest - - # We automatically forward these ports from your localhost to the service's port. - # Alternatively, you can also access the service on the "$SERVICE_SOME_NAME_IP" - # environment variable. - ports: - # Forward 127.0.0.1:12345 -> SERVICE_IP:12345 - - 3306 - - # If your service writes data to disk like most databases do, you can significantly - # speed up tests by mounting a ramdisk at those paths. - ramdisks: - - /var/lib/data - - dependencies: - override: - - composer self-update - - composer config preferred-install.yiisoft/db source - - composer update --no-interaction --no-progress --optimize-autoloader --ansi - - tests: - override: - - command: ./vendor/bin/phpunit --coverage-clover ./coverage.xml - on_node: 1 - coverage: - file: coverage.xml - format: php-clover From cd9ed3cc71f0704ca46f15d4910b9e0a6fe039a2 Mon Sep 17 00:00:00 2001 From: Sergei Tigrov Date: Sat, 27 Apr 2024 22:44:13 +0700 Subject: [PATCH 3/4] Update test according to main PR (#331) --- tests/CommandTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CommandTest.php b/tests/CommandTest.php index 9c707717a..fb068b85a 100644 --- a/tests/CommandTest.php +++ b/tests/CommandTest.php @@ -71,7 +71,7 @@ public function testAlterColumn(): void public function testBatchInsert( string $table, array $columns, - array $values, + iterable $values, string $expected, array $expectedParams = [], int $insertedRow = 1 From 0f53f4b0ab907580ed76ffb7efa9a3b4ea290c77 Mon Sep 17 00:00:00 2001 From: Sergei Tigrov Date: Mon, 29 Apr 2024 09:59:59 +0700 Subject: [PATCH 4/4] Change db dependency to `dev-master` [skip ci] (#335) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a42725894..c8bf50ca6 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "ext-json": "*", "ext-pdo": "*", "psr/log": "^2.0|^3.0", - "yiisoft/db": "^1.2", + "yiisoft/db": "dev-master", "yiisoft/json": "^1.0" }, "require-dev": {