PHP: YAML polyfill library

I'm a big fan of YAML and use it extensively with PHP. The native YAML extension requires the ability to install a system-level library, which isn't always possible in shared hosting or restricted environments. To address this, I wrote a pure-PHP polyfill that provides the same functionality without requiring any system-level dependencies. The polyfill is a single file with no dependencies. This makes it very easy to install.

Simply require_once() the polyfill to gain access to the yaml_parse() and yaml_emit() functions. The polyfill also plays nicely with the native extension, so it's safe to include in your project even when the native YAML library is already installed.

Tags:
Leave A Reply
All content licensed under the Creative Commons License