Skip to content
Permalink
6.3
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Commits on Mar 17, 2023

  1. bug #49690 [WebProfilerBundle] replace helper with _self in serialize…

    …r.html.twig (k0d3r1s)
    
    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [WebProfilerBundle] replace helper with _self in serializer.html.twig
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | Fix #49686
    | License       | MIT
    
    While waiting for reply, here is a fix for bug in #49686.
    As`helper` was removed, now `_self` must be used, these looks like forgotten places
    
    Commits
    -------
    
    b27aab9 [WebProfilerBundle] replace helper with _self in serializer.html.twig
    nicolas-grekas committed Mar 17, 2023
  2. minor #49716 [Scheduler] Fix some minor bugs (fabpot)

    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [Scheduler] Fix some minor bugs
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | yes
    | New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
    | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
    | Tickets       | n/a
    | License       | MIT
    | Doc PR        | n/a
    
    Commits
    -------
    
    9fc7cf5 [Scheduler] Fix some minor bugs
    nicolas-grekas committed Mar 17, 2023
  3. minor #49695 [Notifier] Add "retry" and "expire" options to Pushover …

    …bridge (vlepeule)
    
    This PR was squashed before being merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [Notifier] Add "retry" and "expire" options to Pushover bridge
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | -
    | License       | MIT
    | Doc PR        | -
    
    Add "retry" and "expire" options to handle "Emergency Priority", according to  [Pushover API documentation](https://pushover.net/api#priority) :
    
    > To send an emergency-priority notification, the priority parameter must be set to 2 and the retry and expire parameters must be supplied.
    
    Commits
    -------
    
    2feabc6 [Notifier] Add "retry" and "expire" options to Pushover bridge
    nicolas-grekas committed Mar 17, 2023
  4. minor #49717 [Scheduler] Remove unused variable in AddScheduleMesseng…

    …erPass (onEXHovia)
    
    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [Scheduler] Remove unused variable in AddScheduleMessengerPass
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | yes
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | n/a
    | License       | MIT
    | Doc PR        | n/a
    
    Commits
    -------
    
    09df772 [Scheduler] Remove unused variable in AddScheduleMessengerPass
    nicolas-grekas committed Mar 17, 2023
  5. Merge branch '6.2' into 6.3

    * 6.2:
      explicitly set the HTTP method override option to false
    xabbuh committed Mar 17, 2023
  6. minor #49715 [FrameworkBundle] explicitly set the HTTP method overrid…

    …e option to false (xabbuh)
    
    This PR was merged into the 6.2 branch.
    
    Discussion
    ----------
    
    [FrameworkBundle] explicitly set the HTTP method override option to false
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.2
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       |
    | License       | MIT
    | Doc PR        |
    
    Commits
    -------
    
    489f9ca explicitly set the HTTP method override option to false
    xabbuh committed Mar 17, 2023

Commits on Mar 16, 2023

  1. feature #47112 [Messenger] Add a scheduler component (upyx, fabpot)

    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [Messenger] Add a scheduler component
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | no
    | New feature?  | yes
    | Deprecations? | no
    | Tickets       | no
    | License       | MIT
    | Doc PR        | TBD
    
    ### Introdution
    
    There is no easy way to schedule periodical tasks. There are few useful tools which I touched:
    
    - https://github.com/Guikingone/SchedulerBundle
    - https://github.com/Cron/Symfony-Bundle
    - https://github.com/zenstruck/schedule-bundle
    - https://github.com/lavary/crunz
    
    They are complicated. They doesn't allow to set time with precision in seconds (at least it isn't easy). They require difficult tricks to set not linear periods (like on sunset in Tokyo). ~They are~ Part of them inefficient with infrequent tasks because resources are needed on every run (e.g. Kubernetes [CronJob](https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/) creates and destroes an entire container).
    
    ### Proposal
    
    I use a custom transport of Messenger that **generates** messages periodically. It's a simple solution to run periodical jobs without external software. It's especially helpful in environments where additional runners are impossible or very painful (like Kubernetes). Configuration is very flexible and accurate, it's possible to configure any rules when to run or not to run.
    
    Compared to `crond`: there is no need to install something external, precision of schedule in microseconds instead of *minutes*, it's possible to set any periods.
    
    #### Simple example
    
    ```yaml
    # messenger.yaml
    framework:
      messenger:
        transports:
          schedule_default: 'schedule://default'
    ```
    
    Few types of messages:
    ```php
    class SomeJob {}
    class OtherJob {}
    ```
    
    A handlers:
    ```php
    #[AsMessageHandler]
    class SomeJobHandler {
        public function __invoke(SomeJob $job) {
            // do job or delegate it to other service
        }
    }
    
    #[AsMessageHandler]
    class OtherJobHandler {
        public function __invoke(OtherJob $job) {
            // do job or delegate it to other service
        }
    }
    ```
    
    A schedules are provided by locators. It's possible to create many locators and/or provide many schedules by the same locator:
    
    ```php
    class ExampleLocator implements ScheduleLocatorInterface
    {
        public function get(string $id): ScheduleConfig
        {
            // once after an hour from now
            $deferForAnHour = new \DatePeriod(
                new \DateTimeImmutable('now'),
                new \DateInterval('PT1H'),
                1,
                \DatePeriod::EXCLUDE_START_DATE
            );
    
            return (new ScheduleConfig())
                ->add(new OnceTrigger(new \DateTimeImmutable()), new WarmUpJob()) // once on every worker's start
                ->add(PeriodicalTrigger::create('P1D', '2022-01-01T03:00:00Z'), new SomeJob()) // every night at 3 a.m. (UTC)
                ->add(PeriodicalTrigger::fromPeriod($deferForAnHour), new OtherJob())
            ;
        }
    
        public function has(string $id): bool
        {
            return 'default' === $id;
        }
    }
    ```
    
    To run schedule:
    
    ```sh
    bin/console messenger:consume schedule_default
    ```
    
    It's easy to run jobs manually:
    
    ```php
    #[AsCommand(name: 'some', description: 'Manually runs SomeJob')]
    class SomeCommand extends Command {
        public function __construct(private MessageBusInterface $bus) {
        }
    
        protected function execute(InputInterface $input, OutputInterface $output): int {
            $this->bus->dispatch(new SomeJob());
        }
    }
    ```
    
    #### Example with returning a result
    
    ```php
    class GoodJob {
        public function __construct(public readonly ?LoggerInterface $logger) {
        }
    }
    ```
    
    ```php
    #[AsMessageHandler]
    class GoodHandler {
        public function __construct(private readonly LoggerInterface $logger) {
        }
    
        public function __invoke(GoodJob $job){
            // compute $result
            ($job->logger ?? $this->logger)->info('The result is: {result}', ['result' => $result])
        }
    }
    ```
    
    ```php
    #[AsCommand(name: 'job', description: 'Manually runs job')]
    class SomeCommand extends Command {
        public function __construct(private MessageBusInterface $bus) {
        }
    
        protected function execute(InputInterface $input, OutputInterface $output): int {
            $this->bus->dispatch(new GoodJob(new ConsoleLogger($output))); // result will be printed in console
        }
    }
    ```
    
    #### Configuring
    
    A minimal configuration:
    
    ```yaml
    # messenger.yaml
    framework:
      messenger:
        transports:
          schedule_default: 'schedule://default'
    ```
    
    More complex example:
    
    ```yaml
    # messenger.yaml
    framework:
      messenger:
        transports:
          schedule_default:
            dsn: 'schedule://default'
            options:
              cache: 'app.cache'
              lock: 'default'
    ```
    
    Example HA configuration with redis:
    
    ```yaml
    framework:
      cache:
        default_redis_provider: '%env(REDIS_DSN)%'
      lock:
        redis: '%env(REDIS_DSN)%'
      messenger:
        transports:
          schedule_default:
            dsn: 'schedule://default'
            options:
              cache: 'cache.redis'
              lock:
                resource: 'redis'
                ttl: 60
                auto_release: true
    ```
    
    ### Deprecations
    
    None
    
    ### Implementation
    
    This PR contains an implementation.
    
    ### ToDo
    
    - [x] Remove obsolete code
    - [x] Add a configuration to the Framework
    - [x] Specialize exceptions and improve messages
    - [x] Cover with tests
    - [ ] Add acceptance tests for HA
    - [x] Fix `CHANGELOG`s & `README`s
    - [ ] Add documentation
    
    Commits
    -------
    
    a18127b [Scheduler] Rework the component
    6d9311f Add the Scheduler component
    fabpot committed Mar 16, 2023
  2. minor #49707 [ErrorHandler] Fixed tests (lyrixx)

    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [ErrorHandler] Fixed tests
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       |
    | License       | MIT
    | Doc PR        |
    
    Commits
    -------
    
    bb8b73e [ErrorHandler] Fixed tests
    nicolas-grekas committed Mar 16, 2023
  3. [ErrorHandler] Fixed tests

    lyrixx committed Mar 16, 2023
  4. minor #49676 [Config] Improve performance of GlobResource (nicolas-gr…

    …ekas)
    
    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [Config] Improve performance of GlobResource
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | Fix #49668
    | License       | MIT
    | Doc PR        | -
    
    When using an extended glob pattern that contains `/**/`, we skip using the native `glob()` function and we fallback to using the Finder component.
    
    For a pattern like `./{apps,src}/**/*Controller.php`, the way finder works in `GlobResource` is that we list all files *recursively* in the directory before the pattern starts (`./` here) and we filter the paths using a regexp.
    
    This PR ensures that we scan only the `apps` and `src` directories when presented with such a pattern.
    
    Commits
    -------
    
    1771262 [Config] Improve performance of GlobResource
    nicolas-grekas committed Mar 16, 2023
  5. minor #49694 [Validator] Add PHPDoc void return types (mbuliard)

    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [Validator] Add PHPDoc void return types
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | contribution to #47551
    | License       | MIT
    | Doc PR        | -
    
    Add missing void PHPdoc return types for the Validator component
    
    Commits
    -------
    
    e70241d [Validator] Add PHPDoc void return types
    nicolas-grekas committed Mar 16, 2023
  6. feature #49691 [FrameworkBundle] Add scoped httplug clients and depre…

    …cate httplugs use like psr18 client (simonberger)
    
    This PR was squashed before being merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [FrameworkBundle] Add scoped httplug clients and deprecate httplugs use like psr18 client
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | no
    | New feature?  | yes
    | Deprecations? | yes
    | Tickets       | Fix #49644
    | License       | MIT
    | Doc PR        | symfony/symfony-docs#18064
    
    This MR does 2 closely related things to try to fully integrate the HttplugClient with the unique features it brings and on the other hand deprecate its use like a psr18 client which it is in a pending deprecation state since a long time.
    
    - Added a new services `httplug.http_client` and alias `Http\Client\HttpAsyncClient` to inject the the `HttplugClient`.
    - Make the available service `Http\Client\HttpClient` a deprecated alias of it
    - Create httplug.<scoped_client_id> services for all scoped clients like it is done with the psr18 ClientInterface
    
    Commits
    -------
    
    20ab567 [FrameworkBundle] Add scoped httplug clients and deprecate httplugs use like psr18 client
    nicolas-grekas committed Mar 16, 2023
  7. [FrameworkBundle] Add scoped httplug clients and deprecate httplugs u…

    …se like psr18 client
    simonberger authored and nicolas-grekas committed Mar 16, 2023
  8. Add the Scheduler component

    upyx authored and fabpot committed Mar 16, 2023
  9. bug #49696 Fix DI logic when mailer is available but webhook is not (…

    …fabpot)
    
    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    Fix DI logic when mailer is available but webhook is not
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | yes
    | New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
    | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
    | Tickets       | n/a
    | License       | MIT
    | Doc PR        | n/a
    
    Commits
    -------
    
    80cb3f5 Fix DI logic when mailer is available but webhook is not
    fabpot committed Mar 16, 2023

Commits on Mar 15, 2023

  1. feature #48542 [Webhook][RemoteEvent] Add the components (fabpot)

    This PR was squashed before being merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [Webhook][RemoteEvent] Add the components
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | no
    | New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
    | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
    | Tickets       | n/a <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
    | License       | MIT
    | Doc PR        | n/a
    
    See my keynote slide about this here: https://speakerdeck.com/fabpot/symfonycon-2022-keynote-webhooks
    
    Video from SymfonyCon Disneyland Paris https://live.symfony.com/account/replay/video/669
    
    Commits
    -------
    
    e51a2b1 [Webhook][RemoteEvent] Add the components
    fabpot committed Mar 15, 2023

Commits on Mar 14, 2023

  1. minor #49684 [DependencyInjection] Use weak references in ContainerBu…

    …ilder (nicolas-grekas)
    
    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [DependencyInjection] Use weak references in ContainerBuilder
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | -
    | License       | MIT
    | Doc PR        | -
    
    Same as #48469 for ContainerBuilder.
    
    Commits
    -------
    
    749d4b9 [DependencyInjection] Use weak references in ContainerBuilder
    nicolas-grekas committed Mar 14, 2023
  2. minor #49683 [DependencyInjection] Generalize and simplify parsing of…

    … autowiring attributes (nicolas-grekas)
    
    This PR was merged into the 6.3 branch.
    
    Discussion
    ----------
    
    [DependencyInjection] Generalize and simplify parsing of autowiring attributes
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.3
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | -
    | License       | MIT
    | Doc PR        | -
    
    This PR generalizes the relationship between the `Autowire` and the `TypedReference` classes, allowing to nest them inside each others (as supported already), but without loosing information in the process.
    
    It also removes the `AutowiringFailedException` currently thrown when encountering unknown attributes, to respect the declarative nature of attributes.
    
    Commits
    -------
    
    e154659 [DependencyInjection] Generalize and simplify parsing of autowiring attributes
    nicolas-grekas committed Mar 14, 2023
  3. Merge branch '6.2' into 6.3

    * 6.2:
      Fix some Composer keywords
      Fix some Composer keywords
      Fix some Composer keywords
    fabpot committed Mar 14, 2023
  4. Fix some Composer keywords

    fabpot committed Mar 14, 2023
  5. Fix some Composer keywords

    fabpot committed Mar 14, 2023
  6. Merge branch '5.4' into 6.2

    * 5.4:
      Fix some Composer keywords
    fabpot committed Mar 14, 2023
  7. Fix some Composer keywords

    fabpot committed Mar 14, 2023
  8. Merge branch '6.2' into 6.3

    * 6.2:
      Fix some Composer keywords
      [FrameworkBundle] Rename limiter’s `strategy` to `policy` in XSD
      [VarDumper] Fixed dumping of CutStub
      Fix test
      Change limit argument from string to integer.
      [Messenger] Fix `evaluate()` calls in `WorkerTest`
      [Mailer] STDOUT blocks infinitely under Windows when STDERR is filled
    fabpot committed Mar 14, 2023
Older