Closed ezimuel closed 5 years ago
@mustangostang is this library still maintained? I need a light library to read YAML files. Let me know, thanks!
It's kinda on auto-pilot at the moment. I do have write access and this looks like a reasonable, non-breaking, tested update to me. Gonna merge and tag. 👍
Thanks @jackmcdade.
agreed there! thanks @jackmcdade and @ezimuel!
@jackmcdade You released this with tag 06.2
(you forgot a dash). Moreover, I guess this new release should be 0.6.3
since 0.6.2 has been released Feb 24, 2017.
Wow, really botched that one. My apologies, sorting it out now.
@jackmcdade thanks for your fast response! I really appreciate that.
@jackmcdade and @mustangostang the tag 0.6.3 has been released but packagist.org is not yet updated. Can you check please? Thanks!
Added the conversion of an empty YAML hash
{}
into an empty object usingnew stdClass()
. This is needed if you want to differentiate an empty array[]
from an empty hash{}
. At the moment the two items are converted into array. I need this feature in order to convert a YAML file into a JSON, and I have empty objects ({}
). A possible way to accomplish this is to use an emptystdClass()
value, as discussed here.I added a public option
Spyc ::setting_empty_hash_as_object
to enable or disable this feature (false
by default).I changed the static functions
YAMLLoad
andYAMLLoadString
to allow an optional parameter, as follows:This can facilitate the settings of the Sync properties. With this PR now you can set this option (also
setting_dump_force_quotes
andsetting_use_syck_is_possible
) as follows:I also provided a
ParseTest::testElementWithEmptyHash
unit test.