Version 2.2.0 - marmot-cn/marmot-framework GitHub Wiki
2.2
gzip
支持
nginx镜像更新1.2版添加请求是添加头Accept-Encoding:gzip
curl -H "Accept-Encoding: gzip,deflate" -w %{size_download} http://127.0.0.1/users/1
返回 187 字节
curl -w %{size_download} http://127.0.0.1/users/1
返回 366 字节
示例
$response = $client->request('GET', 'users/1',
[
'headers' => [
'Accept-Encoding' => 'gzip',
'Content-' => 'application/vnd.api+json'
],
'decode_content' => 'gzip'
]
);
etag
支持
添加现在返回信息会统一携带ETag
.
请求头添加If-None-Match:xxxx
,如果etag
符合则会返回304
,不带body
示例
$response = $client->request('GET', 'users/1',
[
'headers' => [
'Accept-Encoding' => 'gzip',
'Content-' => 'application/vnd.api+json',
'If-None-Match' => '001652e6184d757c80a8fc7d51a0e06b'
],
'decode_content' => 'gzip'
]
);
phpmd
添加代码检测修改代码符合phpmd
检测规范
System\Classes\Translator
修改重构,减少复杂度.
还需要添加值对象的翻译