|
@@ -8,17 +8,17 @@ |
|
|
block discarded – undo |
|
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
|
19
|
$content = file_get_contents($file); |
|
20
|
20
|
$yaml = Yaml::parse($content, 0, $debug); |
|
21
|
21
|
|
|
22
|
|
-echo memory_get_usage() . "\n"; |
|
|
22
|
+echo memory_get_usage()."\n"; |
|
23
|
23
|
|
|
24
|
24
|
print_r(json_encode($yaml, JSON_OPTIONS)); |
|
25
|
25
|
\ No newline at end of file |
Please login to merge, or discard this patch.