Propel 1.6 is Released

Propel 1.6.0 stable is there. It’s full of new features, robust, and still fast as hell. It’s the best Propel ever. If you’ve been waiting for happiness in the ORM world, if you want web development to be fun, and if you prefer to let the computer do all the heavy duty stuff for you, you’ve got to try this new release.

Propel 1.6.0 is backwards compatible with Propel 1.4 and 1.5. It means there is no upgrade costs, just benefits. As a consequence, the 1.5 branch is no longer maintained. Switch to 1.6 to get the latest bug fixes, in addition to the new features!

New Features

And boy, those new features will ease your life a lot. The extensive list is too long to be copied in this blog post, and the Propel online guide provides extensive documentation about all of theses new features already. So here is a glimpse of what’s new in the 1.6 release:

  • Migrations: No more insert-sql calls that erase your whole database, no more manual ALTER TABLE statements. Propel migrations detect modifications in your XML schemas, and generate the SQL code to migrate the table structure, while preserving existing data. Propel also generates the SQL to rollback the migration in case of problem. Even better, Propel generates a PHP migration class, that you can put under version control, and where you can add data migration code. Migrations are dead easy to use, use vendor-specific SQL, and work even for existing projects.
  • Versionable Behavior: Did you ever dream of persisting each state of a given object in a database, just like you can do with files using Subversion or Git? Using the new versionable behavior, you can keep an audit log of all the changes to an object, revert to a previous state, get the revision history, and even compare revisions with each other. And what’s unique about the Propel versionable behavior is that it knows how to version related objects, too!
  • I18n Behavior: One model, several translations, seamlessly, that’s what this behavior provides. Multilingual applications can now adapt the content to the user locale without any boilerplate code. And Propel does it right: IDE integration is taken into account, and the retrieval of i18n objects is optimized to keep a low query count.
  • XML/YAML/JSON/CSV Parsing and Dumping: Propel 1.6 allows you to serialize and unserialize your model objects to and from your favorite format in a single method call. This feature is fully extensible, so the import/export capabilities of your object model are only limited by your imagination. Also, since YAML becomes the default string representation of Propel objects, it’s just as if you had a complete Command-Line Interface to your object model persistence!
  • Easier OR in queries: Forget orWhere(), and the inability to use generated filters when a query uses an OR. Propel 1.6 introduces the ModelCriteria::_or() method, and simplifies the writing of queries that used to be more complex in Propel 1.5.
  • Multiple Buildtime Connections: Projects using more than one database connection used to face a few cumbersome steps during the build phase. Propel 1.6 supports a buildtime-conf.xml configuration file, using the same syntax as the runtime-conf.xml file, to allow several database connections at buildtime. So a project mixing MySQL and Oracle persistences won’t have issues with the generated code anymore.
  • Support For SQL Schemas: At last, Propel supports grouping tables into database schemas in PostgreSQL, MSSQL, and MySQL. Propel also supports foreign keys between tables assigned to two different schemas. For MySQL, where “SQL schema” is a synonym for “database”, this allows for cross-database queries.
  • Virtual Foreign Keys: Propel models can now share relationships even though the underlying tables aren’t linked by a foreign key. This ability may be of great use when writing Propel code on top of a legacy database.
  • Advanced Column Types: In addition to LOB columns, Propel now supports enums, arrays, and value objects as object model properties. The database-agnostic implementation allows these column types to work on all supported RDBMS. And since code generation gives Propel a power that no other ORM has, these new column types are also available as filters in the generated query classes.
  • Table Subqueries (a.k.a “Inline Views”): The new ModelCriteria::addSelectQuery() method makes it easy to use a first query as the source for the SELECT part of a second query. This allows to solve complex cases that a single query can’t solve, or to optimize slow queries with several joins.
  • Better Pluralizer: Have you ever considered Propel as a lame English speaker? Due to its poor pluralizer, Propel used to be create bad getter method names in one-to-many relationships, especially when dealing with foreign objects named ‘Child’, ‘Category’, ‘Wife’, or ‘Sheep’. Starting with Propel 1.6, Propel adds a new pluralizer class named StandardEnglishPluralizer, which should take care of most of the irregular plural forms of your domain class names.
  • Active Record Reference Documentation: There wasn’t any one-stop place to read about the abilities of the generated Active Record objects in the Propel documentation. Since Propel 1.6, the new Active Record reference makes it easier to learn the usage of Propel models using code examples.

There are a thousand more code changes, smaller additions, backwards compatible tweaks and optimizations. All inspired by usage and real life projects. All designed to simplify your web development. All fully unit tested and already documented, as usual.

Symfony Integration

Propel 1.6 can be used right away in a Symfony 1.4 project using the sfPropel15Plugin (don’t trust the name, it bundles with Propel 1.6), and in a Symfony2 project using the PropelBundle.

Used together with the Symfony framework, Propel feels even more powerful and easy to use. All the initial configuration and setup phases are taken care of by the framework, and the Symfony Command Line Tools is an improvement on Propel’s native buildtime script.

Propel 1.6 as a Community Project

Niklas, tuebernickel, thadin, lvanderree, Crafty_Shadow, ardell, ddalmais, rozwell, oschonrock, Richtermeister, Joss, fonsinchen, paul.hanssen, lathspell, poisson, couac, vmakinen, KRavEN, in no particular order, all contributed code to the 1.6 release. There are many more who tested beta releases, opened tickets on the Propel Trac, or proofread the documentation. And even more who blogged about the new features even though the release wasn’t stable yet.

All these people show how much Propel is a community project. Thanks to all of them for their work. Without their help, Propel 1.6 wouldn’t be there today.

I also want to thank all the brave Propel users who answered questions on the Propel mailing-list and on the #Propel IRC channel. Newcomers and beta testers found a welcoming community, and that’s half of what people ask of a good Open-Source project.

Download Propel 1.6

Again, Propel 1.6 is backwards compatible with Propel 1.4 and 1.5. All you need to do to upgrade an existing project is to update your Propel version, and rebuild your project. The Propel library is available in all the usual formats:

Subversion tag

> svn checkout http://svn.propelorm.org/tags/1.6.0

Git clone

> git clone git://github.com/Xosofox/propel.git

PEAR

> sudo pear upgrade propel/propel_generator
> sudo pear upgrade propel/propel_runtime

Download

Speak About It

Propel still leverages code generation to provide a fast, professional, user- and IDE-friendly ORM to PHP. The Propel project is very much alive, and you’re going to love building applications with the new 1.6 release.

But Propel 1.6 took more than a year to complete. During this time, there was not much to talk about, so Propel needs some publicity. Don’t hesitate to leave your feedback as comments, tickets, or emails to the Propel mailing-lists.

And if you use Propel 1.6 and like it, please share your experience with your friends.

Posted by Francois Zaninotto 

14 comments

May 10, 2011
Shani Elharrar said...
Great news! I will start using it immediately :)
May 10, 2011
Loïc said...
@Shani : you were not ??

Awesome work François & all contributors !
Propel1.6 is so easy to learn and to customize thanks to behaviors that this is for me THE option for smart and quick developments when dealing with relationnal databases.
As always, the documentation is outstanding and up to date, allowing everyone to use it in all its aspects, including while development was still in progress, that's so rare that it's worth mentionning it.
I hope that some effort will be involved by propelers to write some tutorials about the integration of this release with sf2, this would surely produce a nice boost and opportunity to make Propel adopted by users that are not convinced by Doctrine2 as it is today, very verbose, complicated to configure in comparison to the way propel works today, and slower, and that matters.
Loïc

May 10, 2011
mppfiles said...
Outstanding work François!

I tried to re-install the symfony plugin (uninstall and install) but it still shows 1.5.6 on web debug. Moreover, the plugin's README (thus the plugin's page) looks outdated.
How can I be sure that it's REALLY 1.6?
Many thanks to you, and kudos to everybody involved!

May 10, 2011
mppfiles said...
For the dumb people like me: if you already have the sfPropel15Plugin installed, follow these steps:

* ./symfony plugin:uninstall sfPropel15Plugin
=> symfony plugin:install sfPropel15Plugin doesn't work, neither plugin:upgrade

* just follow the instructions on the INSTALL.md here: https://github.com/fzaninotto/sfPropel15Plugin

The installation is a bit trickier but it works:
git clone git://github.com/fzaninotto/sfPropel15Plugin.git -b 1.6 => failed, just used https:// instead of git:// because of network limitations.

Now I have Propel Version: 1.6.1-dev :D

May 10, 2011
marksteve said...
Awesome work! Backwards-compatibility ftw! I'll definitely upgrade. Btw. "Versionable Behavior" link in your post is wrong. :)
May 10, 2011
@marksteve: Thanks, fixed!
May 10, 2011
xplo said...
i ve been using propel 1.6dev with symfony plugin on several project and it just work without breaking anything and add those features :)

great work again.

May 11, 2011
Mario said...
@Francois, could you update the sfPropel15Plugin in http://www.symfony-project.org/plugins/ to have this latest version?

Thanks for all the hard work!

May 11, 2011
Mario said...
Or at least, can you put a link where it's possible to download the sfPropel15Plugin, bundled with all the dependencies, and of course with Propel 1.6.

The problem is that is very hard to me to install the plugin using git and svn, because of connection problems. And I'm sure I'm not the only one with problems like these.

Thanks again!

May 12, 2011
@Francois, could you generate new pear package for standard method of installation ./symfony plugin:install sfPropel15Plugin .

Lots of people I know with Me are using only this method in production environment.

Thanks for all the hard work!

May 24, 2011
Manel Monguilod said...
Thank you very much François!!!!!

I've started using it in symfony projects and is awesome.

Thanks for all the good work.

Jul 06, 2011
Aug 10, 2011
Paul B said...
Awesome work, thanks so much. I loved propel from 1.2 but since 1.5 with the fluent query interface. Oh my god!!!! Anyway, just a small comment - it looks like the symfony plugin:install appproach still loads in propel1.5. Do we just dump 1.6 inside the plugin to upgrade or is there more to it?
Oct 31, 2011
ernest said...
I need to know how to make Propel 1.6 translates the relationships between tables in different schemas in oracle.

Leave a comment...