From 87df26cdf443c9f9b9f6e6de668807a7b285ecda Mon Sep 17 00:00:00 2001 From: daydaygo Date: Sat, 13 Jul 2019 18:40:19 +0800 Subject: [PATCH 01/25] feat: add stack trace --- src/utils/src/Coroutine.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/src/Coroutine.php b/src/utils/src/Coroutine.php index cd6c3d7d7..26ec6dba6 100644 --- a/src/utils/src/Coroutine.php +++ b/src/utils/src/Coroutine.php @@ -63,7 +63,7 @@ class Coroutine if ($container->has(StdoutLoggerInterface::class)) { /* @var LoggerInterface $logger */ $logger = $container->get(StdoutLoggerInterface::class); - $logger->warning(sprintf('Uncaptured exception[%s] detected in %s::%d.', get_class($throwable), $throwable->getFile(), $throwable->getLine())); + $logger->warning(sprintf("Uncaptured exception[%s] detected in %s::%d.\nStack trace:\n%s", get_class($throwable), $throwable->getFile(), $throwable->getLine(), $throwable->getTraceAsString())); } } } From 485ad6f0b76cf61ac043c2602a44ffe15ffd4898 Mon Sep 17 00:00:00 2001 From: daydaygo Date: Sat, 13 Jul 2019 19:58:15 +0800 Subject: [PATCH 02/25] feat: add stack trace --- src/utils/src/Coroutine.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/src/Coroutine.php b/src/utils/src/Coroutine.php index 26ec6dba6..61378a997 100644 --- a/src/utils/src/Coroutine.php +++ b/src/utils/src/Coroutine.php @@ -13,6 +13,7 @@ declare(strict_types=1); namespace Hyperf\Utils; use Hyperf\Contract\StdoutLoggerInterface; +use Hyperf\ExceptionHandler\Formatter\FormatterInterface; use Psr\Log\LoggerInterface; use Swoole\Coroutine as SwooleCoroutine; use Throwable; @@ -63,7 +64,9 @@ class Coroutine if ($container->has(StdoutLoggerInterface::class)) { /* @var LoggerInterface $logger */ $logger = $container->get(StdoutLoggerInterface::class); - $logger->warning(sprintf("Uncaptured exception[%s] detected in %s::%d.\nStack trace:\n%s", get_class($throwable), $throwable->getFile(), $throwable->getLine(), $throwable->getTraceAsString())); + /* @var FormatterInterface $formmater */ + $formmater = $container->get(FormatterInterface::class); + $logger->warning($formmater->format($throwable)); } } } From 89678c95ac402f7c186cbb2d4cf6895d61089af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9C=9D=E6=99=96?= Date: Sun, 14 Jul 2019 01:30:58 +0800 Subject: [PATCH 03/25] Update Coroutine.php --- src/utils/src/Coroutine.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/utils/src/Coroutine.php b/src/utils/src/Coroutine.php index 61378a997..32fbb74d8 100644 --- a/src/utils/src/Coroutine.php +++ b/src/utils/src/Coroutine.php @@ -65,8 +65,12 @@ class Coroutine /* @var LoggerInterface $logger */ $logger = $container->get(StdoutLoggerInterface::class); /* @var FormatterInterface $formmater */ - $formmater = $container->get(FormatterInterface::class); - $logger->warning($formmater->format($throwable)); + if ($container->has(FormatterInterface::class)) { + $formmater = $container->get(FormatterInterface::class); + $logger->warning($formmater->format($throwable)); + } else { + $logger->warning(sprintf('Uncaptured exception[%s] detected in %s::%d.', get_class($throwable), $throwable->getFile(), $throwable->getLine())); + } } } } From a8037ba9af9ac6f8b0e2cbecef3bc54ed108d4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Sun, 14 Jul 2019 09:38:44 +0800 Subject: [PATCH 04/25] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebabfa016..2005e5467 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Added - [#185](https://github.com/hyperf-cloud/hyperf/pull/185) Added support for xml format of response. +- [#202](https://github.com/hyperf-cloud/hyperf/pull/202) Added trace message when throw a uncaptured exception in function `go`. ## Fixed From d69b983d164a44145b04bdfce6acb32b53b0b6d2 Mon Sep 17 00:00:00 2001 From: daydaygo Date: Sun, 14 Jul 2019 19:01:07 +0800 Subject: [PATCH 05/25] update logger doc --- doc/zh/logger.md | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/doc/zh/logger.md b/doc/zh/logger.md index 164315188..3f30979fd 100644 --- a/doc/zh/logger.md +++ b/doc/zh/logger.md @@ -121,9 +121,9 @@ $log->alert('czl'); - 首先, 实例化一个 `Logger`, 取个名字, 名字对应的就是 `channel` - 可以为 `Logger` 绑定多个 `Handler`, `Logger` 打日志, 交由 `Handler` 来处理 -- `Handler` 可以指定需要处理那些 **日志级别** 的日志, 比如 `Logger::WARNING`, 只处理日志级别 `>=Logger::WARNING` 的日志 +- `Handler` 可以指定需要处理哪些 **日志级别** 的日志, 比如 `Logger::WARNING`, 只处理日志级别 `>=Logger::WARNING` 的日志 - 谁来格式化日志? `Formatter`, 设置好 Formatter 并绑定到相应的 `Handler` 上 -- 日志包含那些部分: `"%datetime%||%channel||%level_name%||%message%||%context%||%extra%\n"` +- 日志包含哪些部分: `"%datetime%||%channel||%level_name%||%message%||%context%||%extra%\n"` - 区分一下日志中添加的额外信息 `context` 和 `extra`: `context` 由用户打日志时额外指定, 更加灵活; `extra` 由绑定到 `Logger` 上的 `Processor` 固定添加, 比较适合收集一些 **常见信息** ## 更多用法 @@ -138,34 +138,16 @@ namespace App; use Hyperf\Logger\Logger; use Hyperf\Utils\ApplicationContext; -/** - * @method static Logger get($name) - * @method static void log($level, $message, array $context = array()) - * @method static void emergency($message, array $context = array()) - * @method static void alert($message, array $context = array()) - * @method static void critical($message, array $context = array()) - * @method static void error($message, array $context = array()) - * @method static void warning($message, array $context = array()) - * @method static void notice($message, array $context = array()) - * @method static void info($message, array $context = array()) - * @method static void debug($message, array $context = array()) - */ class Log { - public static function __callStatic($name, $arguments) + public static function get(string $name = 'app') { - $container = ApplicationContext::getContainer(); - $factory = $container->get(\Hyperf\Logger\LoggerFactory::class); - if ($name === 'get') { - return $factory->get(...$arguments); - } - $log = $factory->get('default'); - $log->$name(...$arguments); + return ApplicationContext::getContainer()->get(\Hyperf\Logger\LoggerFactory::class)->get($name); } } ``` -默认使用 `default` 的 `Channel` 来记录日志,您也可以通过使用 `Log::get($name)` 方法获得不同 `Channel` 的 `Logger`, 强大的 `容器(Container)` 帮您解决了这一切 +默认使用 `Channel` 名为 `app` 来记录日志,您也可以通过使用 `Log::get($name)` 方法获得不同 `Channel` 的 `Logger`, 强大的 `容器(Container)` 帮您解决了这一切 ### stdout 日志 From fb5ba37c893e32813e14d0c656808f3442f30f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=9F=8E=E9=93=AD?= <767036228@qq.com> Date: Tue, 16 Jul 2019 11:58:28 +0800 Subject: [PATCH 06/25] Update intro.md --- doc/zh/component-guide/intro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/zh/component-guide/intro.md b/doc/zh/component-guide/intro.md index 3ae71b7e8..badd67716 100644 --- a/doc/zh/component-guide/intro.md +++ b/doc/zh/component-guide/intro.md @@ -43,7 +43,7 @@ git clone git@github.com:hyperf-cloud/hyperf.git "hyperf": { "type": "path", "url": "../hyperf/src/*" - } + }, "packagist": { "type": "composer", "url": "https://mirrors.aliyun.com/composer" @@ -94,4 +94,4 @@ testing -> ../../../hyperf/src/testing utils -> ../../../hyperf/src/utils ``` -此时,我们便可达到在 IDE 内直接对 `vendor/hyperf` 内的文件进行修改,而修改的却是 `hyperf` 内的代码的目的,这样最终我们便可直接对 `hyperf` 项目内进行 `commit`,然后向主干提交 `Pull Request(PR)` 了。 \ No newline at end of file +此时,我们便可达到在 IDE 内直接对 `vendor/hyperf` 内的文件进行修改,而修改的却是 `hyperf` 内的代码的目的,这样最终我们便可直接对 `hyperf` 项目内进行 `commit`,然后向主干提交 `Pull Request(PR)` 了。 From 8d29bcf032c1ec59eaada764436d8d7617328642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Tue, 16 Jul 2019 13:30:23 +0800 Subject: [PATCH 07/25] Fixed multi clients will be replaced by the latest one. --- src/rpc-client/src/AbstractServiceClient.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc-client/src/AbstractServiceClient.php b/src/rpc-client/src/AbstractServiceClient.php index acbe6c864..762bc0916 100644 --- a/src/rpc-client/src/AbstractServiceClient.php +++ b/src/rpc-client/src/AbstractServiceClient.php @@ -98,7 +98,7 @@ abstract class AbstractServiceClient $this->dataFormatter = $this->createDataFormatter(); $loadBalancer = $this->createLoadBalancer(...$this->createNodes()); $transporter = $this->createTransporter()->setLoadBalancer($loadBalancer); - $this->client = $this->container->get(Client::class) + $this->client = make(Client::class) ->setPacker($this->createPacker()) ->setTransporter($transporter); } @@ -139,7 +139,7 @@ abstract class AbstractServiceClient throw new InvalidArgumentException(sprintf('Transporter %s is not exists.', $transporter)); } /* @var TransporterInterface $instance */ - return $this->container->get($transporter); + return make($transporter); } protected function createPacker(): PackerInterface From 473f2ae4cc7faa94622d5df1c15d27c8703b9910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Tue, 16 Jul 2019 13:47:06 +0800 Subject: [PATCH 08/25] Fixed ssl_key and cert does not work expected. --- src/guzzle/src/CoroutineHandler.php | 4 +++ .../tests/Cases/CoroutineHandlerTest.php | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/guzzle/src/CoroutineHandler.php b/src/guzzle/src/CoroutineHandler.php index 7ad15ceb9..d4353c311 100644 --- a/src/guzzle/src/CoroutineHandler.php +++ b/src/guzzle/src/CoroutineHandler.php @@ -142,6 +142,10 @@ class CoroutineHandler } } + // SSL KEY + isset($options['ssl_key']) && $settings['ssl_key_file'] = $options['ssl_key']; + isset($options['cert']) && $settings['ssl_cert_file'] = $options['cert']; + // Swoole Setting if (isset($options['swoole']) && is_array($options['swoole'])) { $settings = array_replace($settings, $options['swoole']); diff --git a/src/guzzle/tests/Cases/CoroutineHandlerTest.php b/src/guzzle/tests/Cases/CoroutineHandlerTest.php index d72930a4e..19632460f 100644 --- a/src/guzzle/tests/Cases/CoroutineHandlerTest.php +++ b/src/guzzle/tests/Cases/CoroutineHandlerTest.php @@ -148,6 +148,33 @@ class CoroutineHandlerTest extends TestCase $this->assertSame('pass', $setting['http_proxy_password']); } + public function testSslKeyAndCert() + { + $client = new Client([ + 'base_uri' => 'http://127.0.0.1:8080', + 'handler' => HandlerStack::create(new CoroutineHandlerStub()), + 'timeout' => 5, + 'cert' => 'apiclient_cert.pem', + 'ssl_key' => 'apiclient_key.pem', + ]); + + $data = json_decode($client->get('/')->getBody()->getContents(), true); + + $this->assertSame('apiclient_cert.pem', $data['setting']['ssl_cert_file']); + $this->assertSame('apiclient_key.pem', $data['setting']['ssl_key_file']); + + $client = new Client([ + 'base_uri' => 'http://127.0.0.1:8080', + 'handler' => HandlerStack::create(new CoroutineHandlerStub()), + 'timeout' => 5, + ]); + + $data = json_decode($client->get('/')->getBody()->getContents(), true); + + $this->assertArrayNotHasKey('ssl_cert_file', $data['setting']); + $this->assertArrayNotHasKey('ssl_key_file', $data['setting']); + } + public function testUserInfo() { $url = 'https://username:password@127.0.0.1:8080'; From 28bcc6c457af4a4feec70d855e76d9dd857265e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Tue, 16 Jul 2019 13:49:05 +0800 Subject: [PATCH 09/25] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcadad825..86a606d55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - [#176](https://github.com/hyperf-cloud/hyperf/pull/176) Fixed TypeError: Return value of LengthAwarePaginator::nextPageUrl() must be of the type string or null, none returned. - [#188](https://github.com/hyperf-cloud/hyperf/pull/188) Fixed proxy of guzzle client does not work expected. +- [#212](https://github.com/hyperf-cloud/hyperf/pull/212) Fixed config `ssl_key` and `cert` of guzzle client does not work expected. # v1.0.4 - 2019-07-08 From 9aacc0d290eb183d4843ca5c27f68689be4a1fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Tue, 16 Jul 2019 13:49:42 +0800 Subject: [PATCH 10/25] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dcadad825..85d1b1fae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - [#176](https://github.com/hyperf-cloud/hyperf/pull/176) Fixed TypeError: Return value of LengthAwarePaginator::nextPageUrl() must be of the type string or null, none returned. - [#188](https://github.com/hyperf-cloud/hyperf/pull/188) Fixed proxy of guzzle client does not work expected. +- [#211](https://github.com/hyperf-cloud/hyperf/pull/211) Fixed rpc clients will be replaced by the latest one. # v1.0.4 - 2019-07-08 From 355e27a95e84f42b051f5aa07bdbe9295b2b7a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9C=9D=E6=99=96?= Date: Tue, 16 Jul 2019 14:51:02 +0800 Subject: [PATCH 11/25] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3902e6878..991c3d520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ - [#176](https://github.com/hyperf-cloud/hyperf/pull/176) Fixed TypeError: Return value of LengthAwarePaginator::nextPageUrl() must be of the type string or null, none returned. - [#188](https://github.com/hyperf-cloud/hyperf/pull/188) Fixed proxy of guzzle client does not work expected. -- [#211](https://github.com/hyperf-cloud/hyperf/pull/211) Fixed rpc clients will be replaced by the latest one. +- [#211](https://github.com/hyperf-cloud/hyperf/pull/211) Fixed rpc client will be replaced by the latest one. - [#212](https://github.com/hyperf-cloud/hyperf/pull/212) Fixed config `ssl_key` and `cert` of guzzle client does not work expected. # v1.0.4 - 2019-07-08 From 39f4efde9a248e30d471381c0f201890098491bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Tue, 16 Jul 2019 14:55:14 +0800 Subject: [PATCH 12/25] Update .travis.yml --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8a87239c..43c8a2900 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,15 +11,15 @@ matrix: - php: 7.2 env: SW_VERSION="4.3.5" - php: 7.2 - env: SW_VERSION="4.4.0" + env: SW_VERSION="4.4.1" - php: 7.3 env: SW_VERSION="4.3.5" - php: 7.3 - env: SW_VERSION="4.4.0" + env: SW_VERSION="4.4.1" - php: master env: SW_VERSION="4.3.5" - php: master - env: SW_VERSION="4.4.0" + env: SW_VERSION="4.4.1" allow_failures: - php: master From 0345d0ceeec0d5192e27e18da3925b2a7f479971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=A5=87=E5=B3=B0?= Date: Tue, 16 Jul 2019 15:08:31 +0800 Subject: [PATCH 13/25] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=201.=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=AB=AF=E5=8F=A3=E9=80=89=E9=A1=B9=202.supervisor?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=94=E7=94=A8=E7=83=AD=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/zh/db/quick-start.md | 4 +++- doc/zh/tutorial/supervisor.md | 13 ++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/zh/db/quick-start.md b/doc/zh/db/quick-start.md index e0b74aa31..269eec248 100644 --- a/doc/zh/db/quick-start.md +++ b/doc/zh/db/quick-start.md @@ -49,6 +49,7 @@ return [ 'default' => [ 'driver' => env('DB_DRIVER', 'mysql'), 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', 3306), 'database' => env('DB_DATABASE', 'hyperf'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''), @@ -76,6 +77,7 @@ return [ 'default' => [ 'driver' => env('DB_DRIVER', 'mysql'), 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', 3306), 'database' => env('DB_DATABASE', 'hyperf'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''), @@ -336,4 +338,4 @@ try{ } catch(\Throwable $ex){ Db::rollBack(); } -``` \ No newline at end of file +``` diff --git a/doc/zh/tutorial/supervisor.md b/doc/zh/tutorial/supervisor.md index 7caea92ad..d789f7182 100644 --- a/doc/zh/tutorial/supervisor.md +++ b/doc/zh/tutorial/supervisor.md @@ -23,16 +23,18 @@ cp /etc/supervisord.conf /etc/supervisord.d/supervisord.conf ```ini # 新建一个应用并设置一个名称,这里设置为 hyperf [program:hyperf] +#设置命令在指定的目录内执行 +directory = /var/www/hyperf/ # 这里为您要管理的项目的启动命令,对应您的项目的真实路径 -command=php /var/www/hyperf/bin/hyperf.php start +command=php ./bin/hyperf.php start # 以哪个用户来运行该进程 user=root # supervisor 启动时自动该应用 autostart=true # 进程退出后自动重启进程 autorestart=true -# 重试间隔秒数 -startsecs=5 +# 执行supervisorctl satrt命令之前的缓冲秒数 +startsecs=1 # 重试次数 startretries=3 # stderr 日志输出位置 @@ -60,4 +62,9 @@ supervisorctl restart hyperf supervisorctl stop hyperf # 查看所有被管理项目运行状态 supervisorctl status + +# 添加新的应用,热刷新配置文件 +supervisorctl update +# 重新启动配置中的所有程序 +supervisorctl reload ``` From 5fe8ef77723580b77994126d119c46c9c0798e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=A5=87=E5=B3=B0?= Date: Tue, 16 Jul 2019 15:17:03 +0800 Subject: [PATCH 14/25] =?UTF-8?q?=E6=9B=B4=E6=96=B0=EF=BC=9A=201.=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E9=85=8D=E7=BD=AE=E9=80=89=E9=A1=B9=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=AB=AF=E5=8F=A3=E9=80=89=E9=A1=B9=202.supervisor?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=94=E7=94=A8=E7=83=AD=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/zh/tutorial/supervisor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/zh/tutorial/supervisor.md b/doc/zh/tutorial/supervisor.md index d789f7182..6017fe30f 100644 --- a/doc/zh/tutorial/supervisor.md +++ b/doc/zh/tutorial/supervisor.md @@ -63,7 +63,7 @@ supervisorctl stop hyperf # 查看所有被管理项目运行状态 supervisorctl status -# 添加新的应用,热刷新配置文件 +# 添加新的应用,刷新配置文件(所有守护进程会被重新启动加载最新配置) supervisorctl update # 重新启动配置中的所有程序 supervisorctl reload From f08b40fb4f2db76069246b637d863c68249e1b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9C=9D=E6=99=96?= Date: Tue, 16 Jul 2019 15:45:35 +0800 Subject: [PATCH 15/25] Update supervisor.md --- doc/zh/tutorial/supervisor.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/zh/tutorial/supervisor.md b/doc/zh/tutorial/supervisor.md index 6017fe30f..5e34b047d 100644 --- a/doc/zh/tutorial/supervisor.md +++ b/doc/zh/tutorial/supervisor.md @@ -23,9 +23,9 @@ cp /etc/supervisord.conf /etc/supervisord.d/supervisord.conf ```ini # 新建一个应用并设置一个名称,这里设置为 hyperf [program:hyperf] -#设置命令在指定的目录内执行 -directory = /var/www/hyperf/ -# 这里为您要管理的项目的启动命令,对应您的项目的真实路径 +# 设置命令在指定的目录内执行 +directory=/var/www/hyperf/ +# 这里为您要管理的项目的启动命令 command=php ./bin/hyperf.php start # 以哪个用户来运行该进程 user=root @@ -33,7 +33,7 @@ user=root autostart=true # 进程退出后自动重启进程 autorestart=true -# 执行supervisorctl satrt命令之前的缓冲秒数 +# 进程持续运行多久才认为是启动成功 startsecs=1 # 重试次数 startretries=3 @@ -62,9 +62,8 @@ supervisorctl restart hyperf supervisorctl stop hyperf # 查看所有被管理项目运行状态 supervisorctl status - -# 添加新的应用,刷新配置文件(所有守护进程会被重新启动加载最新配置) +# 重新加载配置文件 supervisorctl update -# 重新启动配置中的所有程序 +# 重新启动所有程序 supervisorctl reload ``` From aaecddbeb26cbd6497d7656859e3628b3d56eddc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Tue, 16 Jul 2019 18:05:44 +0800 Subject: [PATCH 16/25] Update and rename swoole-dashboard.md to swoole-enterprise.md --- .../{swoole-dashboard.md => swoole-enterprise.md} | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) rename doc/zh/{swoole-dashboard.md => swoole-enterprise.md} (76%) diff --git a/doc/zh/swoole-dashboard.md b/doc/zh/swoole-enterprise.md similarity index 76% rename from doc/zh/swoole-dashboard.md rename to doc/zh/swoole-enterprise.md index cd07ff39c..a7764e806 100644 --- a/doc/zh/swoole-dashboard.md +++ b/doc/zh/swoole-enterprise.md @@ -1,12 +1,19 @@ -# Swoole Dashboard +# Swoole Enterprise -[dashboard](https://www.swoole-cloud.com/dashboard.html) 作为 `Swoole` 官方出品、更专一、更专业。 +[Swoole Enterprise](https://www.swoole-cloud.com/dashboard.html) 作为 `Swoole` 官方出品的一款企业级应用解决方案、更专一、更专业。 - 时刻掌握应用架构模型 +> 自动发现应用依赖拓扑结构和展示,时刻掌握应用的架构模型 - 分布式跨应用链路追踪 -- 完善的系统监控 -- 零成本接入 +> 支持无侵入的分布式跨应用链路追踪,让每个请求一目了然,全面支持协程/非协程环境,数据实时可视化 - 全面分析报告服务状况 +> 各种维度统计服务上报的调用信息, 比如总流量、平均耗时、超时率等,并全面分析报告服务状况 +- 拥有强大的调试工具链 +> 系统支持远程调试,可远程开启检测内存泄漏、阻塞检测和代码性能分析 +- 完善的系统监控 +> 支持完善的系统监控,零成本部署,监控机器的CPU、内存、网络、磁盘等资源,可以很方便的集成到现有报警系统 +- 零成本接入系统 +> Swoole Enterprise系统客户端脚本一键部署,服务端可在Docker环境中运行,简单快捷 ## 安装 From 042de02ca334b1ad988e98b774eaf3721439cdcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9C=9D=E6=99=96?= Date: Tue, 16 Jul 2019 18:09:35 +0800 Subject: [PATCH 17/25] Update summary.md --- doc/summary.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/summary.md b/doc/summary.md index cd21aa807..4639e206f 100644 --- a/doc/summary.md +++ b/doc/summary.md @@ -73,7 +73,7 @@ * [开发者工具](zh/devtool.md) * [辅助类](zh/utils.md) * [限流器](zh/rate-limit.md) - * [Swoole Dashboard](zh/swoole-dashboard.md) + * [Swoole Enterprise](zh/swoole-enterprise.md) * [计划任务](zh/crontab.md) * 应用部署 From 31b0808041be7f344da2c0c54858e20d3f50d287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9C=9D=E6=99=96?= Date: Wed, 17 Jul 2019 01:01:05 +0800 Subject: [PATCH 18/25] Bumped version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 991c3d520..d1d86c9f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# v1.0.5 - TBD +# v1.0.5 - 2019-07-07 ## Added From f4fa155c914c5b0e3ac70995dd0fec91a714838b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9C=9D=E6=99=96?= Date: Wed, 17 Jul 2019 01:19:21 +0800 Subject: [PATCH 19/25] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1d86c9f9..54f0153c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - [#185](https://github.com/hyperf-cloud/hyperf/pull/185) Added support for xml format of response. - [#202](https://github.com/hyperf-cloud/hyperf/pull/202) Added trace message when throw a uncaptured exception in function `go`. +- [#138](https://github.com/hyperf-cloud/hyperf/pull/138) [#197](https://github.com/hyperf-cloud/hyperf/pull/197) Added crontab component. # Changed From 5bf03495f5739f1ff1be649fa205d47d912d1f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9C=9D=E6=99=96?= Date: Wed, 17 Jul 2019 01:21:33 +0800 Subject: [PATCH 20/25] Fixed format --- CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54f0153c5..77f8c706f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ - [#202](https://github.com/hyperf-cloud/hyperf/pull/202) Added trace message when throw a uncaptured exception in function `go`. - [#138](https://github.com/hyperf-cloud/hyperf/pull/138) [#197](https://github.com/hyperf-cloud/hyperf/pull/197) Added crontab component. -# Changed +## Changed - [#195](https://github.com/hyperf-cloud/hyperf/pull/195) Changed the behavior of parameter `$times` of `retry()` function, means the retry times of the callable function. - [#198](https://github.com/hyperf-cloud/hyperf/pull/198) Optimized `has()` method of `Hyperf\Di\Container`, if pass a un-instantiable object (like an interface) to `$container->has($interface)`, the method result is `false` now. @@ -27,12 +27,12 @@ - [#140](https://github.com/hyperf-cloud/hyperf/pull/140) Support Swoole v4.4.0. - [#163](https://github.com/hyperf-cloud/hyperf/pull/163) Added custom arguments support to AbstractConstants::__callStatic in `hyperf/constants`. -# Changed +## Changed - [#124](https://github.com/hyperf-cloud/hyperf/pull/124) Added `$delay` parameter for `DriverInterface::push`, and marked `DriverInterface::delay` method to deprecated. - [#125](https://github.com/hyperf-cloud/hyperf/pull/125) Changed the default value of parameter $default of config() function to null. -# Fixed +## Fixed - [#110](https://github.com/hyperf-cloud/hyperf/pull/110) [#111](https://github.com/hyperf-cloud/hyperf/pull/111) Fixed Redis::select is not work expected. - [#131](https://github.com/hyperf-cloud/hyperf/pull/131) Fixed property middlewares not work in `Router::addGroup`. @@ -44,7 +44,7 @@ - [#169](https://github.com/hyperf-cloud/hyperf/pull/169) Fixed array parse failed when handle http request. - [#170](https://github.com/hyperf-cloud/hyperf/pull/170) Fixed websocket server interrupt when request a not exist route. -# Removed +## Removed - [#131](https://github.com/hyperf-cloud/hyperf/pull/131) Removed `server` property from Router options. From 994b7c3361c9ab1818bcb421197a573df2bb2ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Wed, 17 Jul 2019 10:39:56 +0800 Subject: [PATCH 21/25] Renamed swoole-dashboard to swoole-enterprise. --- composer.json | 6 +++--- doc/zh/swoole-enterprise.md | 10 +++++----- src/{swoole-dashboard => swoole-enterprise}/LICENSE.md | 0 .../composer.json | 8 ++++---- .../src/ConfigProvider.php | 2 +- .../src/Middleware/HttpServerMiddleware.php | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) rename src/{swoole-dashboard => swoole-enterprise}/LICENSE.md (100%) rename src/{swoole-dashboard => swoole-enterprise}/composer.json (85%) rename src/{swoole-dashboard => swoole-enterprise}/src/ConfigProvider.php (94%) rename src/{swoole-dashboard => swoole-enterprise}/src/Middleware/HttpServerMiddleware.php (97%) diff --git a/composer.json b/composer.json index d74691030..626cb4530 100644 --- a/composer.json +++ b/composer.json @@ -84,7 +84,7 @@ "hyperf/server": "self.version", "hyperf/service-governance": "self.version", "hyperf/swagger": "self.version", - "hyperf/swoole-dashboard": "self.version", + "hyperf/swoole-enterprise": "self.version", "hyperf/tracer": "self.version", "hyperf/utils": "self.version", "hyperf/websocket-client": "self.version", @@ -134,7 +134,7 @@ "Hyperf\\Server\\": "src/server/src/", "Hyperf\\ServiceGovernance\\": "src/service-governance/src/", "Hyperf\\Swagger\\": "src/swagger/src/", - "Hyperf\\SwooleDashboard\\": "src/swoole-dashboard/src/", + "Hyperf\\SwooleEnterprise\\": "src/swoole-enterprise/src/", "Hyperf\\Tracer\\": "src/tracer/src/", "Hyperf\\Utils\\": "src/utils/src/", "Hyperf\\WebSocketClient\\": "src/websocket-client/src/", @@ -158,7 +158,7 @@ "HyperfTest\\ModelCache\\": "./src/model-cache/tests/", "HyperfTest\\Paginator\\": "./src/paginator/tests/", "HyperfTest\\Redis\\": "./src/redis/tests/", - "HyperfTest\\SwooleDashboard\\": "./src/swoole-dashboard/tests/", + "HyperfTest\\SwooleEnterprise\\": "./src/swoole-enterprise/tests/", "HyperfTest\\Utils\\": "./src/utils/tests/", "HyperfTest\\WebSocketClient\\": "src/websocket-client/tests/", "HyperfTest\\WebSocketServer\\": "src/websocket-server/tests/" diff --git a/doc/zh/swoole-enterprise.md b/doc/zh/swoole-enterprise.md index a7764e806..c042a4e6f 100644 --- a/doc/zh/swoole-enterprise.md +++ b/doc/zh/swoole-enterprise.md @@ -39,8 +39,8 @@ php /opt/www/bin/hyperf.php start swoole-tracker.ini ```bash -[swoole_tracker] -extension=/opt/swoole_tracker.so +[swoole_plus] +extension=/opt/swoole_plus.so apm.enable=1 #打开总开关 apm.sampling_rate=100 #采样率 例如:100% @@ -97,7 +97,7 @@ WORKDIR /opt/www/.build # 这里的地址,以客户端中显示的为准 RUN ./deploy_env.sh www.swoole-cloud.com \ && chmod 755 entrypoint.sh \ - && cp swoole_tracker72.so /opt/swoole_tracker.so \ + && cp swoole_plus72.so /opt/swoole_plus.so \ && cp swoole-tracker.ini /etc/php7/conf.d/swoole-tracker.ini \ && php -m @@ -117,7 +117,7 @@ ENTRYPOINT ["sh", ".build/entrypoint.sh"] 首先安装一下对应组件 ```bash -composer require hyperf/swoole-dashboard dev-master +composer require hyperf/swoole-enterprise dev-master ``` 然后将以下 `Middleware` 写到 `middleware.php` 中。 @@ -127,7 +127,7 @@ composer require hyperf/swoole-dashboard dev-master return [ 'http' => [ - Hyperf\SwooleDashboard\Middleware\HttpServerMiddleware::class + Hyperf\SwooleEnterprise\Middleware\HttpServerMiddleware::class ], ]; diff --git a/src/swoole-dashboard/LICENSE.md b/src/swoole-enterprise/LICENSE.md similarity index 100% rename from src/swoole-dashboard/LICENSE.md rename to src/swoole-enterprise/LICENSE.md diff --git a/src/swoole-dashboard/composer.json b/src/swoole-enterprise/composer.json similarity index 85% rename from src/swoole-dashboard/composer.json rename to src/swoole-enterprise/composer.json index f2bc30db3..0e1d711f5 100644 --- a/src/swoole-dashboard/composer.json +++ b/src/swoole-enterprise/composer.json @@ -1,12 +1,12 @@ { - "name": "hyperf/swoole-dashboard", + "name": "hyperf/swoole-enterprise", "description": "A swoole dashboard library for Hyperf.", "license": "MIT", "keywords": [ "php", "swoole", "hyperf", - "swoole-dashboard" + "swoole-enterprise" ], "support": { }, @@ -31,7 +31,7 @@ "files": [ ], "psr-4": { - "Hyperf\\SwooleDashboard\\": "src" + "Hyperf\\SwooleEnterprise\\": "src" } }, "autoload-dev": { @@ -46,7 +46,7 @@ "dev-master": "1.0-dev" }, "hyperf": { - "config": "Hyperf\\SwooleDashboard\\ConfigProvider" + "config": "Hyperf\\SwooleEnterprise\\ConfigProvider" } }, "bin": [ diff --git a/src/swoole-dashboard/src/ConfigProvider.php b/src/swoole-enterprise/src/ConfigProvider.php similarity index 94% rename from src/swoole-dashboard/src/ConfigProvider.php rename to src/swoole-enterprise/src/ConfigProvider.php index 514dfc20f..b6cb839bb 100644 --- a/src/swoole-dashboard/src/ConfigProvider.php +++ b/src/swoole-enterprise/src/ConfigProvider.php @@ -10,7 +10,7 @@ declare(strict_types=1); * @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE */ -namespace Hyperf\SwooleDashboard; +namespace Hyperf\SwooleEnterprise; class ConfigProvider { diff --git a/src/swoole-dashboard/src/Middleware/HttpServerMiddleware.php b/src/swoole-enterprise/src/Middleware/HttpServerMiddleware.php similarity index 97% rename from src/swoole-dashboard/src/Middleware/HttpServerMiddleware.php rename to src/swoole-enterprise/src/Middleware/HttpServerMiddleware.php index b99c36767..942dcf31f 100644 --- a/src/swoole-dashboard/src/Middleware/HttpServerMiddleware.php +++ b/src/swoole-enterprise/src/Middleware/HttpServerMiddleware.php @@ -10,7 +10,7 @@ declare(strict_types=1); * @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE */ -namespace Hyperf\SwooleDashboard\Middleware; +namespace Hyperf\SwooleEnterprise\Middleware; use Hyperf\Contract\ConfigInterface; use Psr\Http\Message\ResponseInterface; From cc48a6d540279fad4605c80a3c7695e5397bd58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Wed, 17 Jul 2019 10:43:38 +0800 Subject: [PATCH 22/25] Update .travis.yml --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 43c8a2900..73d1f87fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,15 +9,15 @@ sudo: required matrix: include: - php: 7.2 - env: SW_VERSION="4.3.5" + env: SW_VERSION="4.3.6" - php: 7.2 env: SW_VERSION="4.4.1" - php: 7.3 - env: SW_VERSION="4.3.5" + env: SW_VERSION="4.3.6" - php: 7.3 env: SW_VERSION="4.4.1" - php: master - env: SW_VERSION="4.3.5" + env: SW_VERSION="4.3.6" - php: master env: SW_VERSION="4.4.1" From 044e41d251e5fec308c508e798ea3cbc0101c507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=94=81?= <52o@qq52o.cn> Date: Wed, 17 Jul 2019 10:50:08 +0800 Subject: [PATCH 23/25] Update swoole-enterprise.md --- doc/zh/swoole-enterprise.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/zh/swoole-enterprise.md b/doc/zh/swoole-enterprise.md index a7764e806..e761b799e 100644 --- a/doc/zh/swoole-enterprise.md +++ b/doc/zh/swoole-enterprise.md @@ -1,6 +1,6 @@ # Swoole Enterprise -[Swoole Enterprise](https://www.swoole-cloud.com/dashboard.html) 作为 `Swoole` 官方出品的一款企业级应用解决方案、更专一、更专业。 +[Swoole Enterprise](https://www.swoole-cloud.com/dashboard.html) 作为 `Swoole` 官方出品的一款企业级应用解决方案,更专一、更专业。 - 时刻掌握应用架构模型 > 自动发现应用依赖拓扑结构和展示,时刻掌握应用的架构模型 @@ -36,15 +36,15 @@ php /opt/www/bin/hyperf.php start ``` -swoole-tracker.ini +swoole-plus.ini ```bash -[swoole_tracker] -extension=/opt/swoole_tracker.so +[swoole_plus] +extension=/opt/swoole_plus.so apm.enable=1 #打开总开关 apm.sampling_rate=100 #采样率 例如:100% -# 手动埋点时再添加 +# 支持远程调试;需要手动埋点时再添加 apm.enable_xhprof=1 #开启性能分析功能 默认0 即为关闭模式 apm.enable_memcheck=1 #开启内存泄漏检测 默认0 关闭 ``` @@ -97,8 +97,8 @@ WORKDIR /opt/www/.build # 这里的地址,以客户端中显示的为准 RUN ./deploy_env.sh www.swoole-cloud.com \ && chmod 755 entrypoint.sh \ - && cp swoole_tracker72.so /opt/swoole_tracker.so \ - && cp swoole-tracker.ini /etc/php7/conf.d/swoole-tracker.ini \ + && cp swoole_plus72.so /opt/swoole_plus.so \ + && cp swoole-plus.ini /etc/php7/conf.d/swoole-plus.ini \ && php -m WORKDIR /opt/www From 7cd49c9ef496f28c6666c8b456f6e72106fe1848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Wed, 17 Jul 2019 11:11:13 +0800 Subject: [PATCH 24/25] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77f8c706f..5f42e2bc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.0.6 - TBD + +## Changed + +- [#220](https://github.com/hyperf-cloud/hyperf/pull/220) Renamed swoole-dashboard into swoole-enterprise. + # v1.0.5 - 2019-07-07 ## Added From bed2f7c4838cef2669b7604e299aafc05ab6c000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Wed, 17 Jul 2019 11:41:51 +0800 Subject: [PATCH 25/25] Added dispatcher testing. --- CHANGELOG.md | 3 -- composer.json | 2 +- phpunit.xml | 1 + src/dispatcher/composer.json | 2 +- src/dispatcher/phpunit.xml | 2 +- .../{test => tests}/HttpDispatcherTest.php | 2 +- .../Middlewares/CoreMiddleware.php | 0 .../tests/Middlewares/TestMiddleware.php | 33 +++++++++++++++++++ 8 files changed, 38 insertions(+), 7 deletions(-) rename src/dispatcher/{test => tests}/HttpDispatcherTest.php (97%) rename src/dispatcher/{test => tests}/Middlewares/CoreMiddleware.php (100%) create mode 100644 src/dispatcher/tests/Middlewares/TestMiddleware.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f42e2bc5..df80e82f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,5 @@ # v1.0.6 - TBD -## Changed - -- [#220](https://github.com/hyperf-cloud/hyperf/pull/220) Renamed swoole-dashboard into swoole-enterprise. # v1.0.5 - 2019-07-07 diff --git a/composer.json b/composer.json index 626cb4530..be76ded47 100644 --- a/composer.json +++ b/composer.json @@ -148,7 +148,7 @@ "HyperfTest\\Constants\\": "./src/constants/tests/", "HyperfTest\\Consul\\": "./src/consul/tests/", "HyperfTest\\Di\\": "./src/di/tests/", - "HyperfTest\\Dispatcher\\": "./src/dispatcher/test/", + "HyperfTest\\Dispatcher\\": "./src/dispatcher/tests/", "HyperfTest\\Database\\": "./src/database/tests/", "HyperfTest\\DbConnection\\": "./src/db-connection/tests/", "HyperfTest\\Event\\": "./src/event/tests/", diff --git a/phpunit.xml b/phpunit.xml index 37dab8f5a..55c616105 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -16,6 +16,7 @@ ./src/database/tests ./src/db-connection/tests ./src/di/tests + ./src/dispatcher/tests ./src/elasticsearch/tests ./src/event/tests ./src/guzzle/tests diff --git a/src/dispatcher/composer.json b/src/dispatcher/composer.json index 430a90aba..2e778ac7e 100644 --- a/src/dispatcher/composer.json +++ b/src/dispatcher/composer.json @@ -36,7 +36,7 @@ }, "autoload-dev": { "psr-4": { - "HyperfTest\\Dispatcher\\": "test" + "HyperfTest\\Dispatcher\\": "tests" } }, "config": { diff --git a/src/dispatcher/phpunit.xml b/src/dispatcher/phpunit.xml index ea39ed69e..88e174085 100644 --- a/src/dispatcher/phpunit.xml +++ b/src/dispatcher/phpunit.xml @@ -10,7 +10,7 @@ stopOnFailure="false"> - ./test + ./tests diff --git a/src/dispatcher/test/HttpDispatcherTest.php b/src/dispatcher/tests/HttpDispatcherTest.php similarity index 97% rename from src/dispatcher/test/HttpDispatcherTest.php rename to src/dispatcher/tests/HttpDispatcherTest.php index 1a7d71f88..b51cac6a6 100644 --- a/src/dispatcher/test/HttpDispatcherTest.php +++ b/src/dispatcher/tests/HttpDispatcherTest.php @@ -12,11 +12,11 @@ declare(strict_types=1); namespace HyperfTest\Dispatcher; -use App\Middleware\TestMiddleware; use Hyperf\Dispatcher\HttpDispatcher; use Hyperf\HttpMessage\Server\Response; use Hyperf\Utils\Context; use HyperfTest\Dispatcher\Middlewares\CoreMiddleware; +use HyperfTest\Dispatcher\Middlewares\TestMiddleware; use PHPUnit\Framework\TestCase; use Prophecy\Prophecy\ProphecyInterface; use Psr\Container\ContainerInterface; diff --git a/src/dispatcher/test/Middlewares/CoreMiddleware.php b/src/dispatcher/tests/Middlewares/CoreMiddleware.php similarity index 100% rename from src/dispatcher/test/Middlewares/CoreMiddleware.php rename to src/dispatcher/tests/Middlewares/CoreMiddleware.php diff --git a/src/dispatcher/tests/Middlewares/TestMiddleware.php b/src/dispatcher/tests/Middlewares/TestMiddleware.php new file mode 100644 index 000000000..ed7bda38d --- /dev/null +++ b/src/dispatcher/tests/Middlewares/TestMiddleware.php @@ -0,0 +1,33 @@ +withAddedHeader('Server', 'Hyperf'); + } +}