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

Symfony 4.4.13 released

$
0
0

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

  • security #cve-2020-15094 Remove headers with internal meaning from HttpClient responses (@mpdude)
  • bug #38024 [Console] Fix undefined index for inconsistent command name definition (@chalasr)
  • bug #38023 [DI] fix inlining of non-shared services (@nicolas-grekas)
  • bug #38020 [PhpUnitBridge] swallow deprecations (@xabbuh)
  • bug #38010 [Cache] Psr16Cache does not handle Proxy cache items (@alex-dev)
  • bug #37937 [Serializer] fixed fix encoding of cache keys with anonymous classes (@michaelzangerle)

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.1.5 released

$
0
0

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

  • security #cve-2020-15094 Remove headers with internal meaning from HttpClient responses (@mpdude)
  • bug #38024 [Console] Fix undefined index for inconsistent command name definition (@chalasr)
  • bug #38023 [DI] fix inlining of non-shared services (@nicolas-grekas)
  • bug #38022 Missed AbstractArgument (@a-menshchikov)
  • bug #38020 [PhpUnitBridge] swallow deprecations (@xabbuh)
  • bug #37961 [Mailer] Fixed ‘verif _peer’ option in mailer DSN being ignored (@SnakePin)
  • bug #38010 [Cache] Psr16Cache does not handle Proxy cache items (@alex-dev)
  • bug #37937 [Serializer] fixed fix encoding of cache keys with anonymous classes (@michaelzangerle)
  • bug #38002 [Validator] Fix PhpUnitBridge version constraint (@derrabus)
  • bug #38001 Fix symfony/amazon-mailer constraint (@Michał Jusięga)

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.

Rendez-vous at the end of this month for SymfonyLive Paris 2020

$
0
0

The French SymfonyLive conference will take place on September 23-24 2020. Initially scheduled on March 26-27 2020, the event has been postponed to September due to the Covid-19 situation and the global lockdown. We’re pleased to welcome all the attendees of the conference thanks to all the security measures we’ve taken to organize a safe event. This year, the event will welcome a maximum of 500 attendees to organize an event of quality with a maximum of safety. As the conference is organized in French, the following blog post will be written in French.


Nous sommes ravis de vous donner rendez-vous au SymfonyLive Paris 2020 les 23 et 24 septembre. Initialement programmée les 26 et 27 mars 2020, la conférence a été reportée suite à la crise sanitaire du Covid-19 et au confinement national qui a été instauré. Votre inscription au SymfonyLive Paris 2020 a été automatiquement reportée à la conférence de septembre.

Nous vous confirmons (sauf décision gouvernementale de dernière minute) que la conférence est bien maintenue et que nous avons pris toutes les dispositions nécessaires pour son bon déroulement en adéquation avec les normes sanitaires actuelles. Nous avons longuement hésité mais nous avons pris la décision de maintenir l’événement. En effet, concernant la logistique tout était prêt avant le confinement, il ne nous manquait que l'autorisation du gouvernement permettant l'organisation des événements qui est entré en vigueur fin août. Il nous semble important de permettre à la communauté de se retrouver puisque toutes les conditions nous permettent d’organiser sereinement la conférence. Nous avons, par contre, pris la décision de limiter la capacité d’accueil de la conférence à 500 participants pour qu’elle ait lieu dans les meilleures conditions possibles. Voici ci-dessous, en toute transparence, la liste des mesures que nous prenons pour garantir la sécurité de tous durant l’événement.

Tout d’abord, le port du masque sera obligatoire durant tout l’événement. Chaque participant est invité à se munir d’un masque pour accéder à la Cité Internationale de Paris et à la conférence, sans quoi l’accès à l’événement vous sera refusé. Le port du masque étant obligatoire dans Paris, il en est de même pour tout l'événement. Ensuite, du gel hydroalcoolique sera à disposition dans toutes les salles de l’événement pour que chacun puisse se désinfecter les mains très régulièrement. Les règles de distanciation sociale seront respectées puisqu’un siège sur deux sera disponible dans l’amphithéâtre pour vous asseoir durant les conférences. Des sièges supplémentaires seront mis en place dans les galeries de l’amphithéâtre afin d’accueillir tous les participants dans la même salle. Avec les normes de distanciation sociale, nous avons dû repenser intégralement la disposition de l’amphithéâtre et nous ne pouvons malheureusement pas accueillir autant de participants que lors des éditions précédentes. C’est pourquoi la conférence est désormais Sold Out. Un sens de circulation sera mis en place pour respecter les distances de sécurité et fluidifier les entrées et sorties. En ce qui concerne les pauses cafés et les pauses déjeuners, il n’y aura pas de buffet mais des portions individuelles et des lunch box. Les repas devant être obligatoirement pris assis, nous vous demanderons de vous rendre soit dans la salle de conférence soit dans les salles de déjeuner pour manger. Il ne sera pas possible de manger debout à aucun moment. Par conséquent, nous avons décidé d’annuler le petit-déjeuner de bienvenue et l’apéritif communautaire qui ne nous semblaient pas possible de maintenir dans de bonnes conditions avec le contexte actuel. Enfin, le vestiaire sera uniquement ouvert pour y déposer vos casques si vous venez en moto ou scooter. Le vestiaire ne sera pas disponible pour y déposer vos vêtements ou sacs.

Une équipe de nettoyage interviendra régulièrement pour désinfecter les salles, les fenêtres seront ouvertes à la fin de chaque conférence et durant les pauses. Les micro des speakers seront équipés de housse de protection à usage unique. Le pupitre sera nettoyé après chaque conférence.

A partir de cette année, il n’y aura plus de retrait des badges puisqu’ils seront téléchargeables en PDF depuis le site SymfonyLive Paris 2020. Ils seront disponibles en téléchargement une semaine avant l’événement, vous n’aurez plus qu’à les imprimer pour accéder à la conférence. Des porte-badges et des lanyards seront à votre disposition pour que vous puissiez porter votre badge et qu’il soit visible en toutes circonstances. Les stands de nos sponsors seront accessibles mais nous vous demanderons de respecter les distances de sécurité et de vous y rendre par petits groupes. Afin de fluidifier les arrivées à la conférence, les portes de l’événement seront ouvertes dès 8h, la conférence commence à 9h. Découvrez le programme complet de l'événement.

Nos équipes seront présentes pour vérifier que tout le monde porte son masque et que les règles de distanciation sont bien respectées. Afin d’offrir un événement de qualité à tous dans un cadre convivial malgré la crise sanitaire que nous traversons, nous vous invitons à respecter toutes ces mesures. Nous avons décidé de maintenir la conférence car les événements physiques restent malgré tout une expérience extraordinaire pleine de rencontres, de partage et parce qu’après le confinement que nous avons tous vécu, il est important de se retrouver en dehors du virtuel ! Nous avons pris toutes les mesures pour ne prendre aucun risque pendant la conférence mais nous avons besoin de vous pour faire de cet événement une réussite. Nous avons hâte de vous retrouver ! Si vous avez la moindre question, n’hésitez pas à nous contacter via le support.

A très vite !


Sponsor the Symfony project.

PHP preloading and Symfony

$
0
0
Blackfire callgraph of the benefit of using PHP preloading

PHP 7.4 added support for preloading. To make a long story short, it gives you extra performance for free. Symfony 4.4 made it easy to benefit from this feature in your projects.

You might wonder how easy it is to benefit from it? It is actually surprisingly easy. When Symfony builds its cache, it automatically creates a file to help PHP preload some PHP files. To enable preloading, you must tell PHP where this file is stored in its php.ini configuration file:

1
2
3
4
5
# on Symfony 5.1+opcache.preload=/app/var/cache/prod/App_KernelProdContainer.preload.php# for Symfony 4.4opcache.preload=/app/var/cache/prod/srcApp_KernelProdContainer.preload.php

That’s it!

I’ve done it on all the websites I manage for my Open-Source projects. Here is the boost on the twig.symfony.com homepage:

On more complex websites, with database accesses, the percentage is going to be less dramatic, but still interesting.

OnSymfonyCloud, the default php.ini template now contains this configuration, so uncomment the right line depending on your Symfony version and enjoy a nice and free performance boost!


Sponsor the Symfony project.

The Symfony 5 book, The Fast Track, now available online for all languages

$
0
0
The Fast Track Cover

As of today, my Symfony 5 book, The Fast Track, is available for everyone to read for free in 14 languages.

The book was already available online for free for 11 languages. This update adds Japanese and popular languages like English and French.

Read the book now (alpha order):

This book would never have been possible without the help I got from sponsors, backers, reviewers, translators, and people who bought the book. Thank you all!

You can still help fund the project by buying the PDF version of the book in any of the 14 available languages or the printed version for English or French. The PDF and printed versions are kept up-to-date with the latest fixes.

Enjoy the read!


Sponsor the Symfony project.

Some seats left for the pre-conference workshops at SymfonyLive Paris 2020

$
0
0

The SymfonyLive Paris conference is coming at the end of this month. While the conference is now sold out, there are still a few seats left available to attend the pre-conference workshops. As the conference is organized in French, the following blog post will be written in French.


Nous sommes impatients de vous retrouver à la fin du mois pour l’édition francophone du SymfonyLive Paris 2020. Nous avons récemment annoncé que la conférence est désormais sold out due à la situation sanitaire actuelle, mais il est encore possible de vous inscrire pour participer aux formations pré-conférence du lundi 21 et mardi 22 septembre 2020 et de participer également à la conférence du 23 et 24 septembre 2020.

En tant qu'organisme de formations officiel, votre formation peut être prise en charge par votre OPCA. Retrouvez tous les détails concernant la prise en charge de votre formation et contactez-nous pour préparer votre inscription !

Il nous reste quelques places pour participer aux formations, nous proposons deux formations de 2 journées consécutives et une formation combo composée de 2 journées de formations individuelles. Pour rappel, voici les formations disponibles :

  • Symfony 5: the fast track par Nicolas Grekas - Core-team Symfony (2 jours). Cette formation est issue du livre "Symfony 5: The Fast Track" de Fabien Potencier. Dispensée sur deux jours consécutifs, elle vous apprendra à construire une application Symfony de A à Z en utilisant les nouvelles pratiques et les nouveaux composants disponibles depuis peu. Nous construirons une application dotée de toute l'infrastructure des apps modernes : base de données, serveur de cache applicatif et HTTP, bus de messages pour traitements en tâche de fond, API et SPA, etc. Pour se rapprocher d'un projet réel, le développement s'effectuera sur un double environnement prod/dev basés sur SymfonyCloud/Docker respectivement. Au menu : Flex, Mailer, Notifier, Workflow, Messenger, API Platform, HttpClient, String, Webpack Encore, etc.
  • Maîtriser la POO & les Design Patterns par Titouan Galopin - SymfonyInsight lead (2 jours). La Programmation Orientée Object (POO) va au-delà de la conception de classes et d'interfaces. Elle inclut une grande variété de concepts tels que les objets, les entités, les "value objects", les services, les modèles de conception, les principes SOLID, la calisthenie, le couplage, etc. Cet atelier vous aidera à mieux comprendre tous ces concepts pour écrire un code orienté objet plus maintenable, plus robuste et plus testable. Vous découvrirez également les techniques permettant de réduire la complexité de votre code et de rendre vos classes plus spécifiques et donc plus simples. Vous apprendrez aussi à reconnaître et à exploiter la puissance des modèles de conception (fabrique, adaptateur, composite, décorateur, médiateur, stratégie, etc.).
  • Développement d'API avec API Platform organisée le lundi 21 septembre par Kévin Dunglas, créateur d'API Platform. API Plaftorm est devenu un cadre très populaire pour construire des projets Web avancés et modernes pilotés par API. Après une vue d'ensemble des modèles et formats modernes de l'API (REST, Swagger, Hypermedia, HATEOAS, JSON-LD, Hydra, Schema.org, GraphQL...), nous apprendrons comment utiliser et étendre les fonctionnalités les plus populaires du composant : documentation Swagger, pagination, validation, tri, filtrage, authentification, autorisation, négociation de contenu, génération de modèles de données à l'aide du vocabulaire Schema.org. Enfin, nous découvrirons à quel point il est facile d'utiliser la boîte à outils côté client (JavaScript).
  • Traitements asynchrones avec Symfony Messenger organisée le mardi 22 septembre par Samuel Rozé, créateur du composant. Le composant Messenger de Symfony introduit la notion de “message bus” et de traitement asynchrone de ces messages, via un queue comme RabbitMq, Redis ou bien même via une simple base de données. Dans ce workshop découpé en 8 grand thèmes, vous allez d'abord découvrir (1) comment utiliser Messenger pour découpler vos applications, (2) le système de routage vers des “transports” asynchrones et (3) les notions de “middleware” et de “stamps”, qui vous permettront de comprendre comment fonctionne le coeur du composant et de le personnaliser a vos souhaits. Nous verrons ensuite en détails (4) comment configurer les transports, (5) le système de sérialisation des messages, (6) la gestion des erreurs, (7) les événements du worker Messenger et (8) comment écrire vos propres transports.

L'inscription aux formations inclut les 2 journées de formations, il n'est pas possible de s'inscrire à une journée de formation seulement. En vous inscrivant aux formations, vous serez également inscrit à la conférence ! Les formations auront lieu à Clichy et la conférence à la Cité Internationale Universitaire de Paris.

Mettez à profit votre compte CPF pour participer à nos formations, faites vite votre demande d'inscription !


Sponsor the Symfony project.

A Week of Symfony #714 (31 August - 6 September 2020)

$
0
0

This week, the Symfony 5 book was published for free in all available languages. Meanwhile, the upcoming Symfony 5.2 version updated security to allow configuring the order of firewall listeners and added new Doctrine types for ULID and UUID values.

Symfony development highlights

This week, 74 pull requests were merged (57 in code and 17 in docs) and 53 issues were closed (44 in code and 9 in docs). Excluding merges, 41 authors made 5,340 additions and 1,992 deletions. See details for code and docs.

3.4 changelog:

  • 33cacad: [Console] fixed undefined index for inconsistent command name definition
  • c653f2c: [FrameworkBundle] made AbstractPhpFileCacheWarmer public
  • 9460894: [Debug] parse "x not found" errors correctly on PHP 8
  • 44dc0cd: [Validator] added Bosnian (BS) translation
  • 63eab44: [PhpUnitBridge] adjust output parsing of CoverageListenerTrait for PHPUnit 9.3
  • ee8fc9c: [VarDumper] fixed caster for invalid SplFileInfo objects on PHP 8

4.4 changelog:

  • 93459a9: [Serializer] fixed fix encoding of cache keys with anonymous classes
  • 6bebe86: [Cache] Psr16Cache does not handle Proxy cache items
  • 8ec0e58: [PhpUnitBridge] swallow deprecations
  • 804f194: [DependencyInjection] fixed inlining of non-shared services
  • d9910e0: [HttpClient] removed headers with internal meaning from HttpClient responses
  • f0c4d31: [Ldap] added comment about bind with empty password
  • 52719f2: [PhpunitBridge] fixed deprecation type detection (when several autoload files are used)
  • 067dc2d: [Form] removed invalid instantiation declaration
  • 4482fcf: [PropertyInfo] fixed typed collections in PHP 7.4
  • a19f91a: [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  • da73be8: [Cache] fixed CacheCollectorPass with decorated cache pools
  • 4222a72: [DependencyInjection] fixed generating preload file when cache_dir is outside project_dir

5.1 changelog:

  • 0d99044: [Mailer] fixed 'verify_peer' option in mailer DSN being ignored
  • 3061bfe: stop using the deprecated at() PHPUnit matcher
  • a36c43b: allowed Drupal to wrap the Symfony test listener
  • c98e160: [Messenger] removed DelaySeconds parameter for FIFO queues

Master changelog:

  • 2d21c39: [PropertyAccess] fixed bitwise operations
  • c649bfa: [Translation] skip tests if required class does not exist
  • ccfc4ba: added support for using the "label" placeholder in constraint messages
  • dc63d71: [Form] dispatch submit events for disabled forms too
  • 4753e4d: [Serializer] fixed denormalization of basic property-types in XML and CSV
  • 33cacad: [Console] fixed undefined index for inconsistent command name definition
  • afdb97e: [Security] configurable execution order for firewall listeners
  • e06d339: [Cache] give control over cache prefix seed
  • b094d43: translate failure messages of JSON authentication
  • 174d91c: [DoctrineBridge] added Ulid and Uuid as Doctrine types
  • 05bdfc9: [Messenger] added option to prevent Redis from deleting messages on rejection
  • 4ab612c: [Validator] debug validator command

Newest issues and pull requests

They talked about us

Call to Action


Sponsor the Symfony project.

New in SymfonyInsight: Microsoft Teams analysis results notifications

$
0
0

One of the main goal of SymfonyInsight is to help you maintain high quality in your project over long periods of time. To do so, integrating the information SymfonyInsight gives you in your processes is key.

SymfonyInsight already integrates natively with GitHub and Slack, and has the ability to be used in Bitbucket and GitLab as well using the SDK. You can even use a custom webhook to create a completely custom integration with any tool you would like.

Starting from today, you can also use Microsoft Teams natively on SymfonyInsight by using a few lines of configuration:

1
2
3
4
5
6
7
8
9
notifications:-type:teams# The Teams WebHook URL (see the documentation for more details)url:https://outlook.office.com/webhook/XXXXXXXXXX@XXXXXXXXX/IncomingWebhook/XXXXXXXXXXXXXX# On which event SymfonyInsight should post notificationson_success:true# Notify when an analysis succeededon_failure:true# Notify when an analysis failed or errored

You can read the dedicated documentation to learn more about this new feature.

And as always, if you have any issue, feel free to contact us at the support!

Enjoy!


Sponsor the Symfony project.

New in SymfonyInsight: Composer 2 native support

$
0
0

Composer 2.0 has just reached its first Release Candidate version, making it closer to a first stable release. It has much better performance and memory usage than Composer 1 and improves the way packages are downloaded to lower the time it takes to run commands like composer install or composer update.

Even if Composer 2 is not stable yet, you can already use it in your SymfonyInsight projects.

When running the composer install command during the analysis, we are now using Composer version 1 or version 2 depending on the composer.lock of your project. SymfonyInsight provides Composer binaries for both versions and automatically choose the right version for your project.

Feel free to test Composer 2 in a branch!


Sponsor the Symfony project.

A Week of Symfony #715 (7-13 September 2020)

$
0
0

This week, Symfony development activity was frantic with tens of fixes and new features merged. The upcoming Symfony 5.2 version added support for shared locks, integration of Cache and Messenger components to allow computing cached values in a worker and the introduction of PHP 8 compatible attributes for routes and required attributes.

Symfony development highlights

This week, 116 pull requests were merged (67 in code and 49 in docs) and 66 issues were closed (43 in code and 23 in docs). Excluding merges, 61 authors made 5,269 additions and 638 deletions. See details for code and docs.

3.4 changelog:

  • 0afa250: [Console] made sure $maxAttempts is an int or null
  • 8e34978: [DependencyInjection] fixed ContainerBuilder on PHP8
  • 91b6739: [Yaml] prevented parsing invalid octal digits as octal numbers
  • 68866fb: [Console] guard $argv + $token against null, preventing unnecessary exceptions
  • 1e52146: [Validator] DateTime validator support for trailing data
  • 81b954b: [Intl] promoted warnings to value errors on PHP 8
  • 899d60c: [Validator] updated Serbian (sr_Latn & sr_Cyrl) translations
  • 4b3015f: [Validator] updated Turkish translations

4.4 changelog:

  • d441d86, cfec631, 44dd80f: [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable
  • 12b419e: [ErrorHandler] parse "x not found" errors correctly on PHP 8
  • f8fddf3: [VarExporter] unserialize() might throw an Exception on PHP 8
  • 638f9ec: [DependencyInjection] consistently use same types for strict comparisons
  • 9bb8084: [HttpClient] fixed Array to string conversion notice when parsing JSON error body with non-scalar detail property
  • afd4027: [Cache] fixed key encoding issue in Memcached adapter
  • e8dc35d: [Cache] limit cache version character range
  • 0383e53: [HttpClient] fail properly when the server replies with HTTP/0.9
  • ac18887: [Cache] fixed ProxyAdapter not persisting items with infinite expiration
  • 3825542: [HttpFoundation] skip the cookie_max_age fixture on PHP 8
  • 71e8028: [DoctrineBridge] add choice_translation_domain tests to prevent further regressions

5.1 changelog:

  • 3c5a4ed: [String] ensure that the offset is part of the string
  • f1fd3c0: [Messenger] run postgres setup trigger in transaction
  • b84f3ce: [Mailer] fixed Mailgun API bridge JsonException when API response is not applicaton/json
  • 393e5c4: [Security] allow to not define any authentication listener

Master changelog:

  • d0c915c: [Routing] added the Route attribute
  • b26f11c: [DependencyInjection] added the Required attribute
  • 3ba965a: [MonologBridge] added SwitchUserTokenProcessor to log the impersonator
  • 0ceafbc: [HttpClient] allow to provide additional curl options to CurlHttpClient
  • 38e4140: [Translation] fixed parsing tokens on PHP 8
  • 4c873fe: [Messenger] added the count message awareness on the AmazonSqsMessenger transport
  • f1fd3c0: [Messenger] run postgres setup trigger in transaction
  • e8dc35d: [Cache] limit cache version character range
  • b84f3ce: [Mailer] fixed Mailgun API bridge JsonException when API response is not applicaton/json
  • 474e877: [Lock] fixed wrong interface for MongoDbStore
  • 9cd3e67: [Messenger] added factory methods to DelayStamp for better DX
  • 44dd80f: [DependencyInjection] dumped OS-indepent paths in the compiled container
  • 0aae1b4: [Messenger] don't prevent dispatch out of another bus
  • 7192d29: [Serializer] added UidNormalizer
  • 11b1429: [SecurityBundle] comma separated IPs for security.access_control
  • adedd76: [Cache] added integration with Messenger to allow computing cached values in a worker
  • 9b84bc0: [Messenger] added option to confirm message delivery in Amqp connection
  • d7d479b: [Lock] introduced Shared Lock
  • a32fde9: [HttpKernel, Security] allowed adding attributes on controller arguments that will be passed to argument resolvers

Newest issues and pull requests

They talked about us

Call to Action


Sponsor the Symfony project.

SymfonyInsight, the life jacket for your team

$
0
0

At its core, SymfonyInsight helps you monitor and improve the quality of your projects. It fits nicely in your development processes to find issues, help developers improve their skills and decrease technical debt.

But there is another challenge we can help with by analyzing your code:

How to avoid projects to become business threats for your company?

Business threats are numerous and take many forms. At SymfonyInsight, we are deeply aware of how important monitoring these threats is. This is why we redeveloped a large part of our engine, interface and documentation to address these issues.

SymfonyInsight now shows business risks associated to each project:

SymfonyInsight risks dashboard

We focused our work on 6 categories of risks:

  • Avoid security breaches
  • Prevent lawsuits and GDPR complaints
  • Avoid data leaks and ensure data integrity
  • Avoid downtimes and major bugs
  • Avoid slow productivity and negative growth
  • Ensure technical issues do not have negative repercussions on your brand

All these are ready to be used: have a try!


Sponsor the Symfony project.

First selected speakers at SymfonyWorld 2020 are announced

$
0
0

SymfonyWorld 2020 is our first 100% online event. We've announced over the summer the online conference organization which will take place beginning of December in place of SymfonyCon Disneyland Paris 2020 postponed to 2021.

The SymfonyWorld conference is a 100% online event from December 1st to 5th organized for the entire Symfony community. Registering to the conference days enables you to attend the live talks but all the replays of all talks too. Several breaks will be scheduled so you can have some time to relax or eat between talks.

The SymfonyWorld experience is a 5-day event and a new way to attend our conference. Here is the conference agenda:

  • Pre-conference workshop days: December 1st and 2nd
  • Conference days: December 3rd and 4th
  • Hackday: December 5th all day via Slack, open to anyone

You'll have the choice between several conference tracks from beginner to advanced talks. The entire event will be organized online in English.

We're pleased to announce the first selected speakers and their talks! Please welcome:

  • Ramona Schwering, Quality Assurance and Cypress Ambassador, will be speaking about "Symfony meets Cypress - E2E testing for symfony developers". Cypress.io (or Cypress for short) is currently getting a lot of attention when it comes to end-to-end testing. Especially in JavaScript environments Cypress.io seems to be slowly gaining acceptance. However, it plays to its strengths in Symfony applications as well. In my session, I want to introduce Cypress to you and explore its possibilities by writing first tests for the SymfonyCon website - so that we can overcome those concerns together.
  • Damien Alexandre, PHP and Elasticsearch consultant, will be talking about "Elasticsearch with Symfony, from development to production". Search is at the core of many standard application, but building and deploying a full-text search engine is not trivial. One of your options is to implement Elasticsearch and in this talk I will show you the path, from development to production. We will also leverage the new Symfony HttpClient to communicate with the cluster more efficiently!
  • Christopher Hertel, Software Architect, will give a talk about "Better Console Applications". Console applications - whether part of a larger (Symfony-)application or standalone-tool - usually are the bash-script of PHP developers. What to reason about while developing a console application and which simple tricks help to clean up your code, is shown by examples in this talk. How do I decouple my code from CLI runtime, how do I optimize long running processes and so on.
  • Thomas Berends, PHP Developer, will speak about "PHP + Minecraft". Minecraft is extremely popular, but what happens when we combine it with PHP & Symfony? This talk is an adventure in using PHP for things outside of your comfort zone. At the start, it seems that these do not work together at all. By reading files we can get information about what happens in Minecraft, from logs to the complete world. However, it gets truly interesting when we can change things in the world with PHP.

Thank you to all the people who took the time to submit a talk proposal! The speakers selection is not over yet, we're still selecting more speakers.

If you're not yet registered to the conference, take your ticket now! While ordering your online conference ticket, buy your conference goodies: the official conference t-shirt and the exclusive limited edition 15 years Symfony elephpant! By being registered to the online conference you have the opportunity to buy later your special Symfony conference swag.

Stay tuned for more announces!


Sponsor the Symfony project.

A Week of Symfony #716 (14-20 September 2020)

$
0
0

This week, the upcoming Symfony 5.2 version introduced a new RateLimiter component and built the first feature on top of it: login throttling. In addition, a new feature was merged into HttpClient component to automatically retry failed HTTP requests. Finally, the first speakers of the SymfonyWorld 2020 online conference were announced.

Symfony development highlights

This week, 58 pull requests were merged (42 in code and 16 in docs) and 37 issues were closed (29 in code and 8 in docs). Excluding merges, 30 authors made 4,960 additions and 422 deletions. See details for code and docs.

3.4 changelog:

  • d486f4a: [Form] changed 'cache_key' to AbstractRendererEngine::CACHE_KEY_VAR in BaseType
  • ba65757: [VarDumper] deal with errors being thrown on PHP 8
  • 74f41f3: [Yaml] fixed parsing comments not prefixed by a space
  • 2eeb75d: [Yaml] fixed edge cases when parsing multiple documents

4.4 changelog:

  • 61c1175: [HttpClient] don't calculate alternatives if option is auth_ntlm
  • e608d05: [Console] work around disabled putenv()
  • 1202404: [FrameworkBundle] fixed XSD definition which prevent to add more than one workflow metadata
  • ad22618: [HttpClient] added support for CURLOPT_LOCALPORT
  • 2f67bf3: [HttpKernel] do not override max_redirects option in HttpClientKernel
  • 7917612: [Cache] allowed cache tags to be objects implementing __toString()
  • 785a066: [Translator] handle null locales properly
  • e299544: [Validator] catch ValueError thrown on PHP 8

5.1 changelog:

  • f27ca4e: [String] improved slugger portability accross different implementations of iconv()
  • 4d1a522: [Security] log notice when no entry point is configured
  • 2384f08: [FrameworkBundle] loadRoutes shoud receive RoutingPhpFileLoader
  • 2a76d51: [Validator] stop using the deprecated at() PHPUnit matcher

Master changelog:

  • 2973d30: [Mailer] allow using Reply-To with Mailjet API
  • ae655bf: [Notifier] fixed errors parsing in FirebaseTransport
  • 9c8cd08: [String] allow translit rules to be given as closure
  • c34865f: [Form] added new way of mapping data using callback functions
  • 128bbd1: [Lock] made RetryTillSaveStore implements the SharedLockStoreInterface
  • 7cd5bbf: [RFC] introduced a new RateLimiter component
  • 83910df: [Amqp] added amqps support
  • 237d91f: [Security] added login throttling feature
  • 8d45013: [HttpClient] added RetryHttpClient
  • d6e2c5e: [MonologBridge] use composition instead of inheritance in monolog bridge
  • 772547e: [VarDumper] support for ReflectionAttribute

Newest issues and pull requests

They talked about us

Call to Action


Sponsor the Symfony project.

New in Symfony 5.2: Pseudo-localization translator

$
0
0
Thomas Calvet

Contributed by
Thomas Calvet
in #36016.

Symfony 5.2 will be released in November 2020. This is the first article of the series that shows the most important new features introduced by this Symfony version.


The following pictures show the interface of a popular Internet service. The first image is the original interface in English and the second one is what you see when switching the application language to Spanish:

Interface in English
Interface translated into Spanish

These kind of errors are very common, because different languages can be longer or shorter than the original application language. Another common issue is to only check if the application works when using basic accented letters, instead of checking for more complex characters such as the ones found in Polish, Czech, etc.

These problems can be solved with pseudolocalization, a software testing method used for testing internationalization. In this method, instead of translating the text of the software into a foreign language, the textual elements of an application are replaced with an altered version of the original language.

For example, AccountSettings is translated as [!!!ÀççôûñţŠéţţîñĝš!!!]. First, the original text is expanded in length with characters like [!!!!!!] to test the application when using languages more verbose than the original one. This solves the first problem.

In addition, the original characters are replaced by similar but accented characters. This makes the text highly readable, while allowing to test the application with all kinds of accented and special characters. This solves the second problem.

In Symfony 5.2 we’ve added full support for pseudolocalization to help you debug internationalization issues in your applications. You can enable and configure it in the translator configuration:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# config/packages/translator.yamlframework:translator:# ...pseudo_localization:# replace characters by their accented versionaccents:true# wrap strings with bracketsbrackets:true# controls how many extra characters are added to make text longerexpansion_factor:1.4# maintain the original HTML tags of the translated contentsparse_html:true# also translate the contents of HTML attributes (e.g. 'title')localizable_html_attributes:true

That’s all. The application will now start displaying those strange, but readable, contents to help you internationalize it. See for example the difference in the Symfony Demo application. This is the original page:

Original Symfony Demo page

And this is the same page with pseudolocalization enabled:

Symfony Demo page with pseudolocalization enabled

Sponsor the Symfony project.

New in Symfony 5.2: True colors in the console

$
0
0
Fabien Potencier

Contributed by
Fabien Potencier
in #36802.

The Symfony Console component provides a default styling for your command output, but you can also apply custom styles and colors. However, you could only use the eight basic ANSI colors for text and background colors.

In Symfony 5.2 we’re improving this feature to support 24-bit colors, also known as “true colors”. In total, more than 16 million different colors to make your console commands look gorgeous.

Instead of supporting all the different ways of defining colors (RGB, HSV, HSL, named colors, etc.) we’ve opted for a pragmatic solution based on hexadecimal colors, which are well-known by developers/designers and easy to get from any design application.

The most straightforward way of using these new hexadecimal colors is via thefg and bg shortcuts in the output contents:

1
2
3
4
5
6
7
8
// using a predefined style$output->writeln('<info>... contents ...</>');// custom style using basic colors$output->writeln('<fg=green;bg=blue>... contents ...</>');// custom style using true colors$output->writeln('<fg=#00ff00;bg=#00f>... contents ...</>');

Hexadecimal colors must include the # prefix and they can be 3 or 6 character long only (8-character values which include the alpha channel are not supported). You can also use these colors outside the Console component via the new Color class:

1
2
3
4
5
6
7
8
$color=newColor('#00ff00','#00f');echo$color->apply('... contents ...');// you can mix basic and true colors$color=newColor('red','#00f');// the third optional argument defines the styles$color=newColor('#000','#fff',['underscore','reverse']);

If true colors are not supported by the console/terminal, they fall back to the most similar default color.


Sponsor the Symfony project.

New in Symfony 5.2: EventSource HTTP client

$
0
0
Antoine Bluchet

Contributed by
Antoine Bluchet
in #36692.

Server-sent events is an Internet standard used to push data to web pages. Its JavaScript API is built around an EventSource object, which listens to the events sent from some URL. The events are a stream of data (served with thetext/event-stream MIME type) with the following format:

1
2
3
4
5
6
data: This is the first message.

data: This is the second message, it
data: has two lines.

data: This is the third message.

Symfony’s HttpClient component provides a solid foundation to consume stream responses. That’s why in Symfony 5.2. we’ve introduced a new feature to consume Server-sent events using Symfony HttpClient.

This feature is built around a new EventSourceHttpClient class which wraps your normal HTTP client and streams the server-sent events as stream chunks:

 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
useSymfony\Component\HttpClient\Chunk\ServerSentEvent;useSymfony\Component\HttpClient\EventSourceHttpClient;useSymfony\Component\HttpClient\HttpClient;$client=HttpClient::create();$client=newEventSourceHttpClient($client);// this is the URL that sends server events$source=$client->connect('https://localhost:8080/events');while($source){foreach($client->stream($source,2)as$r=>$chunk){if($chunk->isTimeout()){// do something ...continue;}if($chunk->isLast()){// do something ...return;}// this is a special ServerSentEvent chunk holding the pushed messageif($chunkinstanceofServerSentEvent){// do something with the message}}}

Sponsor the Symfony project.

New in Symfony 5.2: Doctrine types for UUID and ULID

$
0
0
gennadigennadigennadi

Contributed by
gennadigennadigennadi
in #37678.

In Symfony 5.1 we introduced a new Uid component to help you generate and work with different UID values, such as UUIDs and ULIDs. The next step is to improve its integration with other Symfony components.

That’s why in Symfony 5.2 we’ve added Doctrine types and generators for UUIDs and ULIDs. You only have to install Doctrine in your Symfony application and the new types will be available as uuid, uuid_binary, ulid andulid_binary:

// src/Entity/Product.phpnamespaceApp\Entity;useDoctrine\ORM\MappingasORM;/** * @ORM\Entity(repositoryClass="App\Repository\ProductRepository") */classProduct{/**     * @ORM\Column(type="uuid")     */private$someProperty;/**     * @ORM\Column(type="ulid")     */private$anotherProperty;// ...}

When using those types, the value of the properties will be transformed from/to UUID/ULID objects automatically for you. You can also generate UUID/ULID values for your primary keys using the new generators:

// there are generators for UUID V1 and V6 toouseSymfony\Bridge\Doctrine\Types\UuidV4Generator;/** * @ORM\Entity(repositoryClass="App\Repository\ProductRepository") */classProduct{/**     * @ORM\Id     * @ORM\Column(type="uuid", unique=true)     * @ORM\GeneratedValue(strategy="CUSTOM")     * @ORM\CustomIdGenerator(class=UuidV4Generator::class)     */private$id;// ...}useSymfony\Bridge\Doctrine\Types\UlidGenerator;/** * @ORM\Entity(repositoryClass="App\Repository\ProductRepository") */classProduct{/**     * @ORM\Id     * @ORM\Column(type="uuid", unique=true)     * @ORM\GeneratedValue(strategy="CUSTOM")     * @ORM\CustomIdGenerator(class=UlidGenerator::class)     */private$id;// ...}

Sponsor the Symfony project.

New in Symfony 5.2: Translatable objects

$
0
0
Nate Wiebe

Contributed by
Nate Wiebe
in #37670.

Translating contents usually require more information than the original message, such as the translation parameters and the translation domain. In order to make templates simpler, you could translate the entire messages in the backend and pass the translations to the templates.

However, this is sometimes cumbersome and also requires injecting the translator service in several layers of your application. Another alternative is to pass all the translation data (message, parameters, domain) to the template:

1
2
3
4
5
6
7
return$this->render('...',['order_status'=>['message'=>'order.status_message','params'=>['status'=>$status,'order'=>$order],'domain'=>'admin',],]);

This no longer requires injecting the translator, but makes templates more complex:

1
{{order_status.message|trans(order_status.params,order_status.domain)}}

In Symfony 5.2 we’re introducing a new Translatable class that solves this problem in an easier way. First, create a Translatable object and pass all the translation data to it:

1
2
3
4
5
6
7
8
9
useSymfony\Component\Translation\Translatable;return$this->render('...',['order_status'=>newTranslatable('order.status_message',['status'=>$status,'order'=>$order],'admin'),]);

Now you can translate this object in your template with the same trans filter as before, but in a much simpler way:

1
{{order_status|trans}}

The translatable object holds all the translation data, so the trans filter can extract it automatically. This solution allows to simplify both the templates and the backend code, because you don’t need to inject the translator or mock it when writing unit tests.

This feature also introduces a new t() function, usable both in PHP and Twig templates, to quickly create this kind of objects. The following example uses that function to create a fallback translation which uses different parameters than the default translation:

1
2
3
4
5
{# Before #}{{messageisdefined?message|trans:fallback|trans({'%param%':value})}}{# After #}{{message|default(t(fallback,{'%param%':value}))|trans}}

Kudos to the amazing folks at Symfony Slack chat who helped me better understand this feature so I could prepare this blog post.


Sponsor the Symfony project.

Symfony 3.4.45 released

$
0
0

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

  • bug #38228 [Yaml Parser] Fix edge cases when parsing multiple documents (@digilist)
  • bug #38229 [Yaml] fix parsing comments not prefixed by a space (@xabbuh)
  • bug #38131 [Validator] allow consumers to mock all methods (@xabbuh)
  • bug #37097 DateTime validator support for trailing data (@stefankleff)
  • bug #38116 [Console] Silence warnings on sap _window _c _set() call (@chalasr)
  • bug #38114 [Console] guard $argv + $token against null, preventing unnecessary exceptions (@bilogic)
  • bug #38099 Prevent parsing invalid octal digits as octal numbers (@julienfalque)
  • bug #38091 [DI] fix ContainerBuilder on PHP8 (@nicolas-grekas)
  • bug #38080 [Console] Make sure $maxAttempts is an int or null (@derrabus)
  • bug #38073 [VarDumper] Fix caster for invalid SplFileInfo objects on php 8 (@derrabus)
  • bug #38071 [PhpUnitBridge] Adjust output parsing of CoverageListenerTrait for PHPUnit 9.3 (@sanmai, @derrabus)
  • bug #38049 [Debug] Parse “x not found” errors correctly on php 8 (@derrabus)
  • bug #38024 [Console] Fix undefined index for inconsistent command name definition (@chalasr)

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.14 released

$
0
0

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

  • bug #38248 [HttpClient] Allow bearer token with colon (@stephanvierkant)
  • bug #37837 [Form] Fix custom formats deprecation with HTML5 widgets (@fancyweb)
  • bug #38285 [Contracts][Translation] Optional Intl dependency (@ro0NL)
  • bug #38283 [Translator] Optional Intl dependency (@ro0NL)
  • bug #38271 [ErrorHandler] Escape JSON encoded log context (@ro0NL)
  • bug #38284 [Cache][Lock][Messenger] fix compatibility with Doctrine DBAL 3 (@xabbuh)
  • bug #38228 [Yaml Parser] Fix edge cases when parsing multiple documents (@digilist)
  • bug #38229 [Yaml] fix parsing comments not prefixed by a space (@xabbuh)
  • bug #38127 [Translator] Make sure a null locale is handled properly (@jschaedl)
  • bug #38221 [Cache] Allow cache tags to be objects implementing toString() (@lstrojny)
  • bug #38212 [HttpKernel] Do not override ma _redirects option in HttpClientKernel (@dmolineus)
  • bug #38215 [HttpClient] Support for CURLOP _LOCALPORT (@derrabus)
  • bug #38202 [FrameworkBundle] Fix xsd definition which prevent to add more than one workflow metadata (@l-vo)
  • bug #38166 [Console] work around disabled putenv() (@SenTisso)
  • bug #38173 [HttpClient][HttpClientTrait] don’t calculate alternatives if option is aut _ntlm (@ybenhssaien)
  • bug #38169 [PhpUnitBridge] Internal classes are not legacy (@derrabus)
  • bug #38156 [Cache] fix ProxyAdapter not persisting items with infinite expiration (@dmaicher)
  • bug #38148 [HttpClient] fail properly when the server replies with HTTP/0.9 (@nicolas-grekas)
  • bug #38131 [Validator] allow consumers to mock all methods (@xabbuh)
  • bug #38139 [DI] dump OS-indepent paths in the compiled container (@nicolas-grekas)
  • bug #38126 [Cache] Limit cache version character range (@lstrojny)
  • bug #38142 [FrameworkBundle] adopt src/.preload.php (@nicolas-grekas)
  • bug #38108 [Cache] Fix key encoding issue in Memcached adapter (@lstrojny)
  • bug #38122 [HttpClient] Fix Array to string conversion notice when parsing JSON error body with non-scalar detail property (@emarref)
  • bug #37097 DateTime validator support for trailing data (@stefankleff)
  • bug #38116 [Console] Silence warnings on sap _window _c _set() call (@chalasr)
  • bug #38114 [Console] guard $argv + $token against null, preventing unnecessary exceptions (@bilogic)
  • bug #38094 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait (@sanmai)
  • bug #38101 [VarExporter] unserialize() might throw an Exception on php 8 (@derrabus)
  • bug #38100 [ErrorHandler] Parse “x not found” errors correctly on php 8 (@derrabus)
  • bug #38099 Prevent parsing invalid octal digits as octal numbers (@julienfalque)
  • bug #38095 [Mailer] Remove unnecessary check for existing request (@jschaedl)
  • bug #38091 [DI] fix ContainerBuilder on PHP8 (@nicolas-grekas)
  • bug #38086 [HttpClient] with “bindto” with NativeHttpClient (@nicolas-grekas)
  • bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (@nicolas-grekas)
  • bug #38080 [Console] Make sure $maxAttempts is an int or null (@derrabus)
  • bug #38075 esmtp error not being thrown properly (@Anton Zagorskii)
  • bug #38040 [Yaml Parser] fixed Parser to skip comments when inlining sequences (@korve)
  • bug #38073 [VarDumper] Fix caster for invalid SplFileInfo objects on php 8 (@derrabus)
  • bug #38071 [PhpUnitBridge] Adjust output parsing of CoverageListenerTrait for PHPUnit 9.3 (@sanmai, @derrabus)
  • bug #38062 [DI] fix generating preload file when cach _dir is outside projec _dir (@nicolas-grekas)
  • bug #38059 [Cache] Fix CacheCollectorPass with decorated cache pools (@shyim)
  • bug #38054 [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x (@sanmai)
  • bug #38049 [Debug] Parse “x not found” errors correctly on php 8 (@derrabus)
  • bug #38041 [PropertyInfo] Fix typed collections in PHP 7.4 (@ndench)
  • bug #37959 [PhpunitBridge] Fix deprecation type detection (when several autoload files are used) (@l-vo)

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.
Viewing all 3075 articles
Browse latest View live