ZF-11823: Fatal error: Undefined class constant 'CLEANING_MODE_OLD'
Description
I'm using Zend_Cache as Session Handler, which works fine. I'm not sure where this issue was introduced, but every time when the automatic_cleaning_factor will remove old keys, I'll see the following error:
Fatal error: Undefined class constant 'CLEANING_MODE_OLD' in library/Zend/Cache/Core.php on line 0 Call Stack: 1.0006 14868608 1. My_Session_SaveHandler_ZendCache->write() library/My/Session/SaveHandler/ZendCache.php:0 1.0006 14868920 2. Zend_Cache_Core->save() library/My/Session/SaveHandler/ZendCache.php:29
I'm calling Zend_Cache_core with liek the following:
public function write($id, $sessionData) {
$this->cache->save($sessionData, $id, array() , $this->maxLifetime);
return true;
}
Where $this->cache is a cache from cachemanager, in my exampel with Zend_Cache_Core as frontend and Zend_Cache_Backend_Memcache as backend.
Comments
Posted by Adam Lundrigan (adamlundrigan) on 2011-10-14T16:16:40.000+0000
I think this issue is related to ZF-11463. See this comment.
In that issue, the same sort of error manifests itself ("undefined class constant" error), and happens because the write and close session handlers are called after object destruction, and therefore the objects no longer have class constants. In the comment i've linked to above, the poster suggests a workaround which worked his case. Could you try it for your case and report back the result?
Posted by Marc Bennewitz (private) (mabe) on 2012-01-08T15:37:34.000+0000
as adam sayed it's a doublicate of ZF-11463