Skip to content

Commit

Permalink
Release v3.1.23 (hyperf#6787)
Browse files Browse the repository at this point in the history

Co-authored-by: zds <[email protected]>
Co-authored-by: Weslen Teche <[email protected]>
  • Loading branch information
3 people authored May 23, 2024
1 parent c79f88a commit 9d1e401
Show file tree
Hide file tree
Showing 16 changed files with 353 additions and 7 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG-3.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# v3.1.23 - TBD
# v3.1.24 - TBD

# v3.1.23 - 2024-05-23

## Added

Expand Down
18 changes: 18 additions & 0 deletions docs/en/changelog/3.1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelogs

# v3.1.23 - 2024-05-23

## Added

- [#6757](https://github.com/hyperf/hyperf/pull/6757) Added `Hyperf\Collection\LazyCollection`.
- [#6763](https://github.com/hyperf/hyperf/pull/6763) Added `Premature end of data` into `DetectsLostConnections`.
- [#6767](https://github.com/hyperf/hyperf/pull/6767) Support `whereAll/orWhereAll` `whereAny/orWhereAny` for `Hyperf\Database\Query\Builder`.
- [#6774](https://github.com/hyperf/hyperf/pull/6774) Support Lateral Join for `Hyperf\Database\Query\Builder`
- [#6781](https://github.com/hyperf/hyperf/pull/6781) Added some methods to `Hyperf\Collection\Arr`.
- [#6782](https://github.com/hyperf/hyperf/pull/6782) Added `whereJsonOverlaps`,`orWhereJsonOverlaps` and `whereJsonDoesntOverlap` to `Hyperf\Database\Query\Builder`.
- [#6783](https://github.com/hyperf/hyperf/pull/6783) Support `insertOrIgnoreUsing` for `Hyperf\Database\Query\Builder`.
- [#6784](https://github.com/hyperf/hyperf/pull/6784) Added `getOrPut` and `getOrSet` into `Hyperf\Collection\Collection`.

## Optimized

- [#6777](https://github.com/hyperf/hyperf/pull/6777) Optimized StdoutLogger to improve log message handling.
- [#6778](https://github.com/hyperf/hyperf/pull/6778) Optimized Collection using EnumeratesValues.

# v3.1.22 - 2024-05-16

## Fixed
Expand Down
4 changes: 2 additions & 2 deletions docs/en/db/db.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Minimalist DB component

[hyperf/database](https://github.com/hyperf/database) The function is very powerful, but it is undeniable that the efficiency is indeed a little insufficient. Here is a minimalist `hyperf/db` component that supports `PDO` and `Swoole Mysql`.
[hyperf/database](https://github.com/hyperf/database) The function is very powerful, but it is undeniable that the efficiency is indeed a little insufficient. Here is a minimalist `hyperf/db` component.

## Install

Expand All @@ -22,7 +22,7 @@ The default configuration `config/autoload/db.php` is as follows, the database s

| configuration item | type | default | remark |
|:--------------------:|:------:|:------------------:|:--------------------------------------------------------:|
| driver | string | none | The database engine supports `pdo` and `mysql` |
| driver | string | none | The database engine |
| host | string | `localhost` | database address |
| port | int | 3306 | database address |
| database | string | none | Database default DB |
Expand Down
90 changes: 90 additions & 0 deletions docs/en/db/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,93 @@ $book = Book::query()->find(1);
// Print the last SQL query
var_dump(Arr::last(Db::getQueryLog()));
```

## Driver list

Different from [illuminate/database](https://github.com/illuminate/database), [hyperf/database](https://github.com/hyperf/database) only provides MySQL driver by default, and currently also provides [PgSQL](https://github.com/hyperf/database-pgsql), [SQLite](https://github.com/hyperf/database-sqlite) and [SQL Server](https://github.com/hyperf/database-sqlserver-incubator) and other drivers
If the default mysql cannot meet the usage needs, you can install the corresponding driver yourself.

### PgSql driver

#### Install

Requires `Swoole >= 5.1.0` and `--enable-swoole-pgsql` is enabled when compiling

```bash
composer require hyperf/database-pgsql
```

#### Configuration file

```php
// config/autoload/databases.php
return [
// Other configurations
'pgsql'=> [
'driver' => env('DB_DRIVER', 'pgsql'),
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'hyperf'),
'port' => env('DB_PORT', 5432),
'username' => env('DB_USERNAME', 'postgres'),
'password' => env('DB_PASSWORD'),
'charset' => env('DB_CHARSET', 'utf8'),
]
];
```

### SQLite driver

#### Install

Requires `Swoole >= 5.1.0` and `--enable-swoole-sqlite` is enabled when compiling

```bash
composer require hyperf/database-pgsql
```

#### Configuration file

```php
// config/autoload/databases.php
return [
// Other configurations
'sqlite'=>[
'driver' => env('DB_DRIVER', 'sqlite'),
'host' => env('DB_HOST', 'localhost'),
// :memory: For an in-memory database, you can also specify the absolute path to the file.
'database' => env('DB_DATABASE', ':memory:'),
// other sqlite config
]
];
```

### SQL Server driver

#### Install

> In the incubation stage, we currently cannot guarantee that all functions will work properly. Feedback is welcome.
Requirements `Swoole >= 5.1.0` depends on pdo_odbc, and needs to be enabled during compilation `--with-swoole-odbc`

```bash
composer require hyperf/database-sqlserver-incubator
```

#### Configuration file

```php
// config/autoload/databases.php
return [
// Other configurations
'sqlserver' => [
'driver' => env('DB_DRIVER', 'sqlsrv'),
'host' => env('DB_HOST', 'mssql'),
'database' => env('DB_DATABASE', 'hyperf'),
'port' => env('DB_PORT', 1443),
'username' => env('DB_USERNAME', 'SA'),
'password' => env('DB_PASSWORD'),
'odbc_datasource_name' => 'DRIVER={ODBC Driver 18 for SQL Server};SERVER=127.0.0.1,1433;TrustServerCertificate=yes;database=hyperf',
'odbc' => true,
]
];
```
3 changes: 1 addition & 2 deletions docs/en/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ use Hyperf\Context\ApplicationContext;

$container = ApplicationContext::getContainer();

$redis = $this->container->get(\Redis::class);

$redis = $container->get(\Hyperf\Redis\Redis::class);
$result = $redis->keys('*');

```
Expand Down
18 changes: 18 additions & 0 deletions docs/zh-cn/changelog/3.1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# 版本更新记录

# v3.1.23 - 2024-05-23

## 新增

- [#6757](https://github.com/hyperf/hyperf/pull/6757) 新增 `Hyperf\Collection\LazyCollection`
- [#6763](https://github.com/hyperf/hyperf/pull/6763) 当遇到 `Premature end of data` 错误时,则认为当前数据库连接不可用,下次从连接池中取出来时,会被重连。
- [#6767](https://github.com/hyperf/hyperf/pull/6767)`Hyperf\Database\Query\Builder` 新增 `whereAll/orWhereAll``whereAny/orWhereAny` 方法。
- [#6774](https://github.com/hyperf/hyperf/pull/6774)`Hyperf\Database\Query\Builder` 增加 `Lateral Join` 方法。
- [#6781](https://github.com/hyperf/hyperf/pull/6781)`Hyperf\Collection\Arr` 增加一些新的方法。
- [#6782](https://github.com/hyperf/hyperf/pull/6782)`Hyperf\Database\Query\Builder` 新增 `whereJsonOverlaps`,`orWhereJsonOverlaps``whereJsonDoesntOverlap` 方法。
- [#6783](https://github.com/hyperf/hyperf/pull/6783)`Hyperf\Database\Query\Builder` 增加 `insertOrIgnoreUsing` 方法。
- [#6784](https://github.com/hyperf/hyperf/pull/6784)`Hyperf\Collection\Collection` 增加 `getOrPut``getOrSet` 方法。

## 优化

- [#6777](https://github.com/hyperf/hyperf/pull/6777) 优化 `StdoutLogger` 自定义参数的展示样式。
- [#6778](https://github.com/hyperf/hyperf/pull/6778) 使用 `EnumeratesValues` 优化 `Collection`

# v3.1.22 - 2024-05-16

## 修复
Expand Down
47 changes: 47 additions & 0 deletions docs/zh-cn/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,3 +520,50 @@ Console::command('bar', function () {
$this->comment('Hello, Bar!');
})->describe('This is another demo closure command.')->cron('* * * * *', callback: fn($cron) => $cron->setSingleton(true));
```

## AsCommand

您可以通过 `AsCommand` 注解来将一个类转换为命令。

```php
<?php

namespace App\Service;

use Hyperf\Command\Annotation\AsCommand;
use Hyperf\Command\Concerns\InteractsWithIO;

#[AsCommand(signature: 'foo:bar1', handle: 'bar1', description: 'The description of foo:bar1 command.')]
#[AsCommand(signature: 'foo', description: 'The description of foo command.')]
class FooService
{
use InteractsWithIO;

#[AsCommand(signature: 'foo:bar {--bar=1 : Bar Value}', description: 'The description of foo:bar command.')]
public function bar($bar)
{
$this->output?->info('Bar Value: ' . $bar);

return $bar;
}

public function bar1()
{
$this->output?->info(__METHOD__);
}

public function handle()
{
$this->output?->info(__METHOD__);
}
}
```

```shell
$ php bin/hyperf.php

...
foo
foo:bar The description of foo:bar command.
foo:bar1 The description of foo:bar1 command.
```
2 changes: 2 additions & 0 deletions docs/zh-cn/db/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ composer require hyperf/database-sqlserver-incubator
#### 配置文件

```php
// config/autoload/databases.php
return [
// 其他配置
'sqlserver' => [
'driver' => env('DB_DRIVER', 'sqlsrv'),
'host' => env('DB_HOST', 'mssql'),
Expand Down
20 changes: 19 additions & 1 deletion docs/zh-hk/changelog/3.0.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# 版本更新記錄

# v3.0.49 - 2024-05-16

## Added

- [#6764](https://github.com/hyperf/hyperf/pull/6764) 當遇到 `Premature end of data` 錯誤時,則認為當前數據庫連接不可用,下次從連接池中取出來時,會被重連。

# v3.0.48 - 2024-04-17

## 修復

- [#6693](https://github.com/hyperf/hyperf/pull/6693) 修復使用 `socket-io` 時,如果沒有傳入 `query` 會在 `data` 中存在 `?` 的情況下解析出錯的問題。

# v3.0.47 - 2024-01-11

## 優化

- [#6455](https://github.com/hyperf/hyperf/pull/6455) 優化 `Hyperf\SocketIOServer\Parser\Decoder::decode()` 的代碼實現。

# v3.0.46 - 2023-11-30

## Fixed
## 修復

- [#6321](https://github.com/hyperf/hyperf/pull/6321) 修復使用 `tracer` 組件時,`jaeger` 無法正確展示 `HTTP` 狀態碼的問題。

Expand Down
18 changes: 18 additions & 0 deletions docs/zh-hk/changelog/3.1.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# 版本更新記錄

# v3.1.23 - 2024-05-23

## 新增

- [#6757](https://github.com/hyperf/hyperf/pull/6757) 新增 `Hyperf\Collection\LazyCollection`
- [#6763](https://github.com/hyperf/hyperf/pull/6763) 當遇到 `Premature end of data` 錯誤時,則認為當前數據庫連接不可用,下次從連接池中取出來時,會被重連。
- [#6767](https://github.com/hyperf/hyperf/pull/6767)`Hyperf\Database\Query\Builder` 新增 `whereAll/orWhereAll``whereAny/orWhereAny` 方法。
- [#6774](https://github.com/hyperf/hyperf/pull/6774)`Hyperf\Database\Query\Builder` 增加 `Lateral Join` 方法。
- [#6781](https://github.com/hyperf/hyperf/pull/6781)`Hyperf\Collection\Arr` 增加一些新的方法。
- [#6782](https://github.com/hyperf/hyperf/pull/6782)`Hyperf\Database\Query\Builder` 新增 `whereJsonOverlaps`,`orWhereJsonOverlaps``whereJsonDoesntOverlap` 方法。
- [#6783](https://github.com/hyperf/hyperf/pull/6783)`Hyperf\Database\Query\Builder` 增加 `insertOrIgnoreUsing` 方法。
- [#6784](https://github.com/hyperf/hyperf/pull/6784)`Hyperf\Collection\Collection` 增加 `getOrPut``getOrSet` 方法。

## 優化

- [#6777](https://github.com/hyperf/hyperf/pull/6777) 優化 `StdoutLogger` 自定義參數的展示樣式。
- [#6778](https://github.com/hyperf/hyperf/pull/6778) 使用 `EnumeratesValues` 優化 `Collection`

# v3.1.22 - 2024-05-16

## 修復
Expand Down
47 changes: 47 additions & 0 deletions docs/zh-hk/command.md
Original file line number Diff line number Diff line change
Expand Up @@ -520,3 +520,50 @@ Console::command('bar', function () {
$this->comment('Hello, Bar!');
})->describe('This is another demo closure command.')->cron('* * * * *', callback: fn($cron) => $cron->setSingleton(true));
```

## AsCommand

您可以通過 `AsCommand` 註解來將一個類轉換為命令。

```php
<?php

namespace App\Service;

use Hyperf\Command\Annotation\AsCommand;
use Hyperf\Command\Concerns\InteractsWithIO;

#[AsCommand(signature: 'foo:bar1', handle: 'bar1', description: 'The description of foo:bar1 command.')]
#[AsCommand(signature: 'foo', description: 'The description of foo command.')]
class FooService
{
use InteractsWithIO;

#[AsCommand(signature: 'foo:bar {--bar=1 : Bar Value}', description: 'The description of foo:bar command.')]
public function bar($bar)
{
$this->output?->info('Bar Value: ' . $bar);

return $bar;
}

public function bar1()
{
$this->output?->info(__METHOD__);
}

public function handle()
{
$this->output?->info(__METHOD__);
}
}
```

```shell
$ php bin/hyperf.php

...
foo
foo:bar The description of foo:bar command.
foo:bar1 The description of foo:bar1 command.
```
2 changes: 2 additions & 0 deletions docs/zh-hk/db/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ composer require hyperf/database-sqlserver-incubator
#### 配置文件

```php
// config/autoload/databases.php
return [
// 其他配置
'sqlserver' => [
'driver' => env('DB_DRIVER', 'sqlsrv'),
'host' => env('DB_HOST', 'mssql'),
Expand Down
20 changes: 19 additions & 1 deletion docs/zh-tw/changelog/3.0.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
# 版本更新記錄

# v3.0.49 - 2024-05-16

## Added

- [#6764](https://github.com/hyperf/hyperf/pull/6764) 當遇到 `Premature end of data` 錯誤時,則認為當前資料庫連線不可用,下次從連線池中取出來時,會被重連。

# v3.0.48 - 2024-04-17

## 修復

- [#6693](https://github.com/hyperf/hyperf/pull/6693) 修復使用 `socket-io` 時,如果沒有傳入 `query` 會在 `data` 中存在 `?` 的情況下解析出錯的問題。

# v3.0.47 - 2024-01-11

## 最佳化

- [#6455](https://github.com/hyperf/hyperf/pull/6455) 最佳化 `Hyperf\SocketIOServer\Parser\Decoder::decode()` 的程式碼實現。

# v3.0.46 - 2023-11-30

## Fixed
## 修復

- [#6321](https://github.com/hyperf/hyperf/pull/6321) 修復使用 `tracer` 元件時,`jaeger` 無法正確展示 `HTTP` 狀態碼的問題。

Expand Down
Loading

0 comments on commit 9d1e401

Please sign in to comment.