mustangostang / spyc

A simple YAML loader/dumper class for PHP
MIT License
707 stars 207 forks source link

Import #19

Closed mzhernosek closed 11 years ago

mzhernosek commented 11 years ago

Hi. How i can import files into? example: imports:

ryanuber commented 11 years ago

You would need to call a YAMLLoad on each file you want to load in.

require 'Spyc.php';
$data = Spyc::YAMLLoad('/path/to/file');

or

require 'Spyc.php';
$data = spyc_load_file('/path/to/file');

Since imports are not YAML-native, you would need to write your own YAML import logic. You could parse each file individually and use some array_merge() loops to combine them as you see fit.

Regarding this: - { resource: services.xml }, Spyc will only load YAML. You can use other PHP libraries to parse XML files.