I just this morning pushed a new version of Zend DevZone, and the biggest change was a move to Zend Framework version 1.9.5 – Why is this important? Because it was previously running v1.0.1 (*gasp*), and I wanted to tell the story of the work it took to upgrade.
It turns out, that the work was minimal. Given how many versions had slipped by while DevZone remained oblivious to the passing of time. I assumed I was going to have all sorts of issues.
In the end, only a couple small ones presented themselves, and I was very impressed therefore with how backward compatible the framework has been. I used the timetested method of: “Drop the new software in place, see what breaks”
*1.* Immediately the whole website stopped working. Seems this was caused by Zend_Cache, and a very descriptive error message told me exactly what the problem was. The codebase was passing in arrays/etc into the cache, and it needed therefore an option set to tell it to automatically serialize any data for me. The name of that option had changed from @automaticSerialization@ to @automatic_serialization@, an easy fix.
*2.* One of my controllers stopped working. In investigating, I found that it was one where a hack had been applied to check that was data was correct before allowing the controller to execute. This hack, involved overriding the constructor of the Controller, to check it’s data, and then call the parent’s constructor. The problem was the method signature of the parent’s constructor had changed, and so it was failing. A quick fix was to unhack that, and instead do the sanity checking inside of the init() method, as ZF would properly prefer you to do.
*3.* A few actions scattered across DevZone stopped working. It turns out this was due to a change in ZF around v1.5, where camelCase actions stopped being supported, unless you used a word separator in the URL. No worries, easy enough to change any camelCase’d actions to just being lowercase
*4.* And finally, not really a problem, but where the code was using filters, it was using the @Zend_Filter::get@ method, that was tossing PHP Notice errors as ZF had deprecated that method and renamed it to: @Zend_Filter::staticFilter@ . I could have just ignored that, as the code still worked, but it was an easy search-replace to update the links.
The whole process took about 15 minutes to get everything fixed and working again, the next 2 hours were me just obsessively testing again and again, because I assumed I had to have missed something, that it couldn’t have been that easy.