Tagged with PHP

PHP programming

Upgrading to CakePHP 3.0

I recently finished upgrading this site to CakePHP 3.0.0-dev from 2.5.5. I thought I’d share my experiences, as they might be helpful to other people attempting to update a CakePHP 2.x application to 3.0.

In terms of scale & size, this site is pretty small and simple. It has a mere 12 tables, and ~5000 lines of code including HTML, and uses 3 plugins.

Compatibility Breaks in CakePHP 3.0

There will be a number of backwards compatibility (BC) breaks in the CakePHP 3.0.0 release. I thought it might be helpful to go over some of the reasons breaks in compatibility have been made. Each time we’ve had to break compatibility with 2.x we’ve done so because the existing behaviour fell into a few categories of problems. I’ll go over a few of the bigger categories in detail.

PHP Generators - A useful example

PHP5.5 has support for generators which are a powerful language feature available in other languages like Ruby and Python. While generators in PHP are very much like their Python counterparts, I wanted to give them a spin and try a few simple but useful examples of generators in action.

Configuration in CakePHP 3.0 redux

In a previous post, I outlined some changes that would be coming for configuration in CakePHP 3.0. I’ve recently been thinking a great deal about configuration as well as building some prototype applications. I’ve come to the conclusion that configuration needed to change. Coupling all the classes to Configure while convenient and simple, had a big drawback.

New errors in PHP 5.4

I’ve been running the PHP5.4 RC builds for the last few months, and there are some interesting changes in the upcoming PHP release. On top of all the great new features coming in PHP5.4. After updating to PHP5.4-RC4, a few things that used to not trigger errors and silently do the wrong thing, now trigger notices or warnings.

Using bcrypt for passwords in CakePHP

CakePHP uses salted sha1 hashes for passwords by default, and has for a while. There has been some talk on the mailing list lately of switching the default hashing to something more secure, such as bcrypt. I think this is a great idea, and will find its way into CakePHP in a future release. Providing a reasonanle upgrade experience is the biggest problem to solve, if the default hashing strategy was to change.

CakeFest 2011 slides posted

In case you were not able to attend CakeFest 2011. I’ve posted my slides up on slideshare. The event was a great success. Thanks to Graham for organizing the event and to all the attendees. Its great to meet the community and put faces and names to irc handles and mailing list email addresses.