Description

Comments

The knack here is to decide if we need to write a native PHP implementation from scratch or if we can leverage an extension.

Posted by Wil Sinclair (wil) on 2008-04-18T13:12:01.000+0000

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Posted by Wil Sinclair (wil) on 2008-06-09T12:45:17.000+0000

Is this something that we'd want to do? It should be submitted as a proposal in any case. If we'd like to do it, should we only do the subset of YAML that we's need for config?

Posted by Rob Allen (rob) on 2008-06-09T12:51:45.000+0000

I assumed we did as you reported it :)

Some people like Yaml, so I can see the usefulness of a Zend_Config_Yaml. I suspect it would be fairly slow though, so caching tips would need to be documented.

I don't know enough about Yaml to know how much of the spec would need to be supported and don't have enough interest in the format to develop it myself. More than happy to review should someone step up to the plate with a class and unit tests :)

Posted by Rob Allen (rob) on 2008-06-09T12:57:34.000+0000

A proposal would be good as it'll provide more community feedback, so postponing this issue until then.

Posted by Wil Sinclair (wil) on 2009-01-14T14:54:29.000+0000

I will address the issues with YAML as a serialization/configuration format in PHP on the issues that I have just linked.

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://emanaton.com/code/php/…

I think your aproach is very cool. Checking if the user has the extension enabled and if so use it, if not use a pure PHP implementation. The pure PHP implementation of course is slower than the one that use syck.

I take a look in your work and it is very good but to put a code in the ZF we have to agree with the CLA. This is the reason i am writing a code from scratch and that is the reason too we cannot use the symfony YAML code.

Actually, I faxed in a CLA some time ago and never heard back. I've reached the point where there are several issues I'd REALLY like to start contributing solutions for to the project, but cannot since the CLA has not be responded to.