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.

Issue Type: Improvement Created: 2010-02-05T06:30:17.000+0000 Last Updated: 2010-02-22T01:33:55.000+0000 Status: Resolved Fix version(s): - 1.10.1 (10/Feb/10)

Reporter: Pádraic Brady (padraic) Assignee: Pádraic Brady (padraic) Tags: - Zend_Cache

Related issues: Attachments:


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.


Posted by Pádraic Brady (padraic) on 2010-02-06T09:14:26.000+0000

Patched in SVN

Posted by Martin Winkel (storeman) on 2010-02-22T01:33:53.000+0000

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

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.