Updating Zend Framework and the Implications of Caching

zf2-logo-markZend recently released Zend Framework 2.4 and with it brought fixes, enhancements, and long term support! With Zend Server it makes it very easy to update the framework installed on your system and used by default (and revert back to earlier framework versions if needed) so I am always one to try the newest released versions.

Yes… I am one of those early adopters you always hear about. Though with Zend Server and how it manages the libraries for ZF2 it really is a ‘low risk’ situation and I want my company’s software product to be used and effective in the latest version when possible. So I took the plunge and updated like I had for the past 6 updated releases of ZF2 and it had gone over flawlessly. This time… I had a bug.

Whether in my ignorance or newb-ness I attributed this to some time of backward compatibility break or change of functionality. Also, considering that IBM i and DB2 are a little different (a good different mind you) on the back end I wondered if some of the support for our beloved machine had been broken. I contacted a guru in the ZF2 world named Samsonasik. He is a fantastic coder and has helped me MANY times. I had him look at my code, the things I was doing, and see that my code worked fine in ZF 2.3.7 but broke in ZF 2.4. At the end of our session he suggested I post an issue to the GitHub repository for ZF2 and he would comment on it.

In this moment, dear reader, understand I felt like I was really helping out our IBM i community! I had ventured forth, tried something new, and found an error that couldn’t be explained by my coding! I was making sure the IBM i community had a working Zend Framework with which they could develop their applications on. I dare say I was a little proud of myself.

I posted my Issue to GitHub and the feedback was pretty quick from the developers and community. Lots of people asked about my coding or caching of the server… all presented answers came back that I had found a legitimate bug. It wasn’t until the head of the ZF2 project got on and suggested I had caching on… but it was in some of the main core files. There.. sitting in public/index.php was a line from EDPSuperLiminal that caching was still on and the culprit. I commented out this line and my code worked fine. Issue closed.

I write all this to tell you, dear reader, that you need to find a way to turn off and clear your cache when you are upgrading your framework. Save yourself some heartache and troubles and setup a plan for this so you can have an easy upgrade path on your server. Hopefully my story saved you some stress and embarrassment!

Leave a Reply