Skip to content

Commit

Permalink
Merge branch 'friends-of-reactphp:0.7.x' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
skydiablo authored Jul 8, 2024
2 parents 08ab979 + b01e1ce commit 322479a
Show file tree
Hide file tree
Showing 42 changed files with 4,152 additions and 2,221 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ on:
jobs:
PHPUnit:
name: PHPUnit (PHP ${{ matrix.php }})
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
php:
- 8.3
- 8.2
- 8.1
- 8.0
- 7.4
- 7.3
Expand All @@ -21,29 +24,31 @@ jobs:
- 5.5
- 5.4
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
ini-file: development
- run: composer install
- run: docker run -d --name mysql --net=host -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_DATABASE=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test mysql:5
- run: bash tests/wait-for-mysql.sh
- run: MYSQL_USER=test MYSQL_PASSWORD=test vendor/bin/phpunit --coverage-text
- run: vendor/bin/phpunit --coverage-text
if: ${{ matrix.php >= 7.3 }}
- run: MYSQL_USER=test MYSQL_PASSWORD=test vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
- run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
if: ${{ matrix.php < 7.3 }}

PHPUnit-hhvm:
name: PHPUnit (HHVM)
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
continue-on-error: true
steps:
- uses: actions/checkout@v2
- uses: azjezz/setup-hhvm@v1
- uses: actions/checkout@v4
- run: cp "$(which composer)" composer.phar && ./composer.phar self-update --2.2 # downgrade Composer for HHVM
- name: Run hhvm composer.phar install
uses: docker://hhvm/hhvm:3.30-lts-latest
with:
version: lts-3.30
- run: hhvm $(which composer) require phpunit/phpunit:^5 --dev --no-interaction
args: hhvm composer.phar install
- run: docker run -d --name mysql --net=host -e MYSQL_RANDOM_ROOT_PASSWORD=yes -e MYSQL_DATABASE=test -e MYSQL_USER=test -e MYSQL_PASSWORD=test mysql:5
- run: bash tests/wait-for-mysql.sh
- run: MYSQL_USER=test MYSQL_PASSWORD=test hhvm vendor/bin/phpunit
- run: docker run -i --rm --workdir=/data -v "$(pwd):/data" --net=host hhvm/hhvm:3.30-lts-latest hhvm vendor/bin/phpunit
96 changes: 93 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,95 @@
# Changelog

## 0.6.0 (2023-11-10)

* Feature: Improve Promise v3 support and use template types.
(#183 and #178 by @clue)

* Feature: Full PHP 8.3 compatibility.
(#180 by @clue)

* Feature / BC break: Update default charset encoding to `utf8mb4` for full UTF-8 support.
(#165 by @clue)

This feature updates the MySQL client to use `utf8mb4` as the default charset
encoding for full UTF-8 support instead of the legacy `utf8mb3` charset encoding.
For legacy reasons you can still change this to use a different ASCII-compatible
charset encoding like this:

```php
$factory->createConnection('localhost?charset=utf8mb4');
```

* Feature: Reduce default idle time to 1ms.
(#182 by @clue)

The idle time defines the time the client is willing to keep the underlying
connection alive before automatically closing it. The default idle time was
previously 60s and can be configured for more specific requirements like this:

```php
$factory->createConnection('localhost?idle=10.0');
```

* Minor documentation improvements.
(#184 by @yadaiio)

* Improve test suite, update to use reactphp/async and report failed assertions.
(#164 and #170 by @clue, #163 by @dinooo13 and #181 by @SimonFrings)

## 0.5.7 (2022-09-15)

* Feature: Full support for PHP 8.2.
(#161 by @clue)

* Feature: Mark passwords and URIs as `#[\SensitiveParameter]` (PHP 8.2+).
(#162 by @clue)

* Feature: Forward compatibility with upcoming Promise v3.
(#157 by @clue)

* Feature / Fix: Improve protocol parser, emit parser errors and close invalid connections.
(#158 and #159 by @clue)

* Improve test suite, fix legacy HHVM build by downgrading Composer.
(#160 by @clue)

## 0.5.6 (2021-12-14)

* Feature: Support optional `charset` parameter for full UTF-8 support (`utf8mb4`).
(#135 by @clue)

```php
$db = $factory->createLazyConnection('localhost?charset=utf8mb4');
```

* Feature: Improve error reporting, include MySQL URI and socket error codes in all connection errors.
(#141 by @clue and #138 by @SimonFrings)

For most common use cases this means that simply reporting the `Exception`
message should give the most relevant details for any connection issues:

```php
$db->query($sql)->then(function (React\MySQL\QueryResult $result) {
// …
}, function (Exception $e) {
echo 'Error:' . $e->getMessage() . PHP_EOL;
});
```

* Feature: Full support for PHP 8.1 release.
(#150 by @clue)

* Feature: Provide limited support for `NO_BACKSLASH_ESCAPES` SQL mode.
(#139 by @clue)

* Update project dependencies, simplify socket usage, and improve documentation.
(#136 and #137 by @SimonFrings)

* Improve test suite and add `.gitattributes` to exclude dev files from exports.
Run tests on PHPUnit 9 and PHP 8 and clean up test suite.
(#142 and #143 by @SimonFrings)

## 0.5.5 (2021-07-19)

* Feature: Simplify usage by supporting new default loop.
Expand Down Expand Up @@ -77,7 +167,7 @@ using the new lazy connections as detailed below.
From a consumer side this means that you can start sending queries to the
database right away while the underlying connection may still be
outstanding. Because creating this underlying connection may take some
time, it will enqueue all oustanding commands and will ensure that all
time, it will enqueue all outstanding commands and will ensure that all
commands will be executed in correct order once the connection is ready.
In other words, this "virtual" connection behaves just like a "real"
connection as described in the `ConnectionInterface` and frees you from
Expand Down Expand Up @@ -123,7 +213,7 @@ have to take care of when updating from an older version.
$connection = new Connection($loop, $options);
$connection->connect(function (?Exception $error, $connection) {
if ($error) {
// an error occured while trying to connect or authorize client
// an error occurred while trying to connect or authorize client
} else {
// client connection established (and authenticated)
}
Expand All @@ -136,7 +226,7 @@ have to take care of when updating from an older version.
// client connection established (and authenticated)
},
function (Exception $e) {
// an error occured while trying to connect or authorize client
// an error occurred while trying to connect or authorize client
}
);
```
Expand Down
Loading

0 comments on commit 322479a

Please sign in to comment.