Skip to content

Commit

Permalink
add default cleaners
Browse files Browse the repository at this point in the history
  • Loading branch information
hhxsv5 committed Mar 17, 2019
1 parent 1010e9c commit 72bb3f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Settings-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@

- `swoole_tables``array` 定义的`swoole_table`列表,参考[示例](https://github.com/hhxsv5/laravel-s/blob/master/README-CN.md#%E4%BD%BF%E7%94%A8swoole_table)

- `cleaners``array` `每次请求`的清理器列表,用于清理一些残留的全局变量、单例对象、静态属性,避免多次请求间数据污染。这些清理器类必须实现接口`Hhxsv5\LaravelS\Illuminate\Cleaners\CleanerInterface`。清理的顺序与数组的顺序保持一致。发布配置后生成的默认清理器是必须的,不能删除
- `cleaners``array` `每次请求`的清理器列表,用于清理一些残留的全局变量、单例对象、静态属性,避免多次请求间数据污染。这些清理器类必须实现接口`Hhxsv5\LaravelS\Illuminate\Cleaners\CleanerInterface`。清理的顺序与数组的顺序保持一致。[这些清理器](https://github.com/hhxsv5/laravel-s/blob/master/src/Illuminate/Laravel.php#L44)默认已启用
```php
//...
'cleaners' => [
//Hhxsv5\LaravelS\Illuminate\Cleaners\SessionCleaner::class, // 如果你的项目中使用到了Session或Authentication,请解除这行注释
//Hhxsv5\LaravelS\Illuminate\Cleaners\AuthCleaner::class, // 如果你的项目中使用到了Authentication或Passport,请解除这行注释
//Hhxsv5\LaravelS\Illuminate\Cleaners\JWTCleaner::class, // 如果你的项目中使用到了包"tymon/jwt-auth",请解除这行注释
Hhxsv5\LaravelS\Illuminate\Cleaners\RequestCleaner::class,
//...
],
//...
Expand Down
3 changes: 1 addition & 2 deletions Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@

- `swoole_tables`: `array` The defined of `swoole_table` list, refer [Demo](https://github.com/hhxsv5/laravel-s/blob/master/README.md#use-swoole_table).

- `cleaners`: `array` The list of cleaners for `each request` is used to clean up some residual global variables, singleton objects, and static properties to avoid data pollution between requests, these classes must implement interface `Hhxsv5\LaravelS\Illuminate\Cleaners\CleanerInterface`. The order of cleanup is consistent with the order of the arrays. The default cleaner generated after publishing configuration is required and cannot be deleted.
- `cleaners`: `array` The list of cleaners for `each request` is used to clean up some residual global variables, singleton objects, and static properties to avoid data pollution between requests, these classes must implement interface `Hhxsv5\LaravelS\Illuminate\Cleaners\CleanerInterface`. The order of cleanup is consistent with the order of the arrays. [Some cleaners](https://github.com/hhxsv5/laravel-s/blob/master/src/Illuminate/Laravel.php#L44) enabled by default.
```php
//...
'cleaners' => [
//Hhxsv5\LaravelS\Illuminate\Cleaners\SessionCleaner::class, // If you use the session/authentication in your project, please uncomment this line
//Hhxsv5\LaravelS\Illuminate\Cleaners\AuthCleaner::class, // If you use the authentication/passport in your project, please uncomment this line
//Hhxsv5\LaravelS\Illuminate\Cleaners\JWTCleaner::class, // If you use the package "tymon/jwt-auth" in your project, please uncomment this line
Hhxsv5\LaravelS\Illuminate\Cleaners\RequestCleaner::class,
//...
],
//...
Expand Down

0 comments on commit 72bb3f5

Please sign in to comment.