Version 2.2.0 - marmot-cn/marmot-framework GitHub Wiki

2.2


nginx镜像更新1.2版添加gzip支持

请求是添加头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

重构,减少复杂度.

还需要添加值对象的翻译