On Fri, March 30, 2007 4:07 am, Rob Allen wrote: > Matthew Ratzloff wrote: >> >> A better solution would be to rename Zend_Config to Zend_Config_Array, >> which is a better description of what it does. Then make Zend_Config a >> top-level configuration loading class that auto-detects the appropriate >> adapter for any given file based on extension, loads all files in a >> given >> set of directories, and merges them as necessary. > > What you are calling Zend_Config, I would call Zend_Config_Loader. The > principle is fine though.
Right, but it seems like the relationships are a little strange in that case. A. Zend_Config parses an array of configuration data. Zend_Config_Ini parses Ini and Zend_Config_Xml parses XML, and both extend Zend_Config. Zend_Config_Loader handles file loading and auto-detection and will become the primary method of loading more than one file. And this is in a subdirectory. B. Zend_Config_Array parses an array of configuration data. Zend_Config_Ini parses Ini and Zend_Config_Xml parses XML, and both extend Zend_Config_Array (since ultimately they are converting the specialized format into an array). Now Zend_Config is the primary, top-level class that everyone refers to to load more than one configuration file in the Zend_Config_* space, which ultimatly also includes things like Zend_Config_Yaml and others. Option B just seems more clean to me. -Matt