Provides an object-oriented API to query in-memory collections in a SQL-style.
Do we really need to? I mean, the whole documentation of the latest versions of Symfony stopped mention Sensio's bundle. If one follows the documentation, all attributes used are core ones 😄 But I may be missing the point and maybe the doc could be improved somewhere?
Oh you're right, that's rebased :slightly_smiling_face:
[VarDumper] Add caster for WeakMap
[Notifier][Line] Fix tests
minor #48477 [Notifier] [Line] Fix tests (OskarStark)
This PR was merged into the 6.3 branch.
[Notifier] [Line] Fix tests
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a
Follows
cc @kurozumi
9a878526d2 [Notifier][Line] Fix tests
[DependencyInjection][HttpKernel] Introduce build parameters
feature #47680 [DependencyInjection][HttpKernel] Introduce build parameters (HeahDude)
This PR was squashed before being merged into the 6.3 branch.
[DependencyInjection][HttpKernel] Introduce build parameters
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | yes | Tickets | ~ | License | MIT | Doc PR | TODO
Alternative implementation of #47608. Add a convention for parameters named with a starting dot to be available at compile-time only:
$containerBuilder->setParameter('foo'); // nothing changes
$containerBuilder->setParameter('.bar'); // will not be dumped
Calling $container->getParameter('.bar')
on a compiled container will throw.
c75dbca8f0 [DependencyInjection][HttpKernel] Introduce build parameters
feature #48478 [VarDumper] Add caster for WeakMap (nicolas-grekas)
This PR was merged into the 6.3 branch.
[VarDumper] Add caster for WeakMap
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | -
bde17b7f51 [VarDumper] Add caster for WeakMap
feature #48362 [Clock] Add ClockAwareTrait to help write time-sensitive classes (nicolas-grekas)
This PR was merged into the 6.3 branch.
[Clock] Add ClockAwareTrait to help write time-sensitive classes
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | -
Add the trait and use $this->now()
inside the class, autowiring will do the magic :muscle:
8e2af95ac6 [Clock] Add ClockAwareTrait to help write time-sensitive classes
feature #48101 [Notifier] Add Mastodon Notifier (qdequippe)
This PR was merged into the 6.3 branch.
[Notifier] Add Mastodon Notifier
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | | License | MIT | Doc PR | https://github.com/symfony/symfony-docs/pull/17411 | Recipe | https://github.com/symfony/recipes/pull/1141
Migrate from Twitter with this new Symfony Notifier Bridge for Mastodon :)
d097a63983 Add Mastodon Notifier
[DependencyInjection] Remove refs that point to container.excluded services when allowed
[Console] Do no preprend empty line if the buffer is empty
bug #48483 [DependencyInjection] Remove refs that point to container.excluded services when allowed (nicolas-grekas)
This PR was merged into the 6.2 branch.
[DependencyInjection] Remove refs that point to container.excluded services when allowed
| Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #48411 | License | MIT | Doc PR | -
2e9fdf0e60 [DependencyInjection] Remove refs that point to container.excluded services when allowed
[Notifier] Fix Termii bridge exception test
[DependencyInjection] Fix typo in RemoveBuildParametersPassTest
minor #48497 [Notifier] Fix Termii bridge exception test (gnito-org)
This PR was merged into the 6.3 branch.
[Notifier] Fix Termii bridge exception test
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR |
1e40f0faed [Notifier] Fix Termii bridge exception test
[Notifier] Fix RingCentral bridge exception test
minor #48493 [Notifier] Fix RingCentral bridge exception test (gnito-org)
This PR was merged into the 6.3 branch.
[Notifier] Fix RingCentral bridge exception test
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR |
b65b78b8c5 [Notifier] Fix RingCentral bridge exception test
minor #48490 [DependencyInjection] Fix typo in RemoveBuildParametersPassTest
(alamirault)
This PR was merged into the 6.3 branch.
[DependencyInjection] Fix typo in RemoveBuildParametersPassTest
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | Fix #... | License | MIT | Doc PR | symfony/symfony-docs#...
795afb1f45 [DependencyInjection] Fix typo in RemoveBuildParametersPassTest
[Notifier] Add options to SmsMessage
minor #48475 [WebProfilerBundle] Fix the dump view panel (94noni)
This PR was merged into the 6.2 branch.
[WebProfilerBundle] Fix the dump view panel
| Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | view fix | New feature? | no | Deprecations? | no | Tickets | Fix my OCD ^^, | License | MIT | Doc PR | .
Hi, checking the new profiler, I've came accros this and it bothered me So this PR fix the view of the dump panel to be similar to others
f00db9faee [Profiler] Fix the dump view panel
minor #48487 [Console] Do no preprend empty line if the buffer is empty (lyrixx)
This PR was merged into the 6.3 branch.
[Console] Do no preprend empty line if the buffer is empty
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR |
It's really weird to preprend an empty line when in our code we write:
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$io->text(sprintf('Running project %s', $project->getId()));
}
a9f1250c1e [Console] Do no preprend empty line if the buffer is empty
| Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | NA | License | MIT | Doc PR | NA
Follow-up of https://github.com/symfony/symfony/pull/49822#discussion_r1149282713, removes backticks of a few exception messages.
[Console] Make sure signals registered by SignalableCommandInterface
commands are defined in the PCNTL extension
[Console] Make sure signals registered by SignalableCommandInterface
commands are defined in the PCNTL extension
[Console] Make sure signals registered by SignalableCommandInterface
commands are defined in the PCNTL extension
I updated the SignalRegistry
to check if the signal code is less than 32. Indeed, pcntl_signal_get_handler()
in SignalRegistry
if the signal code is above 31.
I also added a few tests for SignalRegistry
.
[Console] Make sure signals registered by SignalableCommandInterface
commands are defined in the PCNTL extension
@lyrixx I tried this snippet:
<?php
function sig_handler($signo)
{
switch ($signo) {
default:
}
}
echo "Installing signal handler";
// setup signal handlers
pcntl_signal(66, "sig_handler");
And here is the result:
Installing signal handlerPHP Fatal error: Uncaught ValueError: pcntl_signal(): Argument #1 ($signal) must be less than 65 in /home/alex/signals.php:13
Stack trace:
#0 /home/alex/signals.php(13): pcntl_signal()
#1 {main}
thrown in /home/alex/signals.php on line 15
So we should at least check that the signal number is lower than 65. Checking that the given signal is defined in the extension comes from this comment from Nicolas: https://github.com/symfony/symfony/pull/49750#discussion_r1144036134. What do you think?
[Console] Make sure signals registered by SignalableCommandInterface
commands are defined in the PCNTL extension
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | NA | License | MIT | Doc PR | No need I guess
Adding this new method in SignalRegistry
can also be leveraged in https://github.com/symfony/symfony/pull/49750
[String] Correct inflection of 'codes' and 'names'
Add the Scheduler component
[Scheduler] Rework the component
[Validator] Update BIC validator IBAN mappings
[DependencyInjection] Add support for generating lazy closures
[ErrorHandler] Fixed tests
minor #49707 [ErrorHandler] Fixed tests (lyrixx)
This PR was merged into the 6.3 branch.
[ErrorHandler] Fixed tests
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR |
bb8b73ea22 [ErrorHandler] Fixed tests
feature #47112 [Messenger] Add a scheduler component (upyx, fabpot)
This PR was merged into the 6.3 branch.
[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
There is no easy way to schedule periodical tasks. There are few useful tools which I touched:
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 creates and destroes an entire container).
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.
# messenger.yaml
framework:
messenger:
transports:
schedule_default: 'schedule://default'
Few types of messages:
class SomeJob {}
class OtherJob {}
A handlers:
#[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:
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:
bin/console messenger:consume schedule_default
It's easy to run jobs manually:
#[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());
}
}
class GoodJob {
public function __construct(public readonly ?LoggerInterface $logger) {
}
}
#[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])
}
}
#[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
}
}
A minimal configuration:
# messenger.yaml
framework:
messenger:
transports:
schedule_default: 'schedule://default'
More complex example:
# messenger.yaml
framework:
messenger:
transports:
schedule_default:
dsn: 'schedule://default'
options:
cache: 'app.cache'
lock: 'default'
Example HA configuration with redis:
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
None
This PR contains an implementation.
CHANGELOG
s & README
sa18127b789 [Scheduler] Rework the component 6d9311f087 Add the Scheduler component
add translations for the filename max length validator option
explicitly set the HTTP method override option to false
minor #49715 [FrameworkBundle] explicitly set the HTTP method override option to false (xabbuh)
This PR was merged into the 6.2 branch.
[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 |
489f9ca64d explicitly set the HTTP method override option to false
[Scheduler] Fix some minor bugs
Merge branch '6.2' into 6.3
[HttpFoundation] Add ParameterBag::getString()
and deprecate accepting invalid values
[Scheduler] Remove unused variable in AddScheduleMessengerPass
minor #49717 [Scheduler] Remove unused variable in AddScheduleMessengerPass (onEXHovia)
This PR was merged into the 6.3 branch.
[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
09df772306 [Scheduler] Remove unused variable in AddScheduleMessengerPass
[Notifier] Add "retry" and "expire" options to Pushover bridge
minor #49695 [Notifier] Add "retry" and "expire" options to Pushover bridge (vlepeule)
This PR was squashed before being merged into the 6.3 branch.
[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 :
To send an emergency-priority notification, the priority parameter must be set to 2 and the retry and expire parameters must be supplied.
2feabc641c [Notifier] Add "retry" and "expire" options to Pushover bridge
minor #49716 [Scheduler] Fix some minor bugs (fabpot)
This PR was merged into the 6.3 branch.
[Scheduler] Fix some minor bugs
| Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a
9fc7cf53dd [Scheduler] Fix some minor bugs
Stop stopwatch events in case of exception
The Webhook documentation is in progress: https://github.com/symfony/symfony-docs/pull/17964
[Webhook] Add new component documentation