{"push_id":2839493608,"size":7,"distinct_size":7,"ref":"refs/heads/master","head":"7b9759df21be5f7eaa8ced8d1c59d8b3890cb35a","before":"c6302dcde74dafb959cce8de7920f1fc69917fc2","commits":[{"sha":"013973e7510ae48e19eda2aa5fdc15ab184e3737","author":{"name":"Matthew Weier O'Phinney","email":"f80d0ca101e967b50b730ddf8e8aca0de85e8df6@zend.com"},"message":"Calculate content length when emitting static files\n\nOne piece of all log formats I've seen is reporting the length in bytes\nof the content returned; as such, we need to calculate it.\n\n`content-length` was chosen for the header to allow us to consistently\nquery the value regardless of which message we use.","distinct":true,"url":"https://api.github.com/repos/zendframework/zend-expressive-swoole/commits/013973e7510ae48e19eda2aa5fdc15ab184e3737"},{"sha":"9f6799ac7f77453546ab10b73ab935040b746e19","author":{"name":"Matthew Weier O'Phinney","email":"f80d0ca101e967b50b730ddf8e8aca0de85e8df6@zend.com"},"message":"Refactor middleware to allow access to response status and content length\n\nThis patch provides an additional refactor to the middleware system in\norder to allow us to provide access to the response status and content\nlength from the runner, where we can then use the information for\nlogging purposes.\n\nAs such, it makes the following changes:\n\n- The `StaticResourceHandlerInterface` now only defines the method\n  `processStaticResource(Swoole\\Http\\Request $request, Swoole\\Http\\Response $response) : ?StaticResourceHandler\\StaticResourceResponse`\n\n- It adds the following methods to `StaticResourceResponse`:\n  - `markAsFailure()`\n  - `isFailure()`\n  - `setContentLength()`\n  - `getContentLength()`\n  - `getStatus()`\n\n- It extracts the type map and cache to a new middleware, `ContentTypeFilterMiddleware`.\n  This middleware returns a failure response if it cannot match the file\n  or the file does not exist. Otherwise, it delegates to the next\n  middleware, and adds an appropriate `Content-Type` header to the\n  response before returning it.\n\n- `StaticResourceHandler` now only composes the document root and\n  middleware. `processStaticResource()` no longer does type mapping, but\n  instead introspects the response returned from middleware to see if it\n  is a failure; it then returns null. Otherwise, it sends the swoole\n  response and returns the static response.\n\n- The default response sender and the `GzipMiddleware` response sender\n  now calculate the content length and use it to both send a\n  `Content-Length` header as well as provide it to the static response.\n\nThese changes simplify `StaticResourceHandler` further, and make testing\neven easier (other than integration testing, which is largely\nunchanged).","distinct":true,"url":"https://api.github.com/repos/zendframework/zend-expressive-swoole/commits/9f6799ac7f77453546ab10b73ab935040b746e19"},{"sha":"5ecd93b42caa7862ab8f3999142819863f2ae609","author":{"name":"Matthew Weier O'Phinney","email":"f80d0ca101e967b50b730ddf8e8aca0de85e8df6@zend.com"},"message":"Add comprehensive access log capabilities\n\nThis patch ports much of the logic from middlewares/access-log to this\npackage in order to provide access log capabilities that match standard\nweb servers.\n\nThe patch creates a new `Log` subnamespace with the following interfaces\nand classes:\n\n- `Log\\AccessLogInterface` extends PSR-3, and adds the methods\n  `logAccessForPsr7Resource` and `logAccessForStaticResource`. Each\n  takes a Swoole request and the associated response type.\n\n- `AccessLogDataMap` is used to pull logging data from the relevant\n  request and response resources. It creates a request-end timestamp\n  during instantiation, and accepts a flag indicating whether or not to\n  perform hostname lookups (disabled by default).\n\n- `AccessLogFormatterInterface` defines a single method, `format()`,\n  which accepts an `AccessLogDataMap` and returns a string.\n\n- `AccessLogFormatter` receives a logging format to its constructor, and\n  use that format when its `format()` method is called to generate the\n  message string for the logger, using the provided `AccessLogDataMap`.\n\n- `Psr3AccessLogDecorator` implements `AccessLogInterface` and accepts a\n  PSR-3 logger, `AccessLogFormatterInterface` instance, and a boolean\n  indicating whether or not to perform hostname lookups. The PSR-3\n  methods all proxy to the decorated logger. The `AccessLogInterface`-\n  specific methods each generate an `AccessLogDataMap`, and then pass\n  the value to the composed `AccessLogFormatter` to generate a message.\n  If the response status code is >=400, it uses the logger's `error()`\n  method, otherwise its `info()` method.\n\n- `AccessLogFactory` grabs the PSR-3 `LoggerInterface` service if it\n  exists, the `AccessLogFormatterInterface` service if it exists, and any\n  configuration under `zend-expressive-swoole.swoole-http-server.logger`\n  to create a `Psr3AccessLogDecorator`. Configuration options include:\n\n   - `format`: defaults to `AccessLogFormatter::FORMAT_COMMON`\n   - `use-hostname-lookup`: defaults to `false`\n\n  If no PSR-3 logger is available, it uses the shipped `StdoutLogger`\n  implementation. If no `AccessLogFormatterInterface` service exists, it\n  creates and uses an `AccessLogFormatter` instance.\n\nAdditionally, the `StdoutLogger` has been moved to this subnamespace.\n\nFinally, `SwooleRequestHandlerRunner` now composes an `AccessLogInterface`\ninstance instead of a PSR-3 logger instance. Log events around server\nstart/stop/reload/etc. now use the `notice` priority. Request logs\nhappen after the response has been sent, using the appropriate\n`AccessLogInterface` methods. This approach means that logging will not\nimpact clients.","distinct":true,"url":"https://api.github.com/repos/zendframework/zend-expressive-swoole/commits/5ecd93b42caa7862ab8f3999142819863f2ae609"},{"sha":"061fce2321fd39e5c43302301874dab941c651ed","author":{"name":"Matthew Weier O'Phinney","email":"f80d0ca101e967b50b730ddf8e8aca0de85e8df6@zend.com"},"message":"Updates logging chapter to reflect changes introduced","distinct":true,"url":"https://api.github.com/repos/zendframework/zend-expressive-swoole/commits/061fce2321fd39e5c43302301874dab941c651ed"},{"sha":"b50b92774968aceeeb9c1142d496c9b40c9541a8","author":{"name":"Matthew Weier O'Phinney","email":"f80d0ca101e967b50b730ddf8e8aca0de85e8df6@zend.com"},"message":"Minor updates to static resource chapter to reflect changes","distinct":true,"url":"https://api.github.com/repos/zendframework/zend-expressive-swoole/commits/b50b92774968aceeeb9c1142d496c9b40c9541a8"},{"sha":"3769b77458b78ef6ad1587aceac4a0bdf28c41d9","author":{"name":"Matthew Weier O'Phinney","email":"f80d0ca101e967b50b730ddf8e8aca0de85e8df6@zend.com"},"message":"Adds CHANGELOG entry for #26","distinct":true,"url":"https://api.github.com/repos/zendframework/zend-expressive-swoole/commits/3769b77458b78ef6ad1587aceac4a0bdf28c41d9"},{"sha":"7b9759df21be5f7eaa8ced8d1c59d8b3890cb35a","author":{"name":"Matthew Weier O'Phinney","email":"f80d0ca101e967b50b730ddf8e8aca0de85e8df6@zend.com"},"message":"Merge branch 'feature/logging'\n\nClose #26","distinct":true,"url":"https://api.github.com/repos/zendframework/zend-expressive-swoole/commits/7b9759df21be5f7eaa8ced8d1c59d8b3890cb35a"}]}
{"actor":{"display_login":"weierophinney"}}