From 1e49f07c1ec1d199d6f54e5ba1596ccaff52e5da Mon Sep 17 00:00:00 2001 From: Konrad Obal Date: Tue, 14 Jul 2020 23:51:59 +0200 Subject: [PATCH] docs(readme): clarify state of HMR in bundle (#275) - update deps - update composer develop line to 0.8.x Fixes #264 --- CONTRIBUTING.md | 2 +- README.md | 24 +++-- composer.json | 12 +-- composer.lock | 184 ++++++++++++++++++++------------ docs/configuration-reference.md | 15 +-- docs/docker-usage.md | 2 +- 6 files changed, 153 insertions(+), 86 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18f02fec..0264713e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,7 @@ php -v # Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies ``` -Currently, the minimum supported version is `7.2.19` but it is highly recommended to develop using the latest PHP version. +Currently, the minimum supported version is `7.3.10` but it is highly recommended to develop using the latest PHP version. #### [Docker](https://docs.docker.com/install/) diff --git a/README.md b/README.md index 9c150db9..764e1678 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ Symfony integration with [Swoole](https://www.swoole.co.uk/) to speed up your ap - [Quick start guide](#quick-start-guide) - [Features](#features) - [Requirements](#requirements) + - [Current (`0.8.x`)](#current-08x) + - [Future](#future) - [Swoole](#swoole) - [Version check](#version-check) - [Installation](#installation) @@ -78,11 +80,7 @@ Symfony integration with [Swoole](https://www.swoole.co.uk/) to speed up your ap - Improved static files serving - Swoole HTTP Server provides a default static files handler, but it lacks supporting many `Content-Types`. To overcome this issue, there is (not yet configurable) Advanced Static Files Server. Static files serving remains enabled by default in the development environment. Static files directory defaults to `%kernel.project_dir%/public`. - -- Hot Module Reload (HMR) - for development - - Since Swoole HTTP Server runs in Event Loop and does not flush memory between requests, to keep DX equal with normal servers, this bundle uses code replacement technique, using `inotify` PHP Extension to allow continuous development. It is enabled by default (when the extension is found) and requires no additional configuration. You can turn it off in bundle configuration. + Swoole HTTP Server provides a default static files handler, but it lacks supporting many `Content-Types`. To overcome this issue, there is a configurable Advanced Static Files Server. Static files serving remains enabled by default in the development environment. Static files directory defaults to `%kernel.project_dir%/public`. To configure your custom mime types check [configuration reference](docs/configuration-reference.md) (key `swoole.http_server.static.mime_types`). - Symfony Messenger integration @@ -90,12 +88,26 @@ Symfony integration with [Swoole](https://www.swoole.co.uk/) to speed up your ap Swoole Server Task Transport has been integrated into this bundle to allow easy execution of asynchronous actions. Documentation of this feature is available [here](docs/swoole-task-symfony-messenger-transport.md). +- Hot Module Reload (HMR) for development **ALPHA** + + Since Swoole HTTP Server runs in Event Loop and does not flush memory between requests, to keep DX equal with normal servers, this bundle uses code replacement technique, using `inotify` PHP Extension to allow continuous development. It is enabled by default (when the extension is found) and requires no additional configuration. You can turn it off in bundle configuration. + + *Remarks: This feature currently works only on a Linux host machine. It probably won't work with Docker, and it is possible that it works only with configuration: `swoole.http_server.running_mode: process` (default).* + ## Requirements +### Current (`0.8.x`) + - PHP version `>= 7.3.10` - Swoole PHP Extension `>= 4.4.7` - Symfony `>= 4.3.1` +### Future + +- PHP version `>= 7.4` +- Swoole PHP Extension `>= 4.5` +- Symfony `>= 5.0` + Additional requirements to enable specific features: - [Inotify PHP Extension](https://pecl.php.net/package/inotify) `^2.0.0` to use Hot Module Reload (HMR) @@ -106,7 +118,7 @@ Bundle requires [Swoole PHP Extension](https://github.com/swoole/swoole-src) ver #### Version check -To check your installed version you can run following command: +To check your installed version you can run the following command: ```sh php -r "echo swoole_version() . \PHP_EOL;" diff --git a/composer.json b/composer.json index 19d85eda..8de974f5 100644 --- a/composer.json +++ b/composer.json @@ -57,12 +57,12 @@ "upscale/swoole-blackfire": "^3.0" }, "suggest": { - "ext-inotify": "To enable HMR.", - "doctrine/orm": "To use the EntityManager handler.", - "symfony/messenger": "To use Symfony Messenger Swoole Task Transport.", + "ext-inotify": "To enable HMR", + "doctrine/orm": "For using Entity Manager Handler", + "symfony/messenger": "For using Symfony Messenger Swoole Task Transport.", "upscale/swoole-blackfire": "To enable Blackfire profiling", - "pixelfederation/doctrine-resettable-em-bundle": "To be able to recover Doctrine entity managers from errors.", - "symfony/error-handler": "To use Symfony exception handler." + "pixelfederation/doctrine-resettable-em-bundle": "To be able to recover Doctrine Entity Managers from errors", + "symfony/error-handler": "To use Symfony Error Handler" }, "autoload": { "files": [ @@ -124,7 +124,7 @@ }, "extra": { "branch-alias": { - "dev-develop": "v0.7.x-dev" + "dev-develop": "v0.8.x-dev" } }, "config": { diff --git a/composer.lock b/composer.lock index 42bb4023..a26deb69 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "00aaf9e1f5dec6554fe24df2d8a97c1f", + "content-hash": "37452da9382522b89d3a06564a141865", "packages": [ { "name": "beberlei/assert", @@ -474,16 +474,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.1.2", + "version": "v2.1.3", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "dd99cb3a0aff6cadd2a8d7d7ed72c2161e218337" + "reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/dd99cb3a0aff6cadd2a8d7d7ed72c2161e218337", - "reference": "dd99cb3a0aff6cadd2a8d7d7ed72c2161e218337", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5e20b83385a77593259c9f8beb2c43cd03b2ac14", + "reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14", "shasum": "" }, "require": { @@ -493,6 +493,10 @@ "extra": { "branch-alias": { "dev-master": "2.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -530,7 +534,7 @@ "type": "tidelift" } ], - "time": "2020-05-27T08:34:37+00:00" + "time": "2020-06-06T08:49:21+00:00" }, { "name": "symfony/error-handler", @@ -691,16 +695,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.1.2", + "version": "v2.1.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "405952c4e90941a17e52ef7489a2bd94870bb290" + "reference": "f6f613d74cfc5a623fc36294d3451eb7fa5a042b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/405952c4e90941a17e52ef7489a2bd94870bb290", - "reference": "405952c4e90941a17e52ef7489a2bd94870bb290", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f6f613d74cfc5a623fc36294d3451eb7fa5a042b", + "reference": "f6f613d74cfc5a623fc36294d3451eb7fa5a042b", "shasum": "" }, "require": { @@ -714,6 +718,10 @@ "extra": { "branch-alias": { "dev-master": "2.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -759,7 +767,7 @@ "type": "tidelift" } ], - "time": "2020-05-20T17:43:50+00:00" + "time": "2020-07-06T13:23:11+00:00" }, { "name": "symfony/filesystem", @@ -1547,16 +1555,16 @@ }, { "name": "symfony/service-contracts", - "version": "v2.1.2", + "version": "v2.1.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b" + "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/66a8f0957a3ca54e4f724e49028ab19d75a8918b", - "reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/58c7475e5457c5492c26cc740cc0ad7464be9442", + "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442", "shasum": "" }, "require": { @@ -1570,6 +1578,10 @@ "extra": { "branch-alias": { "dev-master": "2.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -1615,7 +1627,7 @@ "type": "tidelift" } ], - "time": "2020-05-20T17:43:50+00:00" + "time": "2020-07-06T13:23:11+00:00" }, { "name": "symfony/string", @@ -2116,16 +2128,16 @@ }, { "name": "doctrine/cache", - "version": "1.10.1", + "version": "1.10.2", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "35a4a70cd94e09e2259dfae7488afc6b474ecbd3" + "reference": "13e3381b25847283a91948d04640543941309727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/35a4a70cd94e09e2259dfae7488afc6b474ecbd3", - "reference": "35a4a70cd94e09e2259dfae7488afc6b474ecbd3", + "url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727", + "reference": "13e3381b25847283a91948d04640543941309727", "shasum": "" }, "require": { @@ -2208,20 +2220,20 @@ "type": "tidelift" } ], - "time": "2020-05-27T16:24:54+00:00" + "time": "2020-07-07T18:54:01+00:00" }, { "name": "doctrine/collections", - "version": "1.6.5", + "version": "1.6.6", "source": { "type": "git", "url": "https://github.com/doctrine/collections.git", - "reference": "fc0206348e17e530d09463fef07ba8968406cd6d" + "reference": "5f0470363ff042d0057006ae7acabc5d7b5252d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/fc0206348e17e530d09463fef07ba8968406cd6d", - "reference": "fc0206348e17e530d09463fef07ba8968406cd6d", + "url": "https://api.github.com/repos/doctrine/collections/zipball/5f0470363ff042d0057006ae7acabc5d7b5252d5", + "reference": "5f0470363ff042d0057006ae7acabc5d7b5252d5", "shasum": "" }, "require": { @@ -2287,7 +2299,7 @@ "type": "tidelift" } ], - "time": "2020-05-25T19:24:35+00:00" + "time": "2020-06-22T19:14:02+00:00" }, { "name": "doctrine/common", @@ -4471,21 +4483,21 @@ }, { "name": "phpunit/php-token-stream", - "version": "4.0.2", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "e61c593e9734b47ef462340c24fca8d6a57da14e" + "reference": "5672711b6b07b14d5ab694e700c62eeb82fcf374" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/e61c593e9734b47ef462340c24fca8d6a57da14e", - "reference": "e61c593e9734b47ef462340c24fca8d6a57da14e", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/5672711b6b07b14d5ab694e700c62eeb82fcf374", + "reference": "5672711b6b07b14d5ab694e700c62eeb82fcf374", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.3" + "php": "^7.3 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^9.0" @@ -4522,7 +4534,7 @@ "type": "github" } ], - "time": "2020-06-16T07:00:44+00:00" + "time": "2020-06-27T06:36:25+00:00" }, { "name": "phpunit/phpcov", @@ -4780,20 +4792,20 @@ }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "2.0.1", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "c771130f0e8669104a4320b7101a81c2cc2963ef" + "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c771130f0e8669104a4320b7101a81c2cc2963ef", - "reference": "c771130f0e8669104a4320b7101a81c2cc2963ef", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ee51f9bb0c6d8a43337055db3120829fa14da819", + "reference": "ee51f9bb0c6d8a43337055db3120829fa14da819", "shasum": "" }, "require": { - "php": "^7.3" + "php": "^7.3 || ^8.0" }, "require-dev": { "phpunit/phpunit": "^9.0" @@ -4827,7 +4839,7 @@ "type": "github" } ], - "time": "2020-06-15T12:56:39+00:00" + "time": "2020-06-26T12:04:00+00:00" }, { "name": "sebastian/comparator", @@ -5708,16 +5720,16 @@ }, { "name": "symfony/cache-contracts", - "version": "v2.1.2", + "version": "v2.1.3", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "87c92f62c494626598e9148208aaa6d1716b8e3c" + "reference": "9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/87c92f62c494626598e9148208aaa6d1716b8e3c", - "reference": "87c92f62c494626598e9148208aaa6d1716b8e3c", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009", + "reference": "9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009", "shasum": "" }, "require": { @@ -5731,6 +5743,10 @@ "extra": { "branch-alias": { "dev-master": "2.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -5776,7 +5792,7 @@ "type": "tidelift" } ], - "time": "2020-05-20T17:43:50+00:00" + "time": "2020-07-06T13:23:11+00:00" }, { "name": "symfony/debug-bundle", @@ -6570,16 +6586,16 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "f048e612a3905f34931127360bdd2def19a5e582" + "reference": "3d9c70ff1b9f6bb618f9954b2f7f760220c2b38a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/f048e612a3905f34931127360bdd2def19a5e582", - "reference": "f048e612a3905f34931127360bdd2def19a5e582", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/3d9c70ff1b9f6bb618f9954b2f7f760220c2b38a", + "reference": "3d9c70ff1b9f6bb618f9954b2f7f760220c2b38a", "shasum": "" }, "require": { @@ -6589,6 +6605,10 @@ "extra": { "branch-alias": { "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -6635,7 +6655,7 @@ "type": "tidelift" } ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/profiler-pack", @@ -6891,16 +6911,16 @@ }, { "name": "symfony/translation-contracts", - "version": "v2.1.2", + "version": "v2.1.3", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "e5ca07c8f817f865f618aa072c2fe8e0e637340e" + "reference": "616a9773c853097607cf9dd6577d5b143ffdcd63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/e5ca07c8f817f865f618aa072c2fe8e0e637340e", - "reference": "e5ca07c8f817f865f618aa072c2fe8e0e637340e", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/616a9773c853097607cf9dd6577d5b143ffdcd63", + "reference": "616a9773c853097607cf9dd6577d5b143ffdcd63", "shasum": "" }, "require": { @@ -6913,6 +6933,10 @@ "extra": { "branch-alias": { "dev-master": "2.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" } }, "autoload": { @@ -6958,7 +6982,7 @@ "type": "tidelift" } ], - "time": "2020-05-20T17:43:50+00:00" + "time": "2020-07-06T13:23:11+00:00" }, { "name": "symfony/twig-bridge", @@ -7438,23 +7462,23 @@ }, { "name": "theseer/tokenizer", - "version": "1.1.3", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" + "reference": "75a63c33a8577608444246075ea0af0d052e452a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", - "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", + "reference": "75a63c33a8577608444246075ea0af0d052e452a", "shasum": "" }, "require": { "ext-dom": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", - "php": "^7.0" + "php": "^7.2 || ^8.0" }, "type": "library", "autoload": { @@ -7474,30 +7498,36 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2019-06-13T22:48:21+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2020-07-12T23:59:07+00:00" }, { "name": "twig/twig", - "version": "v3.0.3", + "version": "v3.0.4", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3b88ccd180a6b61ebb517aea3b1a8906762a1dc2" + "reference": "582bdbdc173027ebfba3c93dc750a40b8f9ebc02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3b88ccd180a6b61ebb517aea3b1a8906762a1dc2", - "reference": "3b88ccd180a6b61ebb517aea3b1a8906762a1dc2", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/582bdbdc173027ebfba3c93dc750a40b8f9ebc02", + "reference": "582bdbdc173027ebfba3c93dc750a40b8f9ebc02", "shasum": "" }, "require": { - "php": "^7.2.5", + "php": ">=7.2.5", "symfony/polyfill-ctype": "^1.8", "symfony/polyfill-mbstring": "^1.3" }, "require-dev": { "psr/container": "^1.0", - "symfony/phpunit-bridge": "^4.4|^5.0" + "symfony/phpunit-bridge": "^4.4.9|^5.0.9" }, "type": "library", "extra": { @@ -7536,7 +7566,29 @@ "keywords": [ "templating" ], - "time": "2020-02-11T15:33:47+00:00" + "funding": [ + { + "url": "https://certification.symfony.com/", + "type": "custom" + }, + { + "url": "https://live.symfony.com/", + "type": "custom" + }, + { + "url": "https://symfony.com/cloud/", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/twig/twig", + "type": "tidelift" + } + ], + "time": "2020-07-05T13:18:14+00:00" }, { "name": "upscale/swoole-blackfire", diff --git a/docs/configuration-reference.md b/docs/configuration-reference.md index ddd06cf3..dbfde51f 100644 --- a/docs/configuration-reference.md +++ b/docs/configuration-reference.md @@ -30,18 +30,21 @@ swoole: # static: # public_dir: '%kernel.project_dir%/public' # strategy: advanced - # mime_types: [] + # mime_types: ~ # --- # strategy can be one of: (default) auto, off, advanced, default # - off: turn off feature # - auto: use 'advanced' when debug enabled or not production environment # - advanced: use request handler class \K911\Swoole\Server\RequestHandler\AdvancedStaticFilesServer # - default: use default swoole static serving (faster than advanced, but supports less content types) - # mime types registration by file extension for static files serving (file extension: mime type) - # this only works when 'static' strategy is set to 'advanced' - mime_types: - '*': 'text/plain' # fallback override - sqlite: 'application/x-sqlite3' + # --- + # mime types registration by file extension for static files serving in format: 'file extension': 'mime type' + # this only works when 'static' strategy is set to 'advanced' + # + # mime_types: + # '*': 'text/plain' # fallback override + # customFileExtension: 'custom-mime/type-name' + # sqlite: 'application/x-sqlite3' # enables hot module reload using inotify hmr: auto diff --git a/docs/docker-usage.md b/docs/docker-usage.md index 11877c40..f898aa79 100644 --- a/docs/docker-usage.md +++ b/docs/docker-usage.md @@ -58,7 +58,7 @@ Features: - Multi-stage builds (fast rebuilds) - Secure (run as custom user) -- Portable (add as many php extensions as you want) +- Portable (add as many PHP extensions as you want) ```dockerfile ARG PHP_TAG="7.3-cli-alpine3.9"