Monday, January 19, 2009

Call the expert: Using a custom version of Doctrine

Now that the release of Doctrine 1.1 right around the corner their has been a bit of noise about how users can use 1.1 instead of the default bundled 1.0.
With sfDoctrinePlugin it is easy to swap out the version of Doctrine used by simply changing one configuration value.
Below you will find an example of how you can configure sfDoctrinePlugin to use a different version of Doctrine, for example 1.1.
First we need to check out the version of Doctrine we want to use into lib/vendor/doctrine:$ cd lib/vendor
$ svn co doctrine
Now we can configure the sfDoctrinePlugin to use that version of Doctrine instead of the one that comes bundled with the plugin. In your ProjectConfiguration::setup() method you need to change the value of the sfDoctrinePlugin_doctrine_lib_path with sfConfig, like the following:public function setup()
sfConfig::set('sfDoctrinePlugin_doctrine_lib_path', sfConfig::get('sf_lib_dir') . '/vendor/doctrine/Doctrine.php');
Now you can enjoy the great features of Doctrine 1.1 without too much work. You can check out what is new in Doctrine 1.1 by reading the upgrade file.

The “Practical symfony” book is now on sale

Two years after the publishing of “The Definitive Guide to symfony” book, I am happy to announce that the Jobeet tutorial is now available as a printed book: “Practical symfony“.

During the last two weeks, I have updated and enhanced the Jobeet tutorial based on the feedback from the community. I have also updated the screenshots to reflect the new Jobeet design. The “Practical symfony” book is the printed version of this tutorial and as such covers the symfony 1.2 version.

The book is available in two editions: Propel and Doctrine. You can already buy the Propel version. Jon is working on the Doctrine version and the book will be available very soon.

The book content is the same as the one available on the website. The only differences are the table of contents and the day 24 cross-references, where all links have been converted to page references.

If you want to read the Jobeet tutorial comfortably in the train or in your bed, or if you simply want to support the symfony project documentation effort, you can buy the book on

A week of symfony #107 (12->18 january 2009)

Symfony development continues at full pace with more than 230 changesets in just one week. Symfony 1.3 was the most updated version, including its Propel and Doctrine plugins. In addition, Jobeet tutorial was highly updated, 10 new plugins were published and tens of post about symfony were published around the world.

Development mailing list

Development highlights

  • r14660: [1.3] updated doctrine svn:externals to version 1.1
  • r14684: [1.3] made autoloaders case insensitive
  • r14688: [1.3] updated unit test bootstrap script to check for an active configuration (i.e. if called from a task)
  • r14689: [1.2, 1.3] fixed simple autoload unregister not changing registered flag
  • r14691: [1.3] added reloadAutoload method to base task
  • r14692: [1.3] updated generate:project task to generate a relative path to the core autoloader when symfony is nested within the project directory
  • r14697: [1.3] added array access + call to sfContext
  • r14698: [1.3] added $request to preExecute() and postExecute()
  • r14699: [1.3] added parsing of request content as put parameters
  • r14700: [1.3] added sfMailer + sfSwiftPlugin + tests
  • r14701: [1.3] updated core autoload
  • r14730: [1.1, 1.2, 1.3] fixed discrepancy in embedFormForEach function signature
  • r14776: [1.3] added registration of autoloadAgain when in debug mode without registering different methods on the same autoload class
  • r14829, r14830, r14831: [1.1, 1.2, 1.3] fixed notice in sfPearRestPlugin
  • r14852: [1.1, 1.2, 1.3] fixed sfForm::offsetUnset doesn’t properly unset private members
  • sfDoctrinePlugin:
    • r14698: [1.3] added $request to preExecute() and postExecute()
    • r14702, r14703: [1.3] updated test fixtures
    • r14779, r14780: [1.2, 1.3] fixes regression in sfDoctrinePager and adds additional coverage to tests
    • r14782: [1.2, 1.3] adding coverage for unique columns
    • r14783: [1.2, 1.3] Fixes _list_td_tabular.php using wrong classname
    • r14784: [1.2, 1.3] Fixes renderFormTag() to allow custom method
    • r14793: [1.2, 1.3] Fixes regression with sfDoctrinePager and the use of setQuery()
    • r14815: [1.2, 1.3] Fixes issue with wrong option being passed to insert sql task
    • r14816: [1.2, 1.3] Fixes bug where 404 is not thrown when no records are found
  • sfPropelPlugin:
    • r14691: [1.3] added reloadAutoload method to base task
    • r14698: [1.3] added $request to preExecute() and postExecute()
    • r14728: [1.1, 1.2, 1.3] fixed foreign keys are assumed with column name “ID” in auto generation of forms
    • r14731: [1.3] moved contents of config.php into configuration class
    • r14732: [1.3] removed unnecessary conditional around inclusion of behavior file
    • r14733: [1.3] added IS_I18N peer constant
    • r14770: [1.3] fixed coding standards in inheritance objects
    • r14783: [1.2, 1.3] Fixes _list_td_tabular.php using wrong classname
    • r14784: [1.2, 1.3] Fixes renderFormTag() to allow custom method
    • r14788: [1.3] added isToString column attribute to object builder, generation of __toString() magic method
  • Updated dwhittle branch: added array access + call to sfContext, removed sfContext::getMailer in favor of call, added $request to preExecute() and postExecute(), added parsing of request content as put parameters, added sfMailer base class, added initial commit of sfSwiftPlugin, updated doctrine externals to 1.1 for symfony 1.3, cleaned up doctrine test
  • …and many other changes

Development digest: 237 changesets, 44 defects created, 26 defects closed, 6 enhancements created, 3 enhancements closed, 8 documentation defects created, 18 documentation defects closed and 27 documentation edits.

Book and documentation



  • New plugins
    • sfGenExtraPlugin: adds extra components to work with Symfony’s generated forms (3 way sort on admin generated forms, filter on a range of numbers instead of exact values, validate a field against a constant value)
    • sfGuardHardenedPlugin: hardened version of sfGuard to avoid dictionaries attacks and sniffing tools
    • sfCliPlugin: allows to execute the symfony commands on a web console
    • sfWorkerPlugin: manage worker from symfony requests. Workers as in external process which may be longer than a single HTTP request
    • swDoctrineAssetsLibraryPlugin: a Doctrine version of the sfAssetsLibraryPlugin
    • QRcodePlugin: generates QR code image
    • sfEventDeferrerPlugin: provides the mechanisme to defer sfEvent triggering
    • sfUnobstrusiveWidgetPlugin: packages useful widgets for symfony
    • sfMultisiteThemePlugin: allows a site owner to have one or more domains pointing to one Symfony project, but allows them to set up different layouts(themes) for each URL. Allowing the same content on each site
    • sfEditTemplatePlugin: provides modules to edit template files in your symfony projects
  • Updated plugins
    • sfGravatarPlugin: added symfony 1.2 compatibility, updated default gravatar image which looked ugly
    • sfPropelActAsCommentableBehaviorPlugin: created 1.0 branch of the plugin for sf 1.0
    • sfDateTime2Plugin: fixed a roundup issue in sfDate::diff()
    • sfExtjsThemePlugin: changed so that params:field_type would also work for datastore, modified onLinkClick method to use the new default tabpanel, modified edit cancel button to close the tab, modified edit save button to update the list grid, initial import of working ExtjsGeneratorPlugin under symfony 1.2
    • limexPlugin: corrected a bogus path, added required methods to functional test case
    • swToolboxPlugin: added swValidatorTrilean (true, false and null), allow to add specific raw SQL code into Doctrine Query
    • sfDatagridPlugin: updated README, add the column comparator options for the datagridPropel, change the default text in english by default
    • sfWebRPCPlugin: debugging IXR_library, added makefile to package easily, added documentation, fixed a bug in IXR_Library
    • sfSuperCachePlugin: added ability to preserve some HTTP headers when check_lifetime is set to true. That way, client-side cached actions live well with the plugin
    • sfSocialPlugin: added count of unread messages, fixed bug in $sfSocialMessage->read(), implemented sfSocialEvent module, added some unique keys to schema.yml, implemented sfSocialContact module, updating sfGuardSecurityUser
    • sfShibbolethPlugin: added agilbert branch, added sfShibbolethUser module as a password-less alternative to sfGuardUser module, auto registration of routing rules added, updated the processForm action with a random password generator
    • bhLDAPAuthPlugin: untested recursive group checking, squelch adLDAP warning
    • sfPropelActAsCommentableBehaviorPlugin: upgraded plugin to symfony 1.2, moved plugin’s trunk to a dedicated branch
    • sfMicroBlogPlugin: added a getInstance()
    • ckWebServicePlugin: updated README, updated package.xml for version 2.2.2, migrated project fixture to sf1.2, replaced config.php with ckWebServicePluginConfiguration class, created tag for version 3.0.0, applied major refactoring to use annotations instead of doc tags where possible, added support to add methods to different webservices, refactored ckWebServiceGenerateWsdlTask to support new features of ckWsdlGenerator, SoapHandler generation is no longer optional, result adapter module configuration is no longer overwritten, merged recent changes to ckWebServiceGenerateWsdlTask and test fixture updates from 1.2 branch, disabled debug option in ckWebServiceGenerateWsdlTask, removed obsolete autoload registration, merged recent changes from 1.1 branch to provide consistent interface, moved getPropertyStrategy() from ckXsdComplexType to ckAbstractPropertyStrategy, extended functionality of property strategies

Some new symfony powered websites

  • (English/Norwegian/Swedish/Danish) a film price comparison site

They talked about us