Quantcast
Channel: Symfony Blog
Viewing all 3134 articles
Browse latest View live

New in Symfony 5.1: Simpler logout customization

$
0
0
Wouter De Jong

Contributed by
Wouter De Jong
in #36243.

A few months ago we started a massive effort to improve the entire Symfony Security component and its integration with the rest of the Symfony framework. We're still working on the biggest changes, but we've already finished some smaller improvements.

The current LogoutListener can be used to run some logic after a user has logged out of the application (e.g. to invalidate some tokens). Although it contains some extension points, it's not very DX-friendly (DX = developer experience) and it makes it impossible to do things like overwriting the default logout functionality from a bundle.

In Symfony 5.1 we've improved this feature with the introduction of a newLogoutEvent which replaces the existing LogoutSuccessHandlerInterface and LogoutHandlerInterface.

The new logout event is dispatched on both the global and the firewall dispatcher (whose name follows the pattern security.event_dispatcher.FIREWALLNAME). For example, to register a listener for the logout event only on the main firewall, use this config:

1
2
3
4
5
6
7
8
# config/services.yamlservices:# ...App\EventListener\MyCutomLogoutListener:tags:-name:'kernel.event_listener'event:'Symfony\Component\Security\Http\Event\LogoutEvent'dispatcher:security.event_dispatcher.main

The Symfony\\Component\\Security\\Http\\Event\\LogoutEvent object received by the listener contains useful methods such as getToken() (to get the security token of the session), getRequest() and setResponse().


Sponsor the Symfony project.

Join us tomorrow at the SymfonyLive Online conference

$
0
0

SymfonyLive Online Conference Logo

Not yet registered to tomorrow's SymfonyLive Online conference? Join us on Friday April 17th 2020 to learn from the best experts of Symfony during an Online conference in English with 2 talks of 40 minutes each.

We offer 2 conference sessions to make sure everyone can attend the event. The Online conference edition will be at 08:00 UTC and 15:00 UTC. Watch the session of your choice or both sessions!

Check the agenda of the conference, learn the latest about Symfony and enhance your knowledge from home:

  • The Symfony Notifier Component (40 min) by Fabien Potencier, project lead of Symfony, founder/CEO of Blackfire and Symfony SAS. Symfony 5.0 introduced a new Notifier Component. It is based on the work done previously in the Mailer, HttpClient, and Messenger component and leverages their features. Learn more about how to use it in your own applications.
  • Preloading and Symfony, a love story (40 min) by Nicolas Grekas, core contributor of Symfony, principal engineer for Symfony SAS. PHP preload is a hot topic these days, yet the first versions of PHP 7.4 crashed when it was enabled. Since September with the first experiments (and crash reports), Nicolas is tracking the beast: PHP 7.4.4 finally makes it usable in all contexts and he has been measuring it on a "Hello World" app. Can you expect the same benefits on your apps? Preloading comes with its own challenges. Let's review them and figure how you can get the most out of it for the benefit of your server's efficiency and response time.

Register now, VAT excluded, per person and attend the online conference. You can buy one or more vouchers, for you or for someone else. Each voucher gives a license to attend one online conference to one person, either online (one screen per person) or offline (one shared screen in a projection room, in this case you need to buy as many vouchers as there are persons in the room). While this licensing policy is not technically enforced, we assume that the community will play fair. For companies, it is a legal requirement.

Whether you can attend the international SymfonyCon or any local SymfonyLive conferences, these online gatherings might be the best opportunity to learn from the best experts of Symfony.

Stay safe and see you tomorrow online!


Sponsor the Symfony project.

New in Symfony 5.1: Remote asset manifest

$
0
0
Jérôme Tamarelle

Contributed by
Jérôme Tamarelle
in #35762.

Webpack Encore is a pure-JavaScript library developed by Symfony as a simpler way to integrate Webpack into your application. When building assets, Webpack Encore creates a manifest.json file listing all the generated assets (and their versioning).

In Symfony 5.1, we've improved this feature to allow using manifest files stored in other servers and retrieved via HTTP requests. This is useful when using CDNs (content delivery networks) to server your assets.

You don't need to add or enable any option to use this new feature. Just update the value of your existing json_manifest_path option and use an absolute URL. Symfony will make an HTTP request automatically to retrieve the manifest:

1
2
3
4
# config/packages/assets.yamlframework:assets:json_manifest_path:'https://cdn.example.com/manifest.json'

Sponsor the Symfony project.

A Week of Symfony #694 (13-19 April 2020)

$
0
0

This week Symfony celebrated a new edition of its SymfonyLive Online Conference. Talks focused on the Symfony Notifier component and the PHP class preloading in Symfony applications. In addition, the SymfonyCon Disneyland Paris 2020 conference announced that its early bird registration is open until April 27th.

Symfony development highlights

This week, 47 pull requests were merged (27 in code and 20 in docs) and 46 issues were closed (30 in code and 16 in docs). Excluding merges, 28 authors made 1,964 additions and 3,169 deletions. See details for code and docs.

3.4 changelog:

  • 41c93b6: [DependencyInjection] fixed loading defaults when using the PHP-DSL
  • f702863: [Form] RepeatedType should always have inner types mapped
  • 17bbaa5: [Cache] avoid memory leak in TraceableAdapter::reset()
  • 0f1a5c4: [Form] fixed handling groups sequence validation
  • a347a84: [SecurityBundle] fixed accepting env vars in remember-me configurations
  • 62565a1: [HttpFoundation] workaround PHP bug in the session module

4.4 changelog:

  • efb0dee: [Messenger] make sure Redis transports are initialized correctly
  • 14a2046: [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide forward compatibility with recent phpunit versions
  • 3aa7f0c: [Mailer] fixes related to From sender

5.0 changelog:

  • 6f81e03: [Mime] ensure proper line-ending for SMIME

Master changelog:

  • 0933f90: [Mailer, Messenger] add return statement for MessageHandler
  • d5fd44d: [WebProfilerBundle] make a difference between queued and sent emails
  • b2f210f: [HttpFoundation] added InputBag
  • a85545f: [Cache] added context to log messages
  • 67948a7: [Messenger] added FIFO support to the SQS transport
  • 2460ca5: [RedisMessengerBridge] add a delete_after_ack option

Newest issues and pull requests

They talked about us

Call to Action


Sponsor the Symfony project.

SymfonyLive Paris 2020: new dates for the French conference

$
0
0

SymfonyLive Paris 2020 Conference Logo

The SymfonyLive Paris 2020 initially scheduled on March 26-27 2020 has been postponed due to the Coronavirus (Covid-19) situation to September 23rd-24th 2020. As the conference is organized in French, the following blog post will be written in French.


La situation sanitaire inédite liée au Coronavirus (Covid-19) depuis ces dernières semaines a impacté beaucoup d’événements dont le SymfonyLive Paris 2020. Nous avons annoncé le 11 mars le report de la conférence, vous pouvez retrouver l’annonce du report dans notre blog post. Après des semaines de discussions et d’attente des directives gouvernementales, nous avons trouvé, en concertation avec le lieu de la conférence, les dates pour le report du SymfonyLive Paris 2020.

Nous avons finalement décidé de reporter la conférence au mois de septembre pour garantir la sécurité de tous et vous offrir un événement de qualité. Nous avons donc le plaisir de vous annoncer que la conférence SymfonyLive Paris 2020 aura désormais lieu les 23 et 24 septembre 2020 à la Cité Universitaire de Paris. Voici l’agenda de la conférence :

  • Journées de formations pré-conférence : 21-22 septembre 2020 dans les bureaux de SensioLabs à Clichy
  • Journées de conférence : 23-24 septembre à la Cité Internationale Universitaire de Paris

L'inscription au tarif normal est disponible jusqu'au 10 août 2020. Réservez votre billet pour la conférence à 349€ HT ou votre billet combo formations et conférence à 1 071€ HT.

Le planning de la conférence reste inchangé, vous pouvez découvrir tout le planning des 2 journées de conférences en ligne. Le planning des formations reste également inchangé, profitez de la conférence pour vous former sur Symfony et tirer le maximum de l'événement. Découvrez nos formations !

Toutes les personnes déjà inscrites à la conférence initialement prévue en mars, sont automatiquement inscrites à la conférence reportée les 23-24 septembre 2020. Il n’y a aucune manipulation à faire, votre inscription est transférée directement que ce soit à la conférence ou aux formations.

Nous souhaitons remercier les speakers et les sponsors de l'événement qui se sont mobilisés pour participer à la conférence reportée en septembre, merci pour votre soutien. Nous souhaitons enfin remercier les participants déjà inscrits pour leur patience et leur compréhension, merci également pour votre soutien.

Si vous n’êtes pas encore inscrit à l’événement, vous pouvez prendre votre billet sur le site de la conférence ! Nous sommes ravis d'organiser la 12e édition de la conférence SymfonyLive Paris et de retrouver dans quelques mois la communauté francophone de Symfony.

Au vu de la situation exceptionnelle, nous comptons sur votre compréhension et votre présence lors du SymfonyLive Paris 2020. Si vous avez la moindre question, vous pouvez nous contacter via le support. Nous avons hâte de vous retrouver !


Sponsor the Symfony project.

New in Symfony 5.1: Different hosts per locale

$
0
0
Olivier Dolbeau

Contributed by
Olivier Dolbeau
in #36187.

Symfony 4.1 added internationalized routing to allow defining different URLs per locale. In Symfony 5.1 we've improved this feature to also allowdifferent hosts per locale.

In practice, this change means that you can now define an array of values for the host option. This works both in routes config and when importing groups of routes. For example, this would define different hosts for English and French locales in all routes defined as controller annotations:

1
2
3
4
5
6
7
# config/routes/annotations.yamlcontrollers:resource:'../../src/Controller/'type:annotationhost:fr:www.example.fren:www.example.com

Individual routes can define their own localized host too (and it overrides any other host config set while importing the routes). Lastly, something to keep in mind is that when using localized hosts, if a route uses a locale without a host defined for it, you'll see an exception (there is no defaulthost value).


Sponsor the Symfony project.

New in Symfony 5.1: Simpler service decoration

$
0
0
Nicolas Grekas

Contributed by
Nicolas Grekas
in #36389.

Service decoration is used in Symfony applications to change the behavior of some service without replacing it entirely. To do that, you need to inject the original service as an argument of the new decorating service. The problem is that the original service no longer exists, so you can't use its original ID.

In previous Symfony versions you needed to use the syntax decorating service ID + .inner to refer to that service. This quickly becomes cumbersome in YAML/XML when using PHP classes as service IDs. That's why in Symfony 5.1 we've simplified this feature to always use .inner to refer to the original service:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# config/services.yamlservices:App\Mailer:~# BeforeApp\SpecialMailer:decorates:App\Mailerarguments:['@App\SpecialMailer.inner']# AfterApp\SpecialMailer:decorates:App\Mailerarguments:['@.inner']

Sponsor the Symfony project.

SymfonyLive Online conference replay

$
0
0

SymfonyLive Online Conference Logo

About 900 people attended the second edition of the SymfonyLive Online conference on April 17th 2020. What a success! We’re super pleased of the Symfony community interest in this new conference format. The replay of the conference is available until Friday April 24th 2020. If you missed the live conference, watch the replay now. Register at 9.99€ VAT excluded, per person and enjoy the online conference replay.

Here is the conference agenda:

  • The Symfony Notifier Component (40 min) by Fabien Potencier, project lead of Symfony, founder/CEO of Blackfire and Symfony SAS. Symfony 5.0 introduced a new Notifier Component. It is based on the work done previously in the Mailer, HttpClient, and Messenger component and leverages their features. Learn more about how to use it in your own applications.
  • Preloading and Symfony, a love story (40 min) by Nicolas Grekas, core contributor of Symfony, principal engineer for Symfony SAS. PHP preload is a hot topic these days, yet the first versions of PHP 7.4 crashed when it was enabled. Since September with the first experiments (and crash reports), Nicolas is tracking the beast: PHP 7.4.4 finally makes it usable in all contexts and he has been measuring it on a "Hello World" app. Can you expect the same benefits on your apps? Preloading comes with its own challenges. Let's review them and figure how you can get the most out of it for the benefit of your server's efficiency and response time.

Learn the latest about Symfony with our Symfony experts from home! Whether you can attend the international SymfonyCon or any local SymfonyLive conferences, these online gatherings might be the best opportunity to enhance your Symfony experience and support Symfony!

Happy watching and stay safe!


Sponsor the Symfony project.

Last days of early bird registration for SymfonyCon Disneyland Paris 2020

$
0
0

SymfonyCon Disneyland Paris 2020 Conference Logo

Join us next December from 1st to 5th for the international Symfony conference in Disneyland® Paris! The early bird registration is open until Monday, April 27th 2020 midnight, Paris time. Book your ticket to attend the annual Symfony reunion. SymfonyCon Disneyland Paris is the best way to develop your Symfony knowledge, learn the latest about the framework and meet the fantastic Symfony community.

Here is the event agenda:

  • Two-day workshop: Tuesday, December 1st and Wednesday, December 2nd
  • Two-day conference: Thursday, December 3rd and Friday, December 4th
  • One hackday: Saturday, December 5th

Register now for the conference at 399€ VAT excluded and for the workshops and conference at 951€ VAT excluded. Save 20% by booking a combo compared to each original price. Enjoy the early bird registration, prices change after April 27th 2020.

What’s included in your conference ticket:

  • Ticket to attend all talks on December 3rd and 4th including a morning coffee break, lunch and afternoon coffee break on both conference days
  • Ticket to attend the special night for Symfony’s 15th birthday at Walt Disney Studios Park on December 3rd! From 8pm to 11:30pm, enjoy the unmissable attractions of Walt Disney Studios Park, only open for us!
  • Free admission to the Hackday on December 5th including food and beverages
  • Official goodies of the conference and our sponsors

What’s included in your combo workshop and conference ticket:

  • Ticket to attend both days of workshops on December 1st and 2nd including a morning coffee break, lunch and afternoon coffee break on both workshop days
  • Ticket to attend both conference days (as detailed above)

If you're planning your trip to come there, discover all you need to know about SymfonyCon Disneyland Paris in our blog post! We've gathered many tips to help you plan your stay.

Call for Papers and Call for Trainers for the conference are open until May 25th 2020. Check out the details and submit your talk and workshop proposals in English now.

Don't miss the conference and Symfony's 15th anniversary official celebration!

See you at SymfonyCon Disneyland Paris 2020 and stay safe!


Sponsor the Symfony project.

New in Symfony 5.1: Abstract service arguments

$
0
0
Islam Israfilov

Contributed by
Islam Israfilov
in #35076.

Sometimes, when defining services in your Symfony applications, there are arguments that can't be added in config files. The reason is that their values can only be calculated at runtime in a compiler pass or bundle extension.

In those cases, it's common to add an empty argument with some comment explaining that the value will be injected later. For example, the second argument of this service is the full list of directories where Twig templates are stored. That list is only available when running the application, because bundles can add their own directories too:

1
2
3
4
5
<serviceid="twig.template_iterator"class="Symfony\Bundle\TwigBundle\TemplateIterator"><argumenttype="service"id="kernel"/><argumenttype="collection"/><!-- Twig paths --><argument>%twig.default_path%</argument></service>

This other service needs the root namespace of the application, something that's better to calculate dynamically when running the application (instead of forcing the user to configure this value manually):

1
2
3
4
<serviceid="maker.generator"class="Symfony\Bundle\MakerBundle\Generator"><argumenttype="service"id="maker.file_manager"/><argument/><!-- root namespace --></service>

In Symfony 5.1 we've improved this config to replace the "empty argument + comment" by proper abstract service arguments. These are arguments whose values can only be calculated at runtime in compiler passes or bundle extensions.

This is how the previous example looks like when using abstract arguments:

1
2
3
4
<serviceid="maker.generator"class="Symfony\Bundle\MakerBundle\Generator"><argumenttype="service"id="maker.file_manager"/><argumenttype="abstract"key="$rootNamespace">defined in MakerPass</argument></service>

The key value defines the argument name in the service constructor and the value enclosed in <argument> ... </argument> is an optional comment about the argument. If you use YAML to define services, use this other syntax based on the !abstract keyword:

1
2
3
4
maker.generator:class:Symfony\Bundle\MakerBundle\Generatorarguments:$rootNamespace:!abstractdefined in MakerPass

If you don't replace the value of the abstract arguments in some compiler pass or bundle extension, you'll see the following error message:

Argument "$rootNamespace" of service "maker.generator" is abstract (defined in MakerPass), did you forget to define it?

Sponsor the Symfony project.

New in Symfony 5.1: Improved Microkernel

$
0
0
Nicolas Grekas

Contributed by
Nicolas Grekas
in #34881.

Symfony can be used as a microframework since Symfony 2.8. In fact, you can create fully working Symfony applications in a single file thanks to theMicroKernelTrait.

In Symfony 5.1 we've improved MicroKernelTrait to allow using the Kernel as a registry of autowired controllers and service factories. This example shows a single-file Symfony application that defines a service which is autowired in the controller defined in the same file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// index.phpuseSymfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;useSymfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;useSymfony\Component\HttpFoundation\Request;useSymfony\Component\HttpFoundation\Response;useSymfony\Component\HttpKernel\Kernel;useSymfony\Component\Routing\Loader\Configurator\RoutingConfigurator;require__DIR__.'/vendor/autoload.php';classMySymfonyAppextendsKernel{useMicroKernelTrait;protectedfunctionconfigureContainer(ContainerConfigurator$container):void{$container->services()->load('App\\','../src')->set(Foo::class)->factory([$this,'createFoo']);}publicfunctioncreateFoo(Bar$bar){returnnewFoo($bar);}protectedfunctionconfigureRoutes(RoutingConfigurator$routes):void{$routes->add('home','/')->controller([$this,'helloAction']);}publicfunctionhelloAction(Foo$foo){returnnewResponse('Hello '.get_class($foo));}}$app=newMySymfonyApp('dev',true);$request=Request::createFromGlobals();$response=$app->handle($request);$response->send();$app->terminate($request,$response);

Sponsor the Symfony project.

Call for Papers and Early Bird registration deadlines for all upcoming Symfony conferences

$
0
0

Every year, we’re organizing several conferences in different countries about Symfony and its ecosystem. Our main objective is to enable the Symfony community to meet in real and share their experience with the framework. This year, due to the Coronavirus situation, we’ve postponed 2 conferences to the second semester of 2020. Here is the entire agenda of the upcoming SymfonyTour 2020:

Join us at one of these conferences! If you can't make it, join us from home at one of our Online conference. The last one was last week, on Friday, April 17th 2020 and the replay is available until tonight midnight, Paris time. You can still register to watch it.

Attending one of our conferences is the best way to meet the community, learn the latest about the framework with our experts and support Symfony!

Don't miss the SymfonyTour 2020 and stay safe!


Sponsor the Symfony project.

A Week of Symfony #695 (20-26 April 2020)

$
0
0

This week, Symfony added support for different hosts per locale in routes, introduced a new syntax to stack decorators and improved security to make authenticators first-class security. Meanwhile, SymfonyLive Paris 2020 announced its new dates and several Symfony conferences announced their Call for Papers and Early Bird registration deadlines.

Symfony development highlights

This week, 47 pull requests were merged (36 in code and 11 in docs) and 37 issues were closed (33 in code and 4 in docs). Excluding merges, 26 authors made 7,658 additions and 1,032 deletions. See details for code and docs.

3.4 changelog:

  • 6642f09: [FrameworkBundle] fix session.attribute_bag service definition
  • 08ded7f: [Security] fixed escape for username in LdapBindAuthenticationProvider
  • ea69f77: [Form] apply automatically step=1 for datetime-local input
  • 259f523: [Cache] skip APCu in chains when the backend is disabled
  • 719bb15: [PhpUnitBridge] fixed compatibility with phpunit 9
  • fe5eacd: [Yaml] escaped DEL character
  • e3dc5ef: [PhpUnitBridge] use COMPOSER_BINARY env var if available

4.4 changelog:

  • 2a92dd3: [Routing] remove unused properties from the Route annotation
  • 60245d9: [Routing] add the _locale requirement
  • 119ba3b: [DependencyInjection] support late aliases in ServiceSubscriber
  • 2d7b0b8: [FrameworkBundle] fixed wrong display in debug:autowiring when using class_alias

5.0 changelog:

  • 22f1076: [Profiler] fix profiler nullable string type
  • a2f0bf8: [FrameworkBundle] removed getContainer overwrites in tests

Master changelog:

  • e464954: [Routing] added support for different hosts per locale
  • 1abdcbb: [Security] introduced an AuthenticatorManager to make authenticators first-class security
  • 4cc6055: [Notifier] added Free Mobile notifier
  • 2235be0: [Notifier] throw an exception when the Slack DSN is not valid
  • 6b682bf: [Security] fixed missing nullable in CsrfTokenBadge
  • 418c847: [OptionsResolver] removed not needed BC layer
  • f2f82d1: [Mailer] don't dispatch MessageEvent twice
  • 83b37e8: [Messenger] improved SQS interoperability
  • 87c9ab4: use is_file() instead of file_exists() where possible
  • ac3bd14: [DependencyInjection] skip preloading dependencies of non-preloaded services
  • 260dea0: [String] added locale-sensitive map for slugging symbols
  • 734a006: [Serializer] added an @ignore annotation
  • 9d763e0: [DependencyInjection] fixed definition and usage of AbstractArgument
  • d6b9011: [DependencyInjection] added syntax to stack decorators
  • 69452b2: [DependencyInjection] fixed lazy factory code generation
  • 6b48511: [Security] integrated Guards with the Authenticator system

Symfony CLI

Symfony CLI is a must-have tool when developing Symfony applications on your local machine. It includes theSymfony Local Server, the best way to run local Symfony applications. This week Symfony CLI released its new 4.14.2 version with the following changes:

  • Add proxy:status and tweak the output of server:list
  • Support the extra_files option in init templates
  • Fix default sender for cron emails always include environment ID
  • Fix book:checkout on Windows (PHPUnit command was wrong)
  • Improve the output of symfony server:status
  • Improve the output of symfony server:start
  • Remove duplicate entries in symfony local:php:list
  • Add missing yarn check in book:check

Newest issues and pull requests

They talked about us

Call to Action


Sponsor the Symfony project.

New in Symfony 5.1: Stack decorators

$
0
0
Nicolas Grekas

Contributed by
Nicolas Grekas
in #36373.

Middleware is computer software that separates two or more APIs and provides services such as rate-limiting, authentication, and logging. In Symfony you can achieve something like that using service decoration.

However, when decorating multiple services, the config is verbose and it's cumbersome to change the decoration order:

1
2
3
4
5
6
7
8
9
services:App\Mailer\Mailer:~App\Mailer\RateLimitedMailer:decorates:App\Mailer\Mailerarguments:[20]# mails per secondApp\Mailer\LoggingMailer:decorates:App\Mailer\RateLimitedMailer

That's why in Symfony 5.1 we've introduced a new syntax to chain several decorators using a new concept called "stack". This is the equivalent config of the previous example:

1
2
3
4
5
6
7
services:mailer:stack:-App\Mailer\Mailer:~-App\Mailer\RateLimitedMailer:arguments:[20]-App\Mailer\LoggingMailer:~

This new syntax (which is also available when using XML and PHP formats) makes it trivial to add/remove/reorder the decorated services. The main advantage of"stacks" over classic middleware is that middleware defines a domain-specific interface that each processing step must implement to be stackable.


Sponsor the Symfony project.

Early bird registration for SymfonyCon Disneyland Paris 2020 ends today

$
0
0

SymfonyCon Disneyland Paris 2020 Conference Logo

We invite the Symfony community to take part in our offline events organized at the end of the year. As announced last week, we have several deadlines coming today!

It's the very last day today April 27th 2020 to register at early bird rate for the international Symfony conference, SymfonyCon Disneyland Paris 2020. The conference will be organized in the magical venue of Disneyland® Paris. Here is the entire agenda from December 1st to December 5th:

  • Two-day workshop: Tuesday, December 1st and Wednesday, December 2nd
  • Two-day conference: Thursday, December 3rd and Friday, December 4th
  • One hackday: Saturday, December 5th

During the two-day conference, expect 3 tracks with about 30 speakers! Learn all about Symfony latest news, its ecosystem and PHP tools related to Symfony. The entire event will be organized in English. At the end of this year, Symfony will turn 15, join us to celebrate Symfony's 15th anniversary at the international conference!

Call for Papers and Call for Trainers for SymfonyCon Disneyland Paris 2020 end on May 25th 2020, submit your talk and workshop proposal by then.

Don't miss the SymfonyCon Disneyland Paris 2020, enjoy our last day of early bird registration to get your conference ticket or combo workshop and conference ticket! Register now!

Today is also the deadline to:

Register now to one of our Symfony conference or send in your talk or workshop proposals. Enjoy our special prices with our early bird rates, available until tonight, April 27th 2020 midnight (Paris time) for both SymfonyCon Disneyland Paris 2020 and SymfonyLive Berlin 2020.

We can't wait to meet you there, in the meantime stay safe!


Sponsor the Symfony project.

New in Symfony 5.1: New and Improved Integrations

$
0
0

Symfony components provide integration with other technologies (Redis, Doctrine, Sodium, etc.) and third-party services (Google, Mailgun, Slack, etc.) In Symfony 5.1 we've updated several components to add and improve integrations.

Lock component

  • Added MongoDbStore to use MongoDB servers >=2.2 to store the locks (implemented by Joe Bennett in #31889).

Cache component

  • The ArrayCache store added support for LRU (Least Recently Used) and max-lifetime features (implemented by Nicolas Grekas in #35362);
  • Added a new SodiumMarshaller to allow encrypting cache values using libsodium (implemented by Ahmed Tailouloute in #35019);
  • Added a new adapter to use a Couchbase NoSQL database as the cache store (implemented by Antonio José Cerezo in #32039).

Mailer component

  • Improved Mailgun integration to support more custom headers (implemented by Tobias Nyholm in #36148).

Messenger component

Notifier component


Sponsor the Symfony project.

Symfony 3.4.40 released

$
0
0

Symfony 3.4.40 has just been released. Here is a list of the most important changes:

  • bug #36566 [PhpUnitBridge] Use COMPOSE _BINARY env var if available (@fancyweb)
  • bug #36560 [YAML] escape DEL(x7f) (@sdkawata)
  • bug #36539 [PhpUnitBridge] fix compatibility with phpunit 9 (@garak)
  • bug #36555 [Cache] skip APCu in chains when the backend is disabled (@nicolas-grekas)
  • bug #36523 [Form] apply automatically step=1 for datetime-local input (@ottaviano)
  • bug #36498 [Security/Core] fix escape for username in LdapBindAuthenticationProvider.php (@stoccc)
  • bug #36506 [FrameworkBundle] Fix session.attribut _bag service definition (@fancyweb)
  • bug #36490 [HttpFoundation] workaround PHP bug in the session module (@nicolas-grekas)
  • bug #36483 [SecurityBundle] fix accepting env vars in remember-me configurations (@zek)
  • bug #36343 [Form] Fixed handling groups sequence validation (@HeahDude)
  • bug #36460 [Cache] Avoid memory leak in TraceableAdapter::reset() (@lyrixx)
  • bug #36411 [Form] RepeatedType should always have inner types mapped (@biozshock)
  • bug #36441 [DI] fix loading defaults when using the PHP-DSL (@nicolas-grekas)
  • bug #36434 [HttpKernel] silence _NOTICE triggered since PHP 7.4 (@xabbuh)
  • bug #36365 [Validator] Fixed default group for nested composite constraints (@HeahDude)
  • bug #35591 [Validator] do not merge constraints within interfaces (@greedyivan)
  • bug #36375 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (@lyrixx)
  • bug #36305 [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular (@fancyweb)
  • bug #35656 [HttpFoundation] Fixed session migration with custom cookie lifetime (@Guite)
  • bug #36315 [WebProfilerBundle] Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler (@ampaze)
  • bug #36286 [Validator] Allow URL-encoded special characters in basic auth part of URLs (@cweiske)
  • bug #36332 [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key (@alanpoulain)
  • bug #36239 [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing (@fancyweb)
  • bug #36245 [Validator] Fixed calling getters before resolving groups (@HeahDude)
  • bug #36252 [Security/Http] Allow setting cookie security settings for delet _cookies (@wouterj)
  • bug #36261 [FrameworkBundle] revert to legacy wiring of the session when circular refs are detected (@nicolas-grekas)

Want to upgrade to this new release? Because Symfony protects backwards-compatibility very closely, this should be quite easy. UseSymfonyInsight upgrade reports to detect the code you will need to change in your project andread our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Sponsor the Symfony project.

Symfony 4.4.8 released

$
0
0

Symfony 4.4.8 has just been released. Here is a list of the most important changes:

  • bug #36536 [Cache] Allow invalidateTags calls to be traced by data collector (@l-vo)
  • bug #36566 [PhpUnitBridge] Use COMPOSE _BINARY env var if available (@fancyweb)
  • bug #36560 [YAML] escape DEL(x7f) (@sdkawata)
  • bug #36539 [PhpUnitBridge] fix compatibility with phpunit 9 (@garak)
  • bug #36555 [Cache] skip APCu in chains when the backend is disabled (@nicolas-grekas)
  • bug #36523 [Form] apply automatically step=1 for datetime-local input (@ottaviano)
  • bug #36519 [FrameworkBundle] debug:autowiring: Fix wrong display when using clas _alias (@weaverryan)
  • bug #36454 [DependencyInjection][ServiceSubscriber] Support late aliases (@fancyweb)
  • bug #36498 [Security/Core] fix escape for username in LdapBindAuthenticationProvider.php (@stoccc)
  • bug #36506 [FrameworkBundle] Fix session.attribut _bag service definition (@fancyweb)
  • bug #36500 [Routing][PrefixTrait] Add the _locale requirement (@fancyweb)
  • bug #36457 [Cache] CacheItem with tag is never a hit after expired (@alexander-schranz, @nicolas-grekas)
  • bug #36490 [HttpFoundation] workaround PHP bug in the session module (@nicolas-grekas)
  • bug #36483 [SecurityBundle] fix accepting env vars in remember-me configurations (@zek)
  • bug #36343 [Form] Fixed handling groups sequence validation (@HeahDude)
  • bug #36460 [Cache] Avoid memory leak in TraceableAdapter::reset() (@lyrixx)
  • bug #36467 Mailer from sender fixes (@fabpot)
  • bug #36408 [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions (@soyuka)
  • bug #36447 Remove return type for Twig function workflo _metadata() (@gisostallenberg)
  • bug #36449 [Messenger] Make sure redis transports are initialized correctly (@Seldaek)
  • bug #36411 [Form] RepeatedType should always have inner types mapped (@biozshock)
  • bug #36441 [DI] fix loading defaults when using the PHP-DSL (@nicolas-grekas)
  • bug #36434 [HttpKernel] silence _NOTICE triggered since PHP 7.4 (@xabbuh)
  • bug #36365 [Validator] Fixed default group for nested composite constraints (@HeahDude)
  • bug #36422 [HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only (@nicolas-grekas)
  • bug #36417 Force ping after transport exception (@oesteve)
  • bug #35591 [Validator] do not merge constraints within interfaces (@greedyivan)
  • bug #36377 [HttpClient] Fix scoped client without query option configuration (@X-Coder264)
  • bug #36387 [DI] fix detecting short service syntax in yaml (@nicolas-grekas)
  • bug #36392 [DI] add missing property declarations in InlineServiceConfigurator (@nicolas-grekas)
  • bug #36400 Allowing empty secrets to be set (@weaverryan)
  • bug #36380 [Process] Fixed input/output error on PHP 7.4 (@mbardelmeijer)
  • bug #36376 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (@lyrixx)
  • bug #36375 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (@lyrixx)
  • bug #36305 [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular (@fancyweb)
  • bug #35656 [HttpFoundation] Fixed session migration with custom cookie lifetime (@Guite)
  • bug #36342 [HttpKernel][FrameworkBundle] fix compat with Debug component (@nicolas-grekas)
  • bug #36315 [WebProfilerBundle] Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler (@ampaze)
  • bug #36286 [Validator] Allow URL-encoded special characters in basic auth part of URLs (@cweiske)
  • bug #36335 [Security] Track session usage whenever a new token is set (@wouterj)
  • bug #36332 [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key (@alanpoulain)
  • bug #36337 [MonologBridge] Fix $level type (@fancyweb)
  • bug #36223 [Security][Http][SwitchUserListener] Ignore all non existent username protection errors (@fancyweb)
  • bug #36239 [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing (@fancyweb)
  • bug #36245 [Validator] Fixed calling getters before resolving groups (@HeahDude)
  • bug #36265 Fix the reporting of deprecations in twig:lint (@stof)
  • bug #36283 [Security] forward multiple attributes voting flag (@xabbuh)

Want to upgrade to this new release? Because Symfony protects backwards-compatibility very closely, this should be quite easy. UseSymfonyInsight upgrade reports to detect the code you will need to change in your project andread our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Sponsor the Symfony project.

Symfony 5.0.8 released

$
0
0

Symfony 5.0.8 has just been released. Here is a list of the most important changes:

  • bug #36536 [Cache] Allow invalidateTags calls to be traced by data collector (@l-vo)
  • bug #36566 [PhpUnitBridge] Use COMPOSE _BINARY env var if available (@fancyweb)
  • bug #36560 [YAML] escape DEL(x7f) (@sdkawata)
  • bug #36539 [PhpUnitBridge] fix compatibility with phpunit 9 (@garak)
  • bug #36555 [Cache] skip APCu in chains when the backend is disabled (@nicolas-grekas)
  • bug #36523 [Form] apply automatically step=1 for datetime-local input (@ottaviano)
  • bug #36519 [FrameworkBundle] debug:autowiring: Fix wrong display when using clas _alias (@weaverryan)
  • bug #36454 [DependencyInjection][ServiceSubscriber] Support late aliases (@fancyweb)
  • bug #36162 [Profiler] Fix profiler nullable string type (@mRoca)
  • bug #36498 [Security/Core] fix escape for username in LdapBindAuthenticationProvider.php (@stoccc)
  • bug #36506 [FrameworkBundle] Fix session.attribut _bag service definition (@fancyweb)
  • bug #36500 [Routing][PrefixTrait] Add the _locale requirement (@fancyweb)
  • bug #36457 [Cache] CacheItem with tag is never a hit after expired (@alexander-schranz, @nicolas-grekas)
  • bug #36490 [HttpFoundation] workaround PHP bug in the session module (@nicolas-grekas)
  • bug #36483 [SecurityBundle] fix accepting env vars in remember-me configurations (@zek)
  • bug #36343 [Form] Fixed handling groups sequence validation (@HeahDude)
  • bug #36463 [Mime] Ensure proper line-ending for SMIME (@sstok)
  • bug #36460 [Cache] Avoid memory leak in TraceableAdapter::reset() (@lyrixx)
  • bug #36467 Mailer from sender fixes (@fabpot)
  • bug #36408 [PhpUnitBridge] add PolyfillTestCaseTrait::expectExceptionMessageMatches to provide FC with recent phpunit versions (@soyuka)
  • bug #36447 Remove return type for Twig function workflo _metadata() (@gisostallenberg)
  • bug #36449 [Messenger] Make sure redis transports are initialized correctly (@Seldaek)
  • bug #36411 [Form] RepeatedType should always have inner types mapped (@biozshock)
  • bug #36441 [DI] fix loading defaults when using the PHP-DSL (@nicolas-grekas)
  • bug #36434 [HttpKernel] silence _NOTICE triggered since PHP 7.4 (@xabbuh)
  • bug #36365 [Validator] Fixed default group for nested composite constraints (@HeahDude)
  • bug #36422 [HttpClient] fix HTTP/2 support on non-SSL connections - CurlHttpClient only (@nicolas-grekas)
  • bug #36417 Force ping after transport exception (@oesteve)
  • bug #35591 [Validator] do not merge constraints within interfaces (@greedyivan)
  • bug #36377 [HttpClient] Fix scoped client without query option configuration (@X-Coder264)
  • bug #36387 [DI] fix detecting short service syntax in yaml (@nicolas-grekas)
  • bug #36392 [DI] add missing property declarations in InlineServiceConfigurator (@nicolas-grekas)
  • bug #36400 Allowing empty secrets to be set (@weaverryan)
  • bug #36380 [Process] Fixed input/output error on PHP 7.4 (@mbardelmeijer)
  • bug #36376 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (@lyrixx)
  • bug #36375 [Workflow] Use a strict comparison when retrieving raw marking in MarkingStore (@lyrixx)
  • bug #36305 [PropertyInfo][ReflectionExtractor] Check the array mutator prefixes last when the property is singular (@fancyweb)
  • bug #35656 [HttpFoundation] Fixed session migration with custom cookie lifetime (@Guite)
  • bug #36342 [HttpKernel][FrameworkBundle] fix compat with Debug component (@nicolas-grekas)
  • bug #36315 [WebProfilerBundle] Support for Content Security Policy style-src-elem and script-src-elem in WebProfiler (@ampaze)
  • bug #36286 [Validator] Allow URL-encoded special characters in basic auth part of URLs (@cweiske)
  • bug #36335 [Security] Track session usage whenever a new token is set (@wouterj)
  • bug #36332 [Serializer] Fix unitialized properties (from PHP 7.4.2) when serializing context for the cache key (@alanpoulain)
  • bug #36338 [MonologBridge] Fix $level type (@fancyweb)
  • bug #36337 [MonologBridge] Fix $level type (@fancyweb)
  • bug #36223 [Security][Http][SwitchUserListener] Ignore all non existent username protection errors (@fancyweb)
  • bug #36239 [HttpKernel][LoggerDataCollector] Prevent keys collisions in the sanitized logs processing (@fancyweb)
  • bug #36245 [Validator] Fixed calling getters before resolving groups (@HeahDude)
  • bug #36265 Fix the reporting of deprecations in twig:lint (@stof)
  • bug #36283 [Security] forward multiple attributes voting flag (@xabbuh)

Want to upgrade to this new release? Because Symfony protects backwards-compatibility very closely, this should be quite easy. UseSymfonyInsight upgrade reports to detect the code you will need to change in your project andread our upgrade documentation to learn more.

Want to be notified whenever a new Symfony release is published? Or when a version is not maintained anymore? Or only when a security issue is fixed? Consider subscribing to the Symfony Roadmap Notifications.


Sponsor the Symfony project.

New in Symfony 5.1: URI Resolver

$
0
0
Grégoire Pineau

Contributed by
Grégoire Pineau
in #35415 and #35667.

The DomCrawler component eases DOM navigation for HTML and XML documents. Most developers use it in the functional tests of their Symfony applications, but you can use it to build a real crawler.

A common need when building a crawler is to turn the links of the HTML contents, which are usually relative, into absolute URLs, to keep crawling the entire site. For example, if the site URL is https://example.com/foo and the link URL is../bar?foo=1, the absolute URL is https://example.com/bar?foo=1.

This transformation is much more complex than it looks because you have to deal with anchors, query string parameters and all kinds of sub paths. The DomCrawler component already contained the logic to resolve these URLs, but in Symfony 5.1 we've extracted it into a new UriResolver class so you can reuse the logic in your applications:

1
2
3
4
useSymfony\Component\DomCrawler\UriResolver;$absoluteUrl=UriResolver::resolve('../bar?foo=1','https://example.com/foo');// $absoluteUrl = 'https://example.com/bar?foo=1'

Sponsor the Symfony project.
Viewing all 3134 articles
Browse latest View live