Latest in branch 2.4
2.4.10
Released 28 Sep 2014
(11 years ago)
SoftwareSymfony
Version2.4
Status
End of life
Supported
PHP versions
PHP ≥ 5.3.3
Initial release2.4.0
03 Dec 2013
(12 years ago)
Latest release2.4.10
28 Sep 2014
(11 years ago)
End of bug fixesJul 2014
(Ended 11 years, 10 months ago)
End of security fixesJul 2014
(Ended 11 years, 10 months ago)
Release noteshttps://github.com/symfony/symfony/releases/tag/v2.4.10
Source codehttps://github.com/symfony/symfony/tree/v2.4.10
Documentationhttps://symfony.com/doc/current/index.html
Downloadhttps://symfony.com/download
Symfony 2.4 ReleasesView full list

What Is New in Symfony 2.4

Symfony 2.4 introduces several key updates focused on component enhancements and PHP version support. This release continues the framework's evolution with a mix of new features, deprecations, and refinements to existing systems.

Category Key Changes
New Features Expression support in security, new form events, updated console component.
Improvements Better validation constraints, enhanced security voter system, refined form type extensions.
Deprecated Legacy form features, certain security settings, old console helper methods.
Bug Fixes Various fixes across Form, Validator, Security, and Routing components.
Requirements PHP 5.3.3 minimum, with PHP 5.4+ recommended for better performance.

How Did Security Improve in Symfony 2.4?

The security component got a significant upgrade with the introduction of expression language support. You can now use expressions within access control rules for more dynamic and complex authorization logic.

This allows you to check conditions directly in your security configuration, like referencing request attributes or method calls on services. In practice, it moves complex authorization logic out of controllers and into the configuration, making it more declarative.

Security Voters

The voter system was enhanced to be more granular and flexible. It provides a cleaner way to centralize authorization decisions, which is especially useful for domain-specific rules.

What Changed with Forms in 2.4?

Form handling received new event types and deprecated some legacy behaviors. The PRE_SET_DATA and POST_SET_DATA events were added, giving you more precise hooks into the form data population process.

This matters because you can now manipulate data more effectively during the form building phase. Several form type extensions were also refined, changing how you interact with certain form options.

// Example of using the new form events
$builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) {
    // Manipulate data before it populates the form
});

Were There Console Component Updates?

Yes, the Console component was updated with new features and deprecations. New helper methods were introduced to streamline command output and input handling, while some older helpers were marked for removal.

These changes aim to make writing CLI commands more consistent and less verbose. The progress bar helper, for instance, got improvements for custom formatting.

What Should I Know About Deprecations?

Symfony 2.4 started deprecating several features to prepare for future major versions. Key deprecations include specific form field types, legacy security configuration options, and certain methods in the Console component.

You'll see deprecation warnings in your logs if you use these features. Addressing them early smoothes the upgrade path to Symfony 3.0. The changes are typically straightforward, like renaming a method or switching to a new service.

  • Legacy form theme configuration.
  • Old security firewall settings.
  • Deprecated console helper interfaces.

FAQ

Is PHP 5.4 required for Symfony 2.4?
No, PHP 5.3.3 is the minimum required version. However, using PHP 5.4 or higher is strongly recommended for better performance and to use new PHP features that the framework can optimize for.

How do I use the new security expressions?
You can use expressions directly in your security.yml access control rules. They allow you to reference services, request attributes, and use complex logic with a syntax similar to Twig conditions.

What's the main reason for the form event changes?
The new PRE_SET_DATA and POST_SET_DATA events provide more control over the data binding process. This fixes limitations where manipulating data at certain form lifecycle stages was difficult or impossible.

Are the deprecations in 2.4 immediately breaking?
No, deprecated features still work in 2.4 but trigger warnings. They are scheduled for removal in Symfony 3.0. You should update your code to use the new replacements to avoid future breaks.

Did the directory structure change in this release?
No, the standard edition directory structure remained the same. The changes were primarily within components and their internal APIs, not the application skeleton layout.

Releases In Branch 2.4

VersionRelease date
2.4.1028 Sep 2014
(11 years ago)
2.4.903 Sep 2014
(11 years ago)
2.4.815 Jul 2014
(11 years ago)
2.4.708 Jul 2014
(11 years ago)
2.4.631 May 2014
(12 years ago)
2.4.522 May 2014
(12 years ago)
2.4.427 Apr 2014
(12 years ago)
2.4.304 Apr 2014
(12 years ago)
2.4.212 Feb 2014
(12 years ago)
2.4.105 Jan 2014
(12 years ago)
2.4.003 Dec 2013
(12 years ago)
2.4.0-RC125 Nov 2013
(12 years ago)
2.4.0-BETA230 Oct 2013
(12 years ago)
2.4.0-BETA107 Oct 2013
(12 years ago)