@@ -11,9 +11,9 @@ |
||
11 | 11 | //documents to load |
12 | 12 | $files = ['examples/dummy.yml', 'examples/config.yml']; |
13 | 13 | |
14 | -foreach($files as $key => $fileName) |
|
14 | +foreach ($files as $key => $fileName) |
|
15 | 15 | { |
16 | - $yamlObjList[] = $yloader->load($fileName)->parse(); |
|
16 | + $yamlObjList[] = $yloader->load($fileName)->parse(); |
|
17 | 17 | } |
18 | 18 | |
19 | 19 | var_dump($yamlObjList); |
@@ -8,17 +8,17 @@ |
||
8 | 8 | * |
9 | 9 | * use as follows : "php examples/testing.php DEBUG_LEVEL YAML_FILENAME" |
10 | 10 | */ |
11 | -const JSON_OPTIONS = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION | JSON_PARTIAL_OUTPUT_ON_ERROR; |
|
11 | +const JSON_OPTIONS = JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_LINE_TERMINATORS|JSON_UNESCAPED_UNICODE|JSON_PRESERVE_ZERO_FRACTION|JSON_PARTIAL_OUTPUT_ON_ERROR; |
|
12 | 12 | |
13 | 13 | $debug = (int) (isset($argv[1]) ? $argv[1] : null); |
14 | 14 | $file = (string) (isset($argv[2]) ? $argv[2] : null); |
15 | -echo memory_get_usage() . "\n"; |
|
15 | +echo memory_get_usage()."\n"; |
|
16 | 16 | /* USE CASE 1 |
17 | 17 | * load and parse if file exists |
18 | 18 | */ |
19 | -$content = file_get_contents($file);//var_dump($content); |
|
19 | +$content = file_get_contents($file); //var_dump($content); |
|
20 | 20 | $yaml = Yaml::parse($content, 0, $debug); |
21 | 21 | |
22 | -echo memory_get_usage() . "\n"; |
|
22 | +echo memory_get_usage()."\n"; |
|
23 | 23 | // var_dump($yaml); |
24 | 24 | var_dump(json_encode($yaml, JSON_OPTIONS)); |
25 | 25 | \ No newline at end of file |