Symfony Station Communique - 7 January 2021. A look at Symfony and PHP news.

This post originally appeared on Symfony Station.

Welcome to this week's Symfony Station Communique. It's your weekly review of the most valuable and essential news in the Symfony and PHP development communities. Take your time and enjoy the items most valuable for you.

Thanks once again to Javier Eguiluz and Symfony for sharing our last communique in their Week of Symfony.

*Please note that links will open in a new browser window. My opinions, if I present any, will be in bold.

Symfony

As always, we will start with the official news from Symfony.

Highlight -> "This week, Symfony 4.4.36, 5.3.13, 5.4.2 and 6.0.2 maintenance versions were released. In addition, Symfony announced the open sourcing of Symfony CLI, and we published the traditional Symfony 2021 Year in Review summary."

There's a week left to enjoy the early bird registration for SymfonyLive Paris 2022 conference organized on April 7-8 2022. Join the team for a week of Symfony in French: 2-day workshops and 2-day conference!

They have announced the workshops as well.

Early bird registration for SymfonyWorld Online 22 Summer edition ends January 14. Calls for presentations are open for it and SymfonyLive Paris.

SymfonyCasts picks back up on their security series and writes "We added an “email verification” step to our registration by leveraging the symfonycasts/verify-email-bundle (hey! I know them!). Then we looked at actually validating the signed URL that we sent to the user to show why it failed when it does, and mark our user as “verified”.

And apart from being more powerful and less complex, the new Symfony security system comes with new stuff! Like “login throttling”. We enable this & open up its source code to see how it works. Hint: it works via events!"

Featured Item

We continue to highlight a post of the week. This one was an obvious and easy decision.

This week I am choosing one of the most useful posts I've found in a long time. It's primarily about the frontend and self-explanatory.

This Week

API Platform creator Kévin Dunglas writes: "I’m very excited to announce that after 6 years of teamwork, Symfony and API Platform now include an industry-first set of tools designed to automatically create, manage and run the Docker containers needed for your applications."

Dariusz Gafka explores "pushing the refactoring of our Symfony Applications to their boundaries. We will focus on dropping boilerplate completely so we can write only the code that matters, allowing us for easy modifications, maintenance and future extensions."

We will focus on dropping boilerplate completely so we can write only the code that matters, allowing us for easy modifications, maintenance and future extensions."

Fabio Hiroki has another excellent article for us. This one covers using Symfony with the RabbitMQ message broker.

In previous communiques I shared Anders Björkland's articles on the SilverStripe CMS. Here's the latest one.

Regarding CMSs our next original article will cover those built with Symfony Components. Check back next Wednesday to read it.

Mike Zukowski follows up on an article he wrote how to improve your application’s response time with lazy Twig extensions.

There was an explosion of Drupal news this week. So, here we go.

Speaking of Twig, Drupal 10 will update its implementation of Twig from version 2 to 3. Here are the details so you can prepare.

Drupal uses the EventDispatcher component from Symfony, which implements the Mediator and Observer design patterns. This allows for business logic to be extensible without making systems entirely coupled. The originating system dispatches an event and allows any other system to react to that event or modify data associated with that event. The originating system can then perform other interactions after its observers have processed the event.

Last Week

While the Drupal Content Management (CMS) system is a popular solution for all-in-one websites, it also works well as a “content warehouse” that other systems can pull from. In this tutorial, we will use Drupal Views to create two API endpoints that an app or website can use to request content from a Drupal CMS.

And finally on the Drupal front, here is a useful cheat sheet for developers.

Tanvir Ahmad shows us how to create PHP CLI application with the Symfony console component.

He also has this post.

Timeless

Sponsored Article

All sponsored articles are for products we have vetted and stand behind. We either use them or would do so if they were applicable to the Symfony Station site.

We published our first sponsored article on Symfony Station exploring how Code Execution Monitoring helps you identify bugs and bottlenecks in your Symfony app before your customers do. Like all our articles it is now available via audio.

PHP

ThisWeek

Kévin Dunglas also writes: "In modern web applications, it’s a common pattern to serve the web API and the frontend app from different subdomains. This was the pattern implemented by API Platform until last year. But we changed that for 2 main reasons: performance and REST principles."

Alex Hernandez writes: "Over the years, I’ve learned how to set up Docker in a way it’s easy to use without needing to know every detail. Today I want to give you an easy-to-use template in order to use Docker with PHP, explained, so you can understand how it works in just 10 minutes."

Vishwa Chikate asks: "how can we better implement the callback Class/Methods a.k.a the resource handlers associated with an REST HTTP API. The idea which will be covered will help #developers in having a Reusable, Extendable and an easily Maintainable code.

The approach outlined here can be applied to any PHP framework of choice or it can be considered as implementation practice in other languages / framework’s."

Feel like building a PHP site from scratch? Jens Kuerschner has the article for you.

I found the following to be an interesting case study from Matt Kingshott.

I have shared work from Eelco Verbrugge, before. Here he explains PHP interfaces.

Christophe Avonture mentions that "As a loyal reader of several forums for years, I frequently find unreadable PHP code posted by beginners asking for help. Before we can try to help them, it is sometimes useful to reformat the code and rewrite it partially." He shows us how here.

This is a short but very interesting post from Mike Zukowski.

PHP Stripe API turns the agonizing task of collecting credit card payments into a matter of copy & paste. It’s basically a JavaScript library that interfaces your web page to Stripe’s web servers. The information is never sent to your servers making it so effective. You don’t have to stress over the server-side settings of your application.

The Stripe PHP library gives access to the Stripe API from applications composed within the PHP language. It incorporates a pre-defined set of classes for API that initialize themselves from the API which makes it compatible with a wide run of versions of the Stripe API.

Last Week

Based on the most recent Stack Overflow survey in 2020, Python was the most used language according to 70% of its respondents, while PHP was chosen by 25%. However, market reports from w3techs.com tell a different story, showing that nearly 78% of all websites today run PHP. Much of PHP’s mainstay can be attributed to Wordpress and Shopify, which constitute around 45% of all websites today.

Timeless

Tips are always welcome, and Damian Brdej has these for PhPStorm.

Other

The State of the Octoverse from GitHub explores a year of change in programming. Its research tells you how to improve your performance and well-being by developing code, creating documentation, and supporting communities in smarter, more sustainable ways.

The Next Web looks at why shrinkflation is not a solution for inflation in the programming industry.

Kesk gives us "eight little tips that can save you time in your day-to-day as a programmer. Some are basic while others could be a little complex."

Have you published or seen something related to Symfony or PHP that we missed? If so, please contact us.

That's it for this week. Thanks for making it to the end of another extended edition. I look forward to sharing next week's Symfony and PHP news with you on Friday.

Please share this post. :) Be sure to join our newsletter list at the bottom of any of our site’s pages. Joining gets you each week's communique in your inbox (a day early). And follow us on Twitter at @symfonfystation.

Happy Coding Symfonistas!

Reuben Walker

Reuben is also Ringmaster of Mobile Atom Media and its division Mobile Atom Code.

22