Greetings Adler,
Indeed, I very much agree that providing an option that does not require the user to have special mods installed is a good idea; not everyone will have the capability to add PHP mods to the server they are working with. However, in my own informal tests I found that the available "raw PHP code" options for parsing and writing yaml files were no where near as fast as the syck library, so I assert that the syck method should be preferred within the code (unless, of course, something even better becomes available). If I were writing this class with the dual implementation, my approach would be to implement the Yaml parser and writer in a separate class from Config_Yaml, then detect if syck is available, using it if so, or instantiating the Yaml parser class if not. In this way the Config_Yaml class may be kept as light as possible while the concerns of the Config object creation and yaml file manipulations are kept separate but loosely coupled.
Do you plan on writing the Config_Yaml_Writer class as well? If so, I've implemented a functionally complete version of this as well that you might draw upon:
http://www.emanaton.com/code/php/zendconfigwriteryml
Please let me know if I may be of any assistance!
Regards,
Sean P. O. MacCath-Moran
www.emanaton.com
The knack here is to decide if we need to write a native PHP implementation from scratch or if we can leverage an extension.