Symfony 3.1 has been released and experts consider it the most stable version of the framework so far. To bring the readers up to speed with the framework, I have started a series of blogs on Symfony 3.1 covering basics such as Up And Running With Symfony 3.1 and To-do App Using Symfony 3.1
In this blog, I will highlight the new features and components introduced in the latest release of the framework. I will discuss the major changes and updates introduced in this release. You can visit the GitHub pull request links by clicking the pull request code at the end of the description:
The following is a quick list of the areas that have received updates/revisions.
Let’s take a bit detailed look at each of the above component so that you could read about the update and get the GitHub pull requests.
Lightweight Directory Access Protocol (LDAP) is an open industry standard used for assessing and maintaining distributed directory information service over the network. When it comes to information sharing, LDAP is trusted by every stakeholder. Symfony introduced LDAP as a component in the 3.0 version, which provided integration with Symfony security component. In version 3.1, LDAP gets some major updates.
- Option to configure all available LDAP options for connection 
- Check whether an entry attribute exists 
- Added default service name for the security components 
- Add write support for the LDAP component 
YAML stands for “YAML Ain’t Markup Language”. It is used extensively in Symfony to convert YAML strings to PHP arrays and vice versa. YAML is mainly used for its configuration files, blueprints, and in page settings. YAML is a very popular component and has received some major updates.
- Introduced flags to customize the parse behaviour 
- Added option to dump objects as maps 
- Parsing the !!php/object tag is now deprecated 
- Added support to parse and dump DateTime objects 
- Added support for parsing the !!binary tag 
The Symfony Process component executes commands in subprocesses. The component takes care of the subtle differences between the different platforms when executing the command.The Process component provides an object-oriented abstraction on top of proc_* functions to execute independent processes in PHP. It has been updated in Symfony 3.1 .
- IteratorAggregate to stream output is implemented 
- Added support to Traversable Input 
- A callback is now allowed whenever the output is disabled 
Symfony comes with a Serializer component that converts objects into specific format like JSON, XML,YAML, etc. Serializer allows encoders to only deal with encoding specific formats into arrays and vice versa. The Serializer service is not available by default and you need to activate it from config file. This component has received updates in Symfony 3.1.
- Added forward and redirection detection in WDT (HeahDude) (17589)
- Added more information in the security profiler (javiereguiluz) (17887)
- Added status code to search form (oktapodia) (17125)
- Added HTTP return code in the Ajax request list table (kucharovic) (17540)
The Console component makes it easy to create beautiful and testable command line interfaces. This component allows creation of command-line commands which are then used to perform specific recurring tasks from console such as cron jobs, imports, or other batch jobs. Before Symfony 3.1, commands could not be registered privately. However, in this release, the component has received several updates:
- Private commands are allowed to be registered privately 
- Added ApplicationTester support to test stdout and stderr 
- Added non-auto column width functionality 
- Added truncate method to FormatterHelper 
The HTTPKernel component works using request-response model. It uses the “eventdispatcher” component to convert request into response through a structured process. Every HTTP web interaction depends on request and its related response. Usually, a PHP snippet is used to read the request and carry out relevant action. In Symfony 3.1, HTTPKernel received some minor updates including:
- Deprecated passing objects as URI attributes to the ESI and SSI renderers 
- Added the kernel.controller_arguments event 
- Added an ArgumentResolver with clean extension point 
Forms are often the UI that the users see on a website. Forms are used to get user input for CRUD operations. Symfony uses HTML forms and PHP generated forms generated using arrays and APIs. The Form component focuses on processing data to and from the client and the application. The Form component has some updates including:
- LazyChoiceList and DoctrineChoiceLoader are optimized 
- Deprecated form types as services 
- Deprecated the “choices_as_values” option of ChoiceType 
The Security component provides a firewall within and outside of the webapp to protect it from security threats and exploits. From authentication to certified login, this component ensures that the developers have all the tools to integrate security into the webapp. An important option is the creation of custom policies and security rules. Mainly it has four subcomponents; security-core,security-HTTP,security-csrf,security-acl used for security purposes. Some of the major updates for Security component in Symfony 3.1 are:
- Use auth trust resolver to determine anonymous in ContextListener 
- Added new TargetPathTrait to get/set the authentication “target_path” 
These are some of the major component updates in Symfony 3.1. I hope that you have found the description useful. You can also view the complete guide and changelog at the Symfony’s official site.
Symfony 3.1 is the latest and the most stable release of the framework to date. Although Symfony 3.2 has also been released, it is still unstable and require further work. I recommend that you start using Symfony 3.1 for your next development project. If you need an introduction to the framework, you could follow my tutorial series on Symfony. Another good resource is Symfony’s Living on the Edge blog series.
Please leave a comment if you discover any issues or have a query.
Shahroze is a PHP Community Manager at Cloudways - A Managed PHP Hosting Platform. He’s always in search of new frameworks and methods to implement them. Besides his coding life, he loves movies and playing soccer with friends. You can email him at firstname.lastname@example.org
Create PHP websites without the worry of server management.
Deploy your PHP app on optimized PHP hosting servers.