23 global $wgTranslateYamlLibrary;
25 switch ( $wgTranslateYamlLibrary ) {
28 $previousValue = ini_set(
'yaml.decode_php',
false );
29 $ret = yaml_parse( $text );
30 ini_set(
'yaml.decode_php', $previousValue );
31 if ( $ret ===
false ) {
33 throw new InvalidArgumentException(
'Invalid Yaml string' );
38 $yaml = spyc_load( $text );
40 return self::fixSpycSpaces( $yaml );
42 throw new MWException(
'Unknown Yaml library' );