Description

I've been using ZF 1.8.1 for a project, today I installed the 1.8.4 release and then my application failed to start. I'm using a cache resource in my application, and I've been using the static method Zend_Cache_Backend_File::getTmpDir() to find the path to temp directory, but after the upgrade I have this exception:

Fatal error: Call to undefined method Application_Resource_Cache::_isGoodTmpDir() in /usr/share/php/Zend/Cache/Backend.php on line 177

I inspected the Zend Framework code and found out that in 1.8.1 release, the getTmpDir() was static method (as I've used it in my code), but in 1.8.4 this method is no longer static, and is calling the _isGoodTmpDir() member method. I read the release notes of 1.8.2, 1.8.3 and 1.8.4 before this upgrade and there was no mention in changing Zend_Cache API.

is it a permanent choice to make this method an instance method? because I'm using the getTmpDir() to configure settings of my cache object, before creating it. here is my code:

so , if this method will not be static, I should first create a dummy Zend_Cache object, and then use this method to find out temp directory for my real cache object. I think static approach was better.

Comments

Posted by Fabien MARTY (fab) on 2009-06-24T09:23:08.000+0000

you are right but if you don't set a cache_dir the call to getTmpDir() is automatic