Latest in branch 2.5
2.5.12
Released 27 May 2015
(11 years ago)
SoftwareSymfony
Version2.5
Status
End of life
Supported
PHP versions
PHP ≥ 5.3.3
Initial release2.5.0
31 May 2014
(12 years ago)
Latest release2.5.12
27 May 2015
(11 years ago)
End of bug fixesJan 2015
(Ended 11 years, 4 months ago)
End of security fixesJan 2015
(Ended 11 years, 4 months ago)
Release noteshttps://github.com/symfony/symfony/releases/tag/v2.5.12
Source codehttps://github.com/symfony/symfony/tree/v2.5.12
Documentationhttps://symfony.com/doc/current/index.html
Downloadhttps://symfony.com/download
Symfony 2.5 ReleasesView full list

What Is New in Symfony 2.5

Symfony 2.5 introduces a range of updates focused on component enhancements, new features, and developer experience improvements. This release continues to refine the framework's core while preparing for future evolution.

Category Key Highlights
New Features Expression support in service definitions, new DebugClassLoader, LockHandler, and Process improvements.
Improvements Enhanced security voters, Yaml component parsing, Console table output, and PropertyAccess performance.
Deprecations Several methods and classes are deprecated to pave the way for Symfony 3.0.
Bug Fixes Numerous fixes across the Form, Validator, Security, and Routing components.

How does Symfony 2.5 improve service container configuration?

The service container now supports expressions using the expression attribute. This lets you define complex conditional logic directly in your service definitions, moving some application logic out of PHP classes and into the configuration layer.

In practice, you can reference services and parameters within these expressions. This is particularly useful for enabling services based on specific runtime conditions without writing a factory class.

<service id="my_service" class="MyClass">
    <argument type="expression">service('some_service').getValue()</argument>
</service>

What new debugging tools are available for developers?

A new DebugClassLoader replaces the legacy UniversalClassLoader and DebugUniversalClassLoader. It provides clearer error messages when a class cannot be found, often suggesting the correct namespace based on available classes.

The LockHandler class was added to the Filesystem component, offering a simple way to create file-based locks across different PHP processes or servers. This is handy for preventing race conditions in tasks like cron job execution.

Are there significant changes to the Security component?

Yes, the security voter system received a major upgrade. The VoterInterface was simplified. Now, voters return one of three constants (ACCESS_GRANTED, ACCESS_DENIED, ACCESS_ABSTAIN) instead of a Boolean, allowing for more nuanced and flexible authorization strategies.

This change matters because it standardizes voter behavior and makes it easier to combine multiple voters for complex security rules. The old interface is deprecated but still functional for backward compatibility.

What enhancements were made to the Console and Process components?

The Console component gained a Table helper, making it straightforward to format and display tabular data in terminal commands. This saves developers from manually writing complex output formatting logic.

The Process component improved how it handles Windows compatibility. It also added a lock() method to ProcessBuilder for setting process options fluently, though note that ProcessBuilder itself is now deprecated in favor of using Process directly.

Which parts of the framework are marked as deprecated?

Symfony 2.5 introduces several deprecations to clean up the codebase before Symfony 3.0. Key deprecations include the ProcessBuilder class, the Session handler for PdoSessionHandler, and the security.context service in favor of security.authorization_checker and security.token_storage.

Using deprecated features will trigger notices in the logs. It's a good time to start updating your code to avoid breaks in the next major release. The deprecation notices usually point you to the new recommended approach.

FAQ

Should I be worried about the deprecations in Symfony 2.5?
Not immediately. Deprecated features will continue to work in the 2.x branch; they just generate log notices. However, you should plan to update your code before migrating to Symfony 3.0, where these features will be removed entirely.

What is the main benefit of the new expression language in the service container?
It reduces boilerplate code. Instead of creating a factory service class for simple conditional logic, you can embed an expression directly in your service definition, making the configuration more declarative and concise.

How does the new DebugClassLoader help me?
When an autoload failure occurs, it provides much more helpful error messages. For example, if you mistype a class name, it might suggest the correct name from similarly named classes in your project, speeding up debugging significantly.

Is the LockHandler reliable for distributed systems?
No, the LockHandler uses the local filesystem, so it's only reliable for locks across processes on the same server. For distributed systems across multiple servers, you need a shared storage solution like a database or Redis.

Why was the VoterInterface changed in the Security component?
The old Boolean return value (true/false) was ambiguous because it couldn't distinguish between "I deny access" and "I have no opinion." The new three-state return system (ACCESS_GRANTED, ACCESS_DENIED, ACCESS_ABSTAIN) removes this ambiguity and allows for more complex voter chains.

Releases In Branch 2.5

VersionRelease date
2.5.1227 May 2015
(11 years ago)
2.5.1101 Apr 2015
(11 years ago)
2.5.1002 Feb 2015
(11 years ago)
2.5.907 Jan 2015
(11 years ago)
2.5.803 Dec 2014
(11 years ago)
2.5.720 Nov 2014
(11 years ago)
2.5.624 Oct 2014
(11 years ago)
2.5.528 Sep 2014
(11 years ago)
2.5.403 Sep 2014
(11 years ago)
2.5.306 Aug 2014
(11 years ago)
2.5.215 Jul 2014
(11 years ago)
2.5.108 Jul 2014
(11 years ago)
2.5.031 May 2014
(12 years ago)
2.5.0-RC128 May 2014
(12 years ago)
2.5.0-BETA229 Apr 2014
(12 years ago)
2.5.0-BETA111 Apr 2014
(12 years ago)