ZF-9092: Because parse_ini_file() interprets NULL as an empty string, Zend_Cache_Core's lifetime setting cannot be configured from an INI file.


Configuring Zend_Cache via an INI file runs afoul of parse_ini_file() - used in Zend_Config - which translates a value of NULL to an empty string. This prevents setting the Zend_Cache_Core lifetime to NULL except manually. To fix this, Zend_Cache_Core should interpret any empty value as being equivelant to NULL. This imposes no breaks in behaviour (that is intended) but will break behaviour where empty strings were used either by intent or accident. The scope of the latter is not considered, in my opinion, worth preserving since it serves no actual purpose.

On a separate note, the Zend_Cache tests have no test for a NULL value anywhere.


Patched in SVN

I'm having trouble with this patch. In development environment I use a lifetime setting of zero in the ini file.

I've spend a lot of time debugging to try and find the error I got. Seems to be my lifetime of zero in my cache.ini file. Setting it to 1 resolved this problem, but I think this isn't a proper solution.


empty("0") validates to true, it's set to NULL.

Better is: (string)intval($value) != $value