Love Fuel?    Donate

Thoughts, ideas, random notes, ramblings...

Anything about PHP in general, and FuelPHP in particular. Sometimes serious, sometimes with a big wink. But always with a message. Do you have an opinion about an article? Don't forget to comment!

It's been a few months since you've seen something official from us, so it's about time. Here's FuelPHP version 1.6.

This release brings some big changes and improvements, so don't forget to read on, and check the changelog before you upgrade an existing application. Be sure to checkout the v1.6 Changelog, as it also lists all items deprecated in v1.5, which are now removed.

Composer

This release will officially introduce Composer to FuelPHP for dependency and package management. For your convinience, we have included composer.phar in both the zipfile and the fuel/fuel repository, so you don't have to install it separately. After installation, make sure you run Composer ( php composer.phar update ) to pull in all dependencies. Not everything has been moved to composer, the current packages will migrate one at the time.

We will also use Composer to introduce FuelPHP version 2 libraries into version 1 releases, which will allow us to test them in real environments, and also design a facade for them, which will become the version 1 compatibility interface when we release version 2. In this release, we have introduced the Upload library, and provided a Facade which implements the current version 1 API, so it can be used without impact to existing applications.

We now use Composer to install Monolog, which had replaced the Log class in version 1.5. Moving that into a Log package has turned out to be a big mistake, so in this release the package is no longer present, and the Log facade has moved back into the core. This has proven to be more stable then the ill conceived Log package.

Backward compatibility

Some classes internal to the framework were violating our own rules for naming classes. These have been corrected, which unfortunately means that if you have used them in your code, you will now get a "class not found" exception on these classes. For this reason, we have decided not to change "ViewModel" to "Viewmodel", as it is used very often. You might also have to check classes you have extended in your application. The Auth classes ("Simpleauth" instead of "SimpleAuth") are a good example.

The ORM behaviour with regards to relation assignments has been changed. Now, when you do an unset(), an assignment to NULL (for singular relations) or array() (for many relations), or you assign a new object to an existing relation, the previous relation will be unset. Regardless of whether you had fetched that relation or not. This might impact your application if you have used this 'anomaly' as a shortcut to adding additional objects to an existing relation!

Also, we have removed the ORM model methods calls find() (with no arguments) or find(null). Both these would return a Query object instead of a result, which would be especially problematic if you were trying to find using a variable, and that variable contained null. This will now throw an Exception. If you need a Query object, for example so you can chain methods on it, use the query() method instead.

Important improvements

The changelog for this version is way to long to repeat here, but I like to highlight some of the improvements in this release.

There's a new Auth driver set called Ormauth, which uses a database backend, and provides much more granular ACLs then Simpleauth.

The ORM has been improved a lot. Most of the open issues have been resolved, and extra functionality has been added. One that I want to highlight is support for Temporal models, for which our ORM is the first PHP ORM that supports this feature, courtesy of Steve "uru" West. A temporal model introduces automatic versioning to your models. Every time you save an object, a new version of it is created, giving you a complete audit trail of all changes. They introduce additional model methods to allow you do access the saved history. There is full relation support for these models.