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.
Earlier today, I packaged up AssetCompress 0.17. This release has a few noteworthy features.
Cached builds in development
Historically, in development every build file would be rebuilt on every request even if the source files did not change. While this works OK if you have a few build targets, it can get pretty slow if you have many build targets, big build targets or use a pre-processor like sass. As of 0.
A few weeks back during CakeFest 2014, I had the opportunity to hunker down and get DebugKit upgraded to CakePHP 3.0. While it was less of an upgrade and more of a re-design and re-write, I think the end results justify the drastic approach I took. First, a few of the problems I was trying to solve in the new version:
1. It is hard to make DebugKit look great as it lives on the same page as your app.
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.
I recently had the opportunity to speak at PHP Conference Argentina . I’d like to thank Mariano and the other organizers for having me at the event. It was a fantastic opportunity for me to visit Buenos Aires, connect with some friends old and new, and give a new talk about my experiences working on CakePHP.
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.
The events system has become an integral part of CakePHP since its introduction in 2.1. When originally introduced, we needed to make a number of compromises in the implementation to facilitate compatibility with the code it was replacing. For 3.0, I wanted to revisit the event subsystem and try to make things more efficient and streamline the API a bit.
I really like how composer simplifies dependency management & installation. It can make applications more portable, and simpler to deploy when compared to the pear installer. Another really nice feature of composer is that you can easily install any pear package, making it perfect for installing CakePHP. While installation was simple, some extra work was required to get things up and running smoothly.
Making sure your freshly released CakePHP plugin still passes all of its tests can be a bit of a time sink. Setting up Jenkins for small project can be a big job. After I setup Jenkins once or twice, I personally longed for a simple way to get continuous integration with not much work.
Many of the web applications I build have to talk to other webservices. Sometimes those services are internal API servers, sometimes they are external. In both situations, I want a simple, easy to use client library.
For 3.0 the team and I are re-visiting how we’ll recommend installing CakePHP, and as always I wanted to try to provide context on what my thoughts are, and get some feedback on the plans.
Background & context
CakePHP is currently availiable in a few different ways. Generally people either download zip files, or clone the repository. Both of these methods provide a quick easy way to get started.
Early work has started for CakePHP 3.0, and I’ve started re-visiting how CakePHP handles configuration and bootstrapping. I want to focus on configuration for this post, as bootstrapping, while related is worthy of its own post. The goal of this post is to provide some context on the planned changes, and to get feedback on those changes. My hope is that by getting feedback early on we can avoid problems & surprises later on.
In the last article I went over the various static analysis tools I’ve found useful, and how to get them installed. For this installment, I’ll be going over how to use make to run all the tasks, and how to configure all the tools to work with Jenkins.
I’ve recently integrated static analysis tools into both my day job’s and CakePHP’s development process. Setting up static analysis tools is reasonably easy and can help you find problems before you even get to unit tests, or staging sites. They are also the ideal tool to help enforce coding standards, and best practices that can be checked by reading the code.
Myself and the rest of the CakePHP team recently embarked on a journey to refresh and redesign the CakePHP website and brand. I wanted to delve into my process and thinking around the changes.
The cakephp.org website has been around for quite sometime. Its previous incarnation served the project amazingly well.
One of the new features in CakePHP 2.1 I am excited about are view blocks and view inheritance. Both are concepts borrowed from Jinja2 and other templating systems. Template inheritance allows you to create skeleton views, and define blocks to populate that skeleton in a child template.
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.