A week of symfony #175 (3->9 May 2010)

Symfony 2 committed this week lots of changes and fixes to its public repository. However, the most important change was related to the coding standards. From now on, Symfony 2 code will use PEAR / ZF coding standards. Therefore, indendation is now 4 spaces and curly brackets are now folded for control structures.

Development mailing list

Development highlights

Symfony 1.X branch:

  • r29344: [lime] changed call to non-existing method strip_base_dir()
  • r29390, r29391: [1.3, 1.4] fixed default_params: { sf_format: xml } for route collections

Symfony 2.X branch:

  • 7065..9ccd: [Tests] replaced assertType by the new assertInstanceOf in unit tests
  • a06d..9783: [RequestHandler] fixed incorrect splitting of Accept-* headers
  • 0858..b4b8: [WebBundle] added a routing file for the 'default' route
  • a9d8..327b: [Foundation] moved some Kernel initializations in the boot() method to speed up creation of Kernel instances
  • 8fe2..1975: [WebBundle] made the request instance explicit in the controller base class (useful if you inject the request for testing purpose)
  • ca26..174b: [RequestHandler] converted response status texts keys to integer
  • b3a6..36e8: [RequestHandler] removed fluent interface for Response
  • c34d..aa16: renamed RequestBag to ParameterBag, added HeaderBag, changed the Response to use the new HeaderBag, added a class to manage the Cache-Control header
  • 606e..2726: [RequestHandler] added a bunch of HTTP cache related methods to the Response class
  • 5d26..0145: [WebBundle] added a query parameter to the controller loader for more flexibility
  • bdbb..7a21: [Foundation] added a way to call RequestHandler::handleRaw() from the Kernel
  • 4be3..386c: [RequestHandler] fixed HeaderBag usage
  • 376c..fd5e: [Finder] replaced ChainIterator with PHP built-in AppendIterator
  • aaeb..776d: [Finder] made the in() method fluent as others as Finder now implements the IteratorAggregate interface
  • 0285..7859: [Finder] simplified LimitDepthFilterIterator
  • 5d77..638a: [WebBundle] second argument in array_merge must be an array
  • 04da..cd08: [RequestHandler] changed server object in Request to be a simple ParameterBag
  • d41e..3076: [WebBundle] added more tests to Mustache
  • 6328..c32f: renamed RequestHandler component to HttpKernel
  • 83c6..6d81: changed coding standards: indendation is now 4 spaces
  • 9c2c..8d29, e799..40e1: added a raw argument to the HttpKernel::handle() method

...and many other changes

Development digest: 63 changesets, 15 bugs reported, 11 bugs fixed, 5 enhancements suggested, 1 enhancement closed, 5 documentation defects reported, 23 documentation defects fixed, and 19 documentation edits.


New Job Postings

New developers for hire

  • Altima: French Web agency based in France (Roubaix, Lyon and Paris) and Morocco (Rabat).
  • Portail Pro: a french web-agency, in Douai (France).
  • Tigre Blanc: a design and web development agency in Douai (France).

New symfony bloggers


  • New plugins
    • sfDibsPaymentPlugin: integrates access to DIBS danish supplier of payment solutions (http://www.dibs.dk)
    • zAmfPlugin: a bridge that uses Zend Amf lib to connect php classes and flash client side.
    • sfDeveloperMarkdownPlugin: connects several projects (Wysiwyg Markdown Editor, Javascript port of Markdown, Javascript syntax highlighter and PHP port of Markdown) into one form widget. The result is similar to stackoverflow's comment input window.
    • sfAMFDebugerPlugin: allows you to use standard Symfony Web Debug tool to optimize and trace AMF services in the same way as you debug any other Symfony application.
    • sfPaginationPlugin: provides a better and a easy way to use pagination in symfony.
    • sfJiraPlugin: PHP soap API for Jira Project Tracking system.
    • dbAmazonS3Plugin: allows you to easily move/transfer your assets to amazon s3. The main features of the plugin: task to sync /web (or subdirs) to amazon s3 bucket, helpers include_javascripts_s3/include_stylesheets_s3/image_tag_s3, ability to set specific css per environment.
  • Updated plugins
    • csDoctrineActAsSortablePlugin: created 1.2 and 1.4 branches
    • dcLDAPAbstractionPlugin: bugfix in ldapBuildmodelTask class
    • bhLDAPAuthPlugin: added a note in README about disabling CSRF, added sf 1.4 compatibility, set up trunk testing dir
    • sfWhoIsOnlinePlugin: added some basic comments to code, sfWhoIsOnlineUserTable::clearTimeouts is also available from sfWhoIsOnlineUserFacade::clearTimeouts
    • sfSolrPlugin: fixed memory exception analysing with sf1.3 and later, fixed bug and improved output of sfLuceneUpdateModelSystemTask task
    • sfPropel15Plugin: documented the isCrossRef table attributes for the YAML schema, fixed typo in forms doc, initial commit for model routes using Propel 1.5, used the new routes as default for the admin generator
    • sfUnobstrusiveWidgetPlugin: updated datepicker JS script to be able to use "minDate" and "maxDate" options
    • pmHighslideJSPlugin: fixed missing ; bug
    • ybNetworkWidgetsPlugin: first version of port select
    • sfAdminDashPlugin: moved if($user_actions) conditional into user actions partial, so that users can override user actions partial without having specified actions in yml
    • symfonyUnderControlPlugin: intercept bad tests and return status
    • sfImageTransformExtraPlugin: added a way to add custom resource locations for overlays and alpha masks, added a setting to re-configure the cache_namespace_callable, fixed in Propel you have to use accessors to get the attributes
    • sfExtjs3Plugin: added 'columns' to list attributes
    • sfSympalPlugin:
      • sfSympalCMFPlugin: fix bug where admin/sites action lists the current site everywhere
      • test: fixed theme app.yml configuration in test dir for sfThemePlugin and added some comments to the Actions test
      • changed the location of the call to the theme toolkit
      • setting the sympal "default" theme as the default theme (this will give you the sympal default theme, which you can override later)
      • theme: fixed the default theme (removed conditional code placed earlier)
      • sfSympalEditorPlugin: upgraded widget factories to jQuery ui 1.8
      • sfSympalAdminPlugin: updated menus for new naming convention
      • sfSympalEditorPlugin: finally, after much refactoring with filters, fixed the slot rendering
      • fixed proper generation of site slugs to respect symfony requirements for apps naming
      • theme loading for new sites according to new sfThemePlugin
      • fixed installer: need to download files from a new location and we need extra measures to download all of the submodules
      • fixed bug where duplicate internationalized_models config caused several critical models to not be i18n'ed
      • sfSympalAdminPlugin: moved some admin modules back into the admin plugin
      • removed a few items from the fix permissions task
      • moved sfSympalActions class file
      • removed code now that ->loadSiteTheme() as been replaced
      • sfSympalPluginManagerPlugin: improved the PluginManager test to delete the plugins that it created
      • test: adding to the sfSympalActionsTest to test for the loadSiteTheme() method
    • apostropheBlogPlugin:
      • incorporated AddThis into the blog templates
      • added hasMedia function to blogItems and added the css class to blogSlots
      • blog and event engine pages now only show published blogItems
      • enabled future publishing (start data and end date fields now use jquery date widget)
      • fixed the slug renaming functionality with a-blog-item
      • fixed default values for slot forms
      • fixed autocomplete for aBlogSingleSlot and aEventSingleSlot
      • fixed issure where selecting multiple blog items in a slot caused a doctrine sql error
      • fixed video dimensions
      • renamed all of the javascript functions to be aBlogSomething
      • added a cool beforeShow event to start end date event calendar to disable days before the start date when choosing an end date
      • apply published filter to slots
      • publish() should also set published_at to true
      • events and posts are no longer editable from the engine view
      • fixed javascript for autocomplete for single blog and event slots
      • added edit button to blog and events on the engine view
      • added task to create admin blog and event pages
      • put all of the markup for the Blog and Events slots into the slot template so it can be easily overridden
      • added autocomplete template for events
      • changed routing rules for deleting
      • delete event and post button in editView of Blog
      • change to query used in findBestEngine page
      • styled media attachments for slots
      • created a separate singleSlot template so we can create two different layouts at the project level for the two different slots if necessary
      • only show selected categories in blog sidebar
      • allow admin users to see all blog posts and items
      • added a migration method to aBlogEvents, which listens to apostrophe:migrate
      • only show relevant tags for published items on engine pages
    • apostrophePlugin: fixed onChange attribute, added the beforeShow callback to the Rich Date widget, edit = false for slot options is no longer ignored when logged in as an admin, the media repository now behaves reasonably when PDFs are uploaded to a server that can't render previews of PDFs, View more Revisions label improved to show number of total revisions at the bottom of the history browser, refactored SQL migration conveniences to aMigrate where they can be used by migration hooks in other plugins that listen to the apostrophe:migrate event
    • pmPropelEventCalendarPlugin: bugfixes and some improvements
    • sfDoctrineRestGeneratorPlugin: added the first version of the documentation
    • diemProject: dmCore: updated test project, dmCore: fixed DmBlameable relations, dmCore: fixed possible issue in record loremizer when modifying existing record, dmCore: fixed tabs, dmAdmin: fixed issue in admin generator when module name and model name are different, dmFront: fixed security issue, dmCore: upgraded jQuery UI to 1.8.1

New symfony powered websites

  • autofrage.net: (Deutsch) a Q&A plattform related to all questions concerning cars
  • Finanzwirtschafter: (Deutsch) finance portal
  • Worthidea: (English, and Spanish) website to share ideas with users and companies
  • Maki Car Rental: (Deutsch, and English) car rental company with online availability check and highly automated booking system
  • nelgargano.com: (Italian) tourism portal for Gargano, Puglia, Hotel, bed & breakfast and other

They talked about us


I often do not understand the thread selection criteria for your "Development mailing list" topic. In this issue, the thread consists of 2 posts where one assumes a bug in symfony. Huh? Not that helpful...

In the previous issues there were also some mentions of quite "useless" threads.
@Sebastian, the thread selection criteria is "pick the 3 or 4 most interesting threads".

Unfortunately the activity of dev group has been low during the last weeks and is really hard to find an interesting thread.
I thought symfony was about to take good parts from other software and leave the bad ones. That change of coding standards is disappointing me... OK for brackets, it could even save lines, but the 4-spaces indentation is just a big waste of space :-(
"curly brackets are now folded for control structures" - bad decision in my eyes. It really makes it hard to read the source code then. It will hide the structure of the code. And it's some kind of unlogical.
It will start to look like Perl code.
I agree with Zuzanna.
Folded braces make source code less readable, what will we gain by doing this?
Saving few lines doesn't really reduce project's size, but it sure reduces readabiliy.

What's the point of changing something already good?
For me folded braces make it a lot more readable. Thats just matter of taste.
I like code looking like java code :)
I prefer these standards as well. In my projects, for all coding that I did, I always followed these standards anyways. I really don't like just 2 space indentation.
Heh. It must be my birthday (actually, it isn't, still 9 days to go). I requested this some time ago.

Symfony 2 seems to strive for integration with third party code. If you want integration, it helps to have the same coding standard. And the de-facto standard in the PHP world is the PEAR/ZF one.

I don't have any strong opinions about the curly braces, but I love 4-space indentation. I just cannot see the structure of 2-space indented code. It looks too shallow. There's plenty of space for it (I'm *very* strict about the 80 characters margin).
@Javier: Ok, I understand :-)

I appreciate your hard work, keep it up!

+1 for CS.. :/ This is awfull, switching from PEAR CS to symfony CS was quiet easy but the opposite would be very hard, the code is not as readable with 4 spaces than with 2.
@all: The post (http://test.ical.ly/2010/05/11/symfony-2-now-following-the-standards-rather-than-setting-them) sums up nicely why we have switched to a standard, instead of defining our own (and I'm the first to think that the symfony coding standard was better than the PEAR/ZF standard).
I dont really care about space indent. But folded curly bracket looks so bad and unreadable for me. Is there an explanation why some people use these bracket like that ?
I don't really care about the coding standard itself - I think that "global" standardization is much more important.

Well done on changing CSs to match the ones used by PEAR and ZF!

Comments are closed.

To ensure that comments stay relevant, they are closed for old posts.