@@ 85-95 (lines=11) @@ | ||
82 | * |
|
83 | * @return array|boolean PHP array or false on error |
|
84 | */ |
|
85 | public static function read($yamlFile) |
|
86 | { |
|
87 | try { |
|
88 | $yamlString = file_get_contents($yamlFile); |
|
89 | $ret = VendorYaml::parse($yamlString); |
|
90 | } catch (\Exception $e) { |
|
91 | static::logError($e); |
|
92 | $ret = false; |
|
93 | } |
|
94 | return $ret; |
|
95 | } |
|
96 | ||
97 | /** |
|
98 | * Save a PHP array as a YAML file |
|
@@ 196-206 (lines=11) @@ | ||
193 | * |
|
194 | * @return array|boolean PHP array or false on error |
|
195 | */ |
|
196 | public static function readWrapped($yamlFile) |
|
197 | { |
|
198 | try { |
|
199 | $yamlString = file_get_contents($yamlFile); |
|
200 | $ret = static::loadWrapped($yamlString); |
|
201 | } catch (\Exception $e) { |
|
202 | static::logError($e); |
|
203 | $ret = false; |
|
204 | } |
|
205 | return $ret; |
|
206 | } |
|
207 | ||
208 | /** |
|
209 | * Save a PHP array as a YAML file with a php wrapper |