Latest in branch 4.1
4.1.12
Released 17 Apr 2019
(7 years ago)
SoftwareSymfony
Version4.1
Status
End of life
Supported
PHP versions
PHP ≥ 7.1.3
Initial release4.1.0
30 May 2018
(8 years ago)
Latest release4.1.12
17 Apr 2019
(7 years ago)
End of bug fixesJan 2019
(Ended 7 years ago)
End of security fixesJan 2019
(Ended 7 years ago)
Release noteshttps://github.com/symfony/symfony/releases/tag/v4.1.12
Source codehttps://github.com/symfony/symfony/tree/v4.1.12
Documentationhttps://symfony.com/doc/current/index.html
Downloadhttps://symfony.com/download
Symfony 4.1 ReleasesView full list

What Is New in Symfony 4.1

Symfony 4.1 brings a host of refinements and new features focused on developer experience, performance, and modern PHP practices. The release polishes existing components and introduces several handy utilities.

Category Key Highlights
New Features Messenger component, Mime and Mailer components, improved Docker support, new commands.
Improvements Cache component enhancements, workflow updates, better Dotenv file handling, Symfony Flex improvements.
Deprecations Some legacy options and methods are deprecated in preparation for Symfony 5.0.

What are the major new components in 4.1?

The standout addition is the Messenger component (symfony/messenger). It provides a message bus system for sending and handling messages, making it easier to implement command buses, event buses, and asynchronous message processing. This is a game-changer for building decoupled, queueable application logic.

Another significant introduction is the Mime component (symfony/mime) and the revamped Mailer component (symfony/mailer). They replace Swiftmailer as the foundation for handling emails, offering a more modern, object-oriented API for creating and sending messages with support for multiple transports.

How does Symfony 4.1 improve the developer workflow?

Several tools are added to streamline daily tasks. The new make:message and make:handler commands scaffold classes for the Messenger component. The debug:autowiring command now lists all available services by type, not just by ID, making dependency injection discovery much smoother.

Symfony Flex gets smarter about environment variables. It now automatically generates .env.local and .env.test.local files when installing packages that require new environment variables, reducing manual configuration steps.

What caching improvements were made?

The Cache component received major performance boosts for tag-based invalidation. The new TagAwareAdapter is significantly faster, especially when dealing with a large number of cache tags. In practice, this means clearing cached content related to specific tags (like for a user or product) is much more efficient.

They also introduced PSR-16 Simple Cache adapters, providing a standardized, simpler interface for basic cache operations alongside the more advanced PSR-6 interface.

Are there updates for modern deployment and infrastructure?

Yes, Docker and cloud-native development are better supported. The default Dockerfile and .dockerignore files generated by Symfony are now more optimized for production, using a multi-stage build process to create smaller, more secure final images.

The Dotenv component was improved to handle complex values and multiple files more reliably, which is crucial for managing configuration across different deployment environments (development, staging, production).

FAQ

Should I use Messenger over a traditional event dispatcher?
It depends. The Messenger component is ideal for commands and events that should be processed asynchronously or in a queue. For simple, synchronous event notification within your application, the existing EventDispatcher is still the right choice.

Is Swiftmailer completely removed in 4.1?
No, Swiftmailer is still available and supported. However, the new Mailer component is the recommended path for new projects. It's a standalone package you can adopt without a full framework upgrade.

What's the easiest way to try the new caching improvements?
If you use the cache.adapter.redis_tag_aware or similar tagged services, you get the improvements automatically. For custom setups, switch to using the TagAwareAdapter.

Do the new Dotenv changes break my existing .env files?
They shouldn't. The changes add better support for spaces, comments, and nested variables in values. Your current files will work, but you can now use more flexible syntax if needed.

Are there any breaking changes I need to watch for when upgrading?
Most changes are backward compatible. The main concerns are deprecations, which will trigger notices in your logs. Review the deprecation notices carefully to prepare for Symfony 5.0. A notable one is the deprecation of the ContainerAwareCommand class.

Releases In Branch 4.1

VersionRelease date
4.1.1217 Apr 2019
(7 years ago)
4.1.1317 Apr 2019
(7 years ago)
4.1.1129 Jan 2019
(7 years ago)
4.1.1006 Jan 2019
(7 years ago)
4.1.906 Dec 2018
(7 years ago)
4.1.826 Nov 2018
(7 years ago)
4.1.703 Nov 2018
(7 years ago)
4.1.603 Oct 2018
(7 years ago)
4.1.530 Sep 2018
(7 years ago)
4.1.428 Aug 2018
(7 years ago)
4.1.301 Aug 2018
(7 years ago)
4.1.223 Jul 2018
(7 years ago)
4.1.125 Jun 2018
(7 years ago)
4.1.030 May 2018
(8 years ago)
4.1.0-BETA326 May 2018
(8 years ago)
4.1.0-BETA221 May 2018
(8 years ago)
4.1.0-BETA107 May 2018
(8 years ago)