schranz-php-recipes / symfony-recipes-php

Provides https://github.com/symfony/recipes as PHP instead of YAML configs.
MIT License
13 stars 3 forks source link

Update recipes 2023-02-09 #28

Closed symfony-php-recipes-bot closed 1 year ago

symfony-php-recipes-bot commented 1 year ago
Q A
License MIT

The Symfony Recipes changed with version . This PR contains the new definition for recipes.

github-actions[bot] commented 1 year ago

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/schranz-php-recipes/symfony-recipes-php/flex/pull-28/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/schranz-php-recipes/symfony-recipes-php/flex/pull-28/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/messenger:^6.0'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. I'm going keep this comment up to date with any updates of the attached patch.

symfony/messenger

4.1 vs 4.3 ```diff diff --git a/symfony/messenger/4.1/manifest.json b/symfony/messenger/4.3/manifest.json index d0ff173..dc04515 100644 --- a/symfony/messenger/4.1/manifest.json +++ b/symfony/messenger/4.3/manifest.json @@ -3,10 +3,13 @@ "config/": "%CONFIG_DIR%/" }, "env": { - "#1": "MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages" + "#1": "Choose one of the transports below", + "#2": "MESSENGER_TRANSPORT_DSN=doctrine://default", + "#3": "MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages", + "#4": "MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages" }, "aliases": ["messenger"], "conflict": { - "symfony/framework-bundle": "<4.1" + "symfony/framework-bundle": "<4.3" } } diff --git a/symfony/messenger/4.1/post-install.txt b/symfony/messenger/4.3/post-install.txt index 6a2c8ad..8844fe7 100644 --- a/symfony/messenger/4.1/post-install.txt +++ b/symfony/messenger/4.3/post-install.txt @@ -1,13 +1,11 @@ * You're ready to use the Messenger component. You can define your own message buses - or start using the default one right now by injecting the messenger.bus.default service - or typehinting Symfony\Component\Messenger\MessageBusInterface in your code. + or start using the default one right now by injecting the message_bus service + or type-hinting Symfony\Component\Messenger\MessageBusInterface in your code. - * If you need to send messages to your broker, you can benefit from the built-in - AMQP transport by: + * To send messages to a transport and handle them asynchronously: - 1. Installing the AMQP pack by running composer require amqp; - 2. Uncommenting the MESSENGER_TRANSPORT_DSN env var - and framework.messenger.transports.amqp config; - 3. Routing your messages to the amqp sender. + 1. Uncomment the MESSENGER_TRANSPORT_DSN env var in .env + and framework.messenger.transports.async in config/packages/messenger.yaml; + 2. Route your message classes to the async transport in config/packages/messenger.yaml. - * Read the documentation at https://symfony.com/doc/master/messenger.html + * Read the documentation at https://symfony.com/doc/current/messenger.html ```
4.3 vs 5.4 ```diff diff --git a/symfony/messenger/4.3/config/packages/messenger.php b/symfony/messenger/5.4/config/packages/messenger.php index ef9937f..6b585b6 100644 --- a/symfony/messenger/4.3/config/packages/messenger.php +++ b/symfony/messenger/5.4/config/packages/messenger.php @@ -7,6 +7,7 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura return static function (ContainerConfigurator $containerConfigurator): void { $containerConfigurator->extension('framework', [ 'messenger' => [ + 'reset_on_message' => true, 'transports' => null, 'routing' => null, ], diff --git a/symfony/messenger/4.3/manifest.json b/symfony/messenger/5.4/manifest.json index dc04515..793ce27 100644 --- a/symfony/messenger/4.3/manifest.json +++ b/symfony/messenger/5.4/manifest.json @@ -4,9 +4,9 @@ }, "env": { "#1": "Choose one of the transports below", - "#2": "MESSENGER_TRANSPORT_DSN=doctrine://default", - "#3": "MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages", - "#4": "MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages" + "#2": "MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages", + "#3": "MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages", + "MESSENGER_TRANSPORT_DSN": "doctrine://default?auto_setup=0" }, "aliases": ["messenger"], "conflict": { ```
5.4 vs 6.0 ```diff diff --git a/symfony/messenger/5.4/config/packages/messenger.php b/symfony/messenger/6.0/config/packages/messenger.php index 6b585b6..ef9937f 100644 --- a/symfony/messenger/5.4/config/packages/messenger.php +++ b/symfony/messenger/6.0/config/packages/messenger.php @@ -7,7 +7,6 @@ use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigura return static function (ContainerConfigurator $containerConfigurator): void { $containerConfigurator->extension('framework', [ 'messenger' => [ - 'reset_on_message' => true, 'transports' => null, 'routing' => null, ], diff --git a/symfony/messenger/5.4/post-install.txt b/symfony/messenger/6.0/post-install.txt index 8844fe7..186bec8 100644 --- a/symfony/messenger/5.4/post-install.txt +++ b/symfony/messenger/6.0/post-install.txt @@ -4,8 +4,10 @@ * To send messages to a transport and handle them asynchronously: - 1. Uncomment the MESSENGER_TRANSPORT_DSN env var in .env + 1. Update the MESSENGER_TRANSPORT_DSN env var in .env if needed and framework.messenger.transports.async in config/packages/messenger.yaml; - 2. Route your message classes to the async transport in config/packages/messenger.yaml. + 2. (if using Doctrine) Generate a Doctrine migration bin/console doctrine:migration:diff + and execute it bin/console doctrine:migration:migrate + 3. Route your message classes to the async transport in config/packages/messenger.yaml. * Read the documentation at https://symfony.com/doc/current/messenger.html ```