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.


Comments (Login to leave comments)
I.e. did you move to Zend_Application, Zend_Layout, ViewRenderer etc? B.C. is handled quite good in zf, but the way you structure your application has quite often changed.
No, there aren’t any Zend_Test tests for DevZone. It’s a rather old codebase that I’m (slowly) trying to bring up to a more modern age. I also didn’t run into any autoload issues (which supposedly changed) because DZ doesn’t use autoload.
No, you are correct. This was just making an old codebase compatible. It hadn’t been upgraded in so long, that there was a concern that it would be a painful process just to upgrade, let alone restructure. So the upgrade hadn’t happened. And kept not happening, and as you know, the longer it goes, the more concern that something major would break, etc.
I finally got tired while working on some new features, of not being able to use some of the newer parts of ZF, so I bit the bullet and dropped it in place, and was quite surprised and pleased that the transition was so painless. Matthew was glad to hear it as well :)
I'm usig ZF since version 1.5.x. And I can tell you, there are some BC issues. Even more than I would like to see.
Could you share with us how many hits devzone gets per day and is the ZF installation custom tweaked in a certain to handle huge load specifically for DevZone ?
Is it running on a dedicated server with lots of ram ?
Any other good-to-know details ?
Slavi
Actually, I’m not sure how much ‘stats’ I’m allowed to share or not :) I can say that as far as I know, it’s the biggest PHP website (traffic wise) other than PHP.net.
It’s actually not on a dedicated server though. It’s on a pool of multiple servers, that are all shared among the other websites that Zend hosts as well. No tweaks in the ZF installation though. Most of the ‘handling the traffic’ is just via doing decent amounts of caching via Zend_Cache