Symfony Reloaded 2.0 Preview Release

Please note that Symfony2 is not ready for production yet. The final release is planned for late 2010 and will only support PHP 5.3.2 and up. In the meantime, we highly encourage you to use the current symfony 1.4 stable release for all your projects.

Take your Productivity to new Heights

Symfony2 provides tools that greatly simplify your life as a developer. Symfony also promotes best practices to enhance your productivity and build better applications faster.

The Web Debug Toolbar

The Symfony "Web Debug Toolbar" is the developer's best friend. Displayed at the bottom of all pages in the development environment, it instantaneously gives you access to a lot of information you need when something goes wrong.

Symfony was the very first framework to propose such a web debug toolbar to ease debugging. Since then, numerous other web frameworks have followed the same path and you can find web debug toolbars for Zend Framework, Django, Ruby on Rails, Rack, and CakePHP.

Profiler

Symfony2 comes with a profiler that collects information about your requests and store them for later analysis. The Web Profiler is a visualization tool for profiling data that you can use in development to debug your code and enhance performance; but it can also be used to explore problems that occur in production.

Environments

When you develop an application, you need several environments (except if you develop directly on the production server of course, but that's a totally different story):

Symfony comes bundled with those environments by default. An environment is a unique set of settings and configuration targeted at a certain usage pattern. For instance, the development environment must be optimized for the developer (the web debug toolbar is enabled, nice exceptions are shown on the screen in case of an error, and all the details of a request are logged to ease debugging). But the production environment should be optimized for performance and the user experience (errors should be masked behind a friendly page, and an aggressive cache layer must be activated). Creating a new environment in Symfony is a matter of creating a new set of settings.

Helpful Error Messages

When something goes wrong during development, Symfony tries to do its best to provide all the information you need at your fingertips. Besides the web debug toolbar, Symfony displays nice-looking and useful error pages.

Instead of switching to the console to look at the Apache error logs, or dive into the Symfony logs, everything you need is available at your fingertips: analyze the main exception and all the linked ones, dive into the stack traces, have a look at the logs, and click on any filename to open it in your favorite IDE at the right line.

Useful Logs

Instead of logging tons of messages, Symfony tries to only record useful information:

... INFO: Matched route "blog_post" (parameters: array (  '_bundle' => 'BlogBundle',  '_controller' => 'Post',  '_action' => 'show',  '_format' => 'html',  'id' => '1343',  '_route' => 'blog_post',))
... INFO: Using controller "Bundle\BlogBundle\Controller\PostController::showAction"
... INFO: SELECT s0_.id AS id0, s0_.title AS title1, s0_.html_body AS html_body2, s0_.excerpt AS excerpt3, s0_.published_at AS published_at4 FROM sf_weblog_post s0_ WHERE s0_.id = ? (array (  0 => '1343',))
... ERR: Post "1343" not found! (No result was found for query although at least one row was expected.) (uncaught Symfony\Components\RequestHandler\Exception\NotFoundHttpException exception)
... INFO: Using controller "Symfony\Framework\WebBundle\Controller\ExceptionController::exceptionAction"
And if you want more debug information, just change the priority level of the logger.

The Command Line Interface

Using a structured framework means embracing its conventions. But creating directories and files by hand has no added-value and is tedious at best. Symfony provides a CLI tool that does all the work for you. For repetitive and boring tasks, the CLI tool automates the hard work for you.

© 2010 Fabien Potencier - "Symfony" is a trademark of Fabien Potencier, all rights reserved.

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.