php / pecl-file_formats-yaml

YAML-1.1 parser and emitter
https://pecl.php.net/package/yaml
MIT License
72 stars 32 forks source link
pecl php yaml

The Yaml PHP Extension provides a wrapper to the LibYAML library.

It gives the user the ability to parse YAML document streams into PHP constructs and emit PHP constructs as valid YAML 1.1 documents.

For more information about LibYAML see http://pyyaml.org/wiki/LibYAML. For more information about YAML see http://yaml.org/

Requirements:

BUILDING ON UNIX etc.

To compile your new extension, you will have to execute the following steps:

  1. $ phpize
  2. $ ./configure [--with-yaml]
  3. $ make
  4. $ sudo make install

BUILDING ON WINDOWS

The extension provides the VisualStudio V6 project file

yaml.dsp To compile the extension you open this file using VisualStudio, select the apropriate configuration for your installation (either "Release_TS" or "Debug_TS") and create "php_yaml.dll"

After successfull compilation you have to copy the newly created "php_yaml.dll" to the PHP extension directory (default: C:\PHP\extensions).

TESTING

You can now load the extension using a php.ini directive

extension="php_yaml.[so|dll]"

or load it at runtime using the dl() function

dl("php_yaml.[so|dll]");

The extension should now be available, you can test this using the extension_loaded() function:

if (extension_loaded(yaml)) echo "yaml loaded :)"; else echo "something is wrong :(";

The extension will also add its own block to the output of phpinfo();

CONFIGURATION

ini settings: yaml.decode_timestamp=0 for no timestamp parsing yaml.decode_timestamp=1 for strtotime parsing yaml.decode_timestamp=2 for date_create parsing

yaml.decode_binary=0 for no binary decoding yaml.decode_binary=1 for base64 binary decoding

yaml.decode_php=0 for no serialized object parsing yaml.decode_php=1 for serialized object parsing

/**

/**

CREDITS

php-yaml v0.1.0 through v0.3.0 was developed by Ryusuke Sekiyama.

Starting with v0.4.0 the extension has been maintained by Bryan Davis. Development of versions v0.4.0 - v1.1.0 funded by Keynetics Inc [http://keynetics.com/].

Inspiration and some implementation details have been taken from: