xref: /plugin/statistics/vendor/mustangostang/spyc/README.md (revision d5ef99ddb7dfb0cfae33e9257bd1d788f682c50f)
1*d5ef99ddSAndreas Gohr**Spyc** is a YAML loader/dumper written in pure PHP. Given a YAML document, Spyc will return an array that
2*d5ef99ddSAndreas Gohryou can use however you see fit. Given an array, Spyc will return a string which contains a YAML document
3*d5ef99ddSAndreas Gohrbuilt from your data.
4*d5ef99ddSAndreas Gohr
5*d5ef99ddSAndreas Gohr**YAML** is an amazingly human friendly and strikingly versatile data serialization language which can be used
6*d5ef99ddSAndreas Gohrfor log files, config files, custom protocols, the works. For more information, see http://www.yaml.org.
7*d5ef99ddSAndreas Gohr
8*d5ef99ddSAndreas GohrSpyc supports YAML 1.0 specification.
9*d5ef99ddSAndreas Gohr
10*d5ef99ddSAndreas Gohr## Using Spyc
11*d5ef99ddSAndreas Gohr
12*d5ef99ddSAndreas GohrUsing Spyc is trivial:
13*d5ef99ddSAndreas Gohr
14*d5ef99ddSAndreas Gohr```php
15*d5ef99ddSAndreas Gohr<?php
16*d5ef99ddSAndreas Gohrrequire_once "spyc.php";
17*d5ef99ddSAndreas Gohr$Data = Spyc::YAMLLoad('spyc.yaml');
18*d5ef99ddSAndreas Gohr```
19*d5ef99ddSAndreas Gohr
20*d5ef99ddSAndreas Gohror (if you prefer functional syntax)
21*d5ef99ddSAndreas Gohr
22*d5ef99ddSAndreas Gohr```php
23*d5ef99ddSAndreas Gohr<?php
24*d5ef99ddSAndreas Gohrrequire_once "spyc.php";
25*d5ef99ddSAndreas Gohr$Data = spyc_load_file('spyc.yaml');
26*d5ef99ddSAndreas Gohr```
27*d5ef99ddSAndreas Gohr
28*d5ef99ddSAndreas Gohr## Donations, anyone?
29*d5ef99ddSAndreas Gohr
30*d5ef99ddSAndreas GohrIf you find Spyc useful, I'm accepting Bitcoin donations (who doesn't these days?) at 193bEkLP7zMrNLZm9UdUet4puGD5mQiLai
31