mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 11:48:08 +08:00
Merge remote-tracking branch 'upstream/master' into view
This commit is contained in:
commit
a674682186
@ -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"
|
||||
|
||||
|
@ -1,8 +1,11 @@
|
||||
# v1.0.6 - TBD
|
||||
|
||||
|
||||
# v1.0.5 - 2019-07-07
|
||||
|
||||
## Added
|
||||
|
||||
- [#185](https://github.com/hyperf-cloud/hyperf/pull/185) Added support for xml format of response.
|
||||
- [#185](https://github.com/hyperf-cloud/hyperf/pull/185) [#224](https://github.com/hyperf-cloud/hyperf/pull/224) 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.
|
||||
|
||||
|
@ -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/task": "self.version",
|
||||
"hyperf/tracer": "self.version",
|
||||
"hyperf/utils": "self.version",
|
||||
@ -136,7 +136,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\\Task\\": "src/task/src/",
|
||||
"Hyperf\\Tracer\\": "src/tracer/src/",
|
||||
"Hyperf\\Utils\\": "src/utils/src/",
|
||||
@ -152,7 +152,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/",
|
||||
@ -162,7 +162,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\\Task\\": "./src/task/tests/",
|
||||
"HyperfTest\\Utils\\": "./src/utils/tests/",
|
||||
"HyperfTest\\View\\": "./src/view/tests/",
|
||||
|
@ -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
|
||||
@ -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
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
<directory suffix="Test.php">./src/database/tests</directory>
|
||||
<directory suffix="Test.php">./src/db-connection/tests</directory>
|
||||
<directory suffix="Test.php">./src/di/tests</directory>
|
||||
<directory suffix="Test.php">./src/dispatcher/tests</directory>
|
||||
<directory suffix="Test.php">./src/elasticsearch/tests</directory>
|
||||
<directory suffix="Test.php">./src/event/tests</directory>
|
||||
<directory suffix="Test.php">./src/guzzle/tests</directory>
|
||||
|
@ -36,7 +36,7 @@
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"HyperfTest\\Dispatcher\\": "test"
|
||||
"HyperfTest\\Dispatcher\\": "tests"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
|
@ -10,7 +10,7 @@
|
||||
stopOnFailure="false">
|
||||
<testsuites>
|
||||
<testsuite name="Tests">
|
||||
<directory suffix="Test.php">./test</directory>
|
||||
<directory suffix="Test.php">./tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
|
@ -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;
|
33
src/dispatcher/tests/Middlewares/TestMiddleware.php
Normal file
33
src/dispatcher/tests/Middlewares/TestMiddleware.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of Hyperf.
|
||||
*
|
||||
* @link https://www.hyperf.io
|
||||
* @document https://doc.hyperf.io
|
||||
* @contact group@hyperf.io
|
||||
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
namespace HyperfTest\Dispatcher\Middlewares;
|
||||
|
||||
use Hyperf\Utils\Context;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Server\MiddlewareInterface;
|
||||
use Psr\Http\Server\RequestHandlerInterface;
|
||||
|
||||
class TestMiddleware implements MiddlewareInterface
|
||||
{
|
||||
/**
|
||||
* Process an incoming server request and return a response, optionally delegating
|
||||
* response creation to a handler.
|
||||
*/
|
||||
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
|
||||
{
|
||||
/** @var ResponseInterface $response */
|
||||
$response = Context::get(ResponseInterface::class);
|
||||
return $response->withAddedHeader('Server', 'Hyperf');
|
||||
}
|
||||
}
|
@ -81,7 +81,7 @@ class Response extends ServerResponse implements ResponseInterface
|
||||
*/
|
||||
public function xml($data, string $root = 'root'): PsrResponseInterface
|
||||
{
|
||||
$data = $this->toXml($data, $root);
|
||||
$data = $this->toXml($data, null, $root);
|
||||
return $this->getResponse()
|
||||
->withAddedHeader('content-type', 'application/xml; charset=utf-8')
|
||||
->withBody(new SwooleStream($data));
|
||||
|
@ -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": [
|
@ -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
|
||||
{
|
@ -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;
|
Loading…
Reference in New Issue
Block a user