TAGS :Viewed: 15 - Published at: a few seconds ago
[ PHP flat file management class ]
Does anyone know of a class for managing flat file, in PHP? I am making an app that uses them, and I want to know if there is already one that I can use, without making my own.
Answer 1
Take a good look at Zend_Config and Zend_Config_Writer, components in the Zend Framework. They stand pretty much alone, so you don't need to import too many other parts of ZF outside of the loader and exception bits.
They allow you to read and write configuration data in an exported PHP array, as an INI file, as JSON, as XML or as YAML. They aren't super light weight, but they are useful, comprehensive, and more importantly, well-written and well-tested.