We have added a feature I call naive type detection/casting to Zend Framework’s Zend_Config. Per default Zend_Config is not aware of types, everything is a string (except the crappy auto-detection parse_ini_file() does, but that’s another – ugly – chapter). Our patch provides an opt-in feature to detect wheither something is an integer, a string, a float or a boolean. It does that when a value is fetched, which should be the fastest way (most of configuration values are fetched one time, during a page load). The related ticket is #2312 and the latest patch is available here.
Filed under Development, PHP, Zend Framework & one comment & no trackbacks
Trackback specific URI for this entry
Wil Sinclair replys:
published on December 18th 2007, 11:35:40 amThanks for the patch! I’ll be perfectly honest- I’m still getting used to PHP’s somewhat strange (to me anyways) typing rules, but I’m looking forward to trying this out.
Reply