Chargement en cours .gitattributes +1 −1 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff * text=auto !eol demo/yaml_boucle_data.html -text inc/sfyaml.php -text inc/yaml.php -text inc/yaml_sfyaml.php -text inc/yaml_to_array.php -text lang/paquet-yaml.xml -text lang/paquet-yaml_de.php -text Chargement en cours inc/yaml_libyaml.php→inc/libyaml.php +2 −8 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -17,7 +17,7 @@ if (!defined('_ECRIRE_INC_VERSION')) { * @return string * Chaîne YAML construite. */ function yaml_libyaml_encode($structure, $options = array()) { function libyaml_yaml_encode($structure, $options = array()) { // Traitement des options if (!empty($options['indent']) and is_int($options['indent'])) { Chargement en cours @@ -42,13 +42,7 @@ function yaml_libyaml_encode($structure, $options = array()) { * @return bool|mixed * Structure PHP produite par le parsing de la chaîne YAML. */ function yaml_libyaml_decode($input, $options = array()) { function libyaml_yaml_decode($input, $options = array()) { return yaml_parse($input,-1); } function libyaml_tag_inclure($filename) { // De façon récursive on remplace le nom du fichier YAML à inclure par } inc/yaml_sfyaml.php→inc/sfyaml.php +7 −3 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -18,7 +18,7 @@ if (!defined('_ECRIRE_INC_VERSION')) { * @return string * Chaîne YAML construite. */ function yaml_sfyaml_encode($structure, $options = array()) { function sfyaml_yaml_encode($structure, $options = array()) { require_once _DIR_PLUGIN_YAML . 'sfyaml/sfYaml.php'; require_once _DIR_PLUGIN_YAML . 'sfyaml/sfYamlDumper.php'; Chargement en cours Chargement en cours @@ -54,7 +54,7 @@ function yaml_sfyaml_encode($structure, $options = array()) { * @return bool|mixed * Structure PHP produite par le parsing de la chaîne YAML. */ function yaml_sfyaml_decode($input, $options = array()) { function sfyaml_yaml_decode($input, $options = array()) { require_once _DIR_PLUGIN_YAML . 'sfyaml/sfYaml.php'; require_once _DIR_PLUGIN_YAML . 'sfyaml/sfYamlParser.php'; Chargement en cours @@ -66,10 +66,14 @@ function yaml_sfyaml_decode($input, $options = array()) { try { $parsed = $yaml->parse($input); } catch (Exception $exception) { // On garde la compatibilité ascendante avec l'ancien argument $show_error qui a été remplacé par $options. // On garde la compatibilité ascendante avec l'ancien argument $show_error qui a été remplacé par $options // mais on inverse la valeur par défaut. if ((is_bool($options) and $options) or (!empty($options['show_error']))) { throw new InvalidArgumentException(sprintf('Unable to parse string: %s', $exception->getMessage())); } // Pour compenser l'absence par défaut d'erreurs, on loge l'erreur dans les logs SPIP. spip_log("Erreur d'analyse YAML : " . $exception->getMessage(), 'yaml' . _LOG_ERREUR); } return $parsed; Chargement en cours inc/yaml_spyc.php→inc/spyc.php +2 −2 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -20,7 +20,7 @@ require_once _DIR_PLUGIN_YAML . 'vendor/autoload.php'; * @return string * Chaîne YAML construite. */ function yaml_spyc_encode($structure, $options = array()) { function spyc_yaml_encode($structure, $options = array()) { // Traitement des options if (empty($options['indent']) or (isset($options['indent']) and !is_int($options['indent']))) { Chargement en cours @@ -47,7 +47,7 @@ function yaml_spyc_encode($structure, $options = array()) { * @return bool|mixed * Structure PHP produite par le parsing de la chaîne YAML. */ function yaml_spyc_decode($input, $options = array()) { function spyc_yaml_decode($input, $options = array()) { return Spyc::YAMLLoadString($input); } inc/yaml_symfony.php→inc/symfony.php +6 −6 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -22,7 +22,7 @@ use Symfony\Component\Yaml\Exception\ParseException; * @return string * Chaîne YAML construite. */ function yaml_symfony_encode($structure, $options = array()) { function symfony_yaml_encode($structure, $options = array()) { // Traitement des options du dump if (empty($options['inline']) or (isset($options['inline']) and !is_int($options['inline']))) { Chargement en cours Chargement en cours @@ -55,17 +55,14 @@ function yaml_symfony_encode($structure, $options = array()) { * @return bool|mixed * Structure PHP produite par le parsing de la chaîne YAML. */ function yaml_symfony_decode($input = true, $options = array()) { function symfony_yaml_decode($input = true, $options = array()) { $parsed = false; // Traitement des options du parsing. $flags = 0; // if (!empty($options['include'])) { // $flags = Yaml::PARSE_CUSTOM_TAGS; // } if (isset($options['flags']) and is_int($options['flags'])) { $flags = $flags | $options['flags']; $flags = $options['flags']; } try { Chargement en cours @@ -74,6 +71,9 @@ function yaml_symfony_decode($input = true, $options = array()) { if ((is_bool($options) and $options) or (!empty($options['show_error']))) { printf('Unable to parse the YAML string: %s', $exception->getMessage()); } // Pour compenser l'absence par défaut d'erreurs, on loge l'erreur dans les logs SPIP. spip_log("Erreur d'analyse YAML : " . $exception->getMessage(), 'yaml' . _LOG_ERREUR); } return $parsed; Chargement en cours Chargement en cours
.gitattributes +1 −1 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff * text=auto !eol demo/yaml_boucle_data.html -text inc/sfyaml.php -text inc/yaml.php -text inc/yaml_sfyaml.php -text inc/yaml_to_array.php -text lang/paquet-yaml.xml -text lang/paquet-yaml_de.php -text Chargement en cours
inc/yaml_libyaml.php→inc/libyaml.php +2 −8 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -17,7 +17,7 @@ if (!defined('_ECRIRE_INC_VERSION')) { * @return string * Chaîne YAML construite. */ function yaml_libyaml_encode($structure, $options = array()) { function libyaml_yaml_encode($structure, $options = array()) { // Traitement des options if (!empty($options['indent']) and is_int($options['indent'])) { Chargement en cours @@ -42,13 +42,7 @@ function yaml_libyaml_encode($structure, $options = array()) { * @return bool|mixed * Structure PHP produite par le parsing de la chaîne YAML. */ function yaml_libyaml_decode($input, $options = array()) { function libyaml_yaml_decode($input, $options = array()) { return yaml_parse($input,-1); } function libyaml_tag_inclure($filename) { // De façon récursive on remplace le nom du fichier YAML à inclure par }
inc/yaml_sfyaml.php→inc/sfyaml.php +7 −3 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -18,7 +18,7 @@ if (!defined('_ECRIRE_INC_VERSION')) { * @return string * Chaîne YAML construite. */ function yaml_sfyaml_encode($structure, $options = array()) { function sfyaml_yaml_encode($structure, $options = array()) { require_once _DIR_PLUGIN_YAML . 'sfyaml/sfYaml.php'; require_once _DIR_PLUGIN_YAML . 'sfyaml/sfYamlDumper.php'; Chargement en cours Chargement en cours @@ -54,7 +54,7 @@ function yaml_sfyaml_encode($structure, $options = array()) { * @return bool|mixed * Structure PHP produite par le parsing de la chaîne YAML. */ function yaml_sfyaml_decode($input, $options = array()) { function sfyaml_yaml_decode($input, $options = array()) { require_once _DIR_PLUGIN_YAML . 'sfyaml/sfYaml.php'; require_once _DIR_PLUGIN_YAML . 'sfyaml/sfYamlParser.php'; Chargement en cours @@ -66,10 +66,14 @@ function yaml_sfyaml_decode($input, $options = array()) { try { $parsed = $yaml->parse($input); } catch (Exception $exception) { // On garde la compatibilité ascendante avec l'ancien argument $show_error qui a été remplacé par $options. // On garde la compatibilité ascendante avec l'ancien argument $show_error qui a été remplacé par $options // mais on inverse la valeur par défaut. if ((is_bool($options) and $options) or (!empty($options['show_error']))) { throw new InvalidArgumentException(sprintf('Unable to parse string: %s', $exception->getMessage())); } // Pour compenser l'absence par défaut d'erreurs, on loge l'erreur dans les logs SPIP. spip_log("Erreur d'analyse YAML : " . $exception->getMessage(), 'yaml' . _LOG_ERREUR); } return $parsed; Chargement en cours
inc/yaml_spyc.php→inc/spyc.php +2 −2 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -20,7 +20,7 @@ require_once _DIR_PLUGIN_YAML . 'vendor/autoload.php'; * @return string * Chaîne YAML construite. */ function yaml_spyc_encode($structure, $options = array()) { function spyc_yaml_encode($structure, $options = array()) { // Traitement des options if (empty($options['indent']) or (isset($options['indent']) and !is_int($options['indent']))) { Chargement en cours @@ -47,7 +47,7 @@ function yaml_spyc_encode($structure, $options = array()) { * @return bool|mixed * Structure PHP produite par le parsing de la chaîne YAML. */ function yaml_spyc_decode($input, $options = array()) { function spyc_yaml_decode($input, $options = array()) { return Spyc::YAMLLoadString($input); }
inc/yaml_symfony.php→inc/symfony.php +6 −6 Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff Chargement en cours @@ -22,7 +22,7 @@ use Symfony\Component\Yaml\Exception\ParseException; * @return string * Chaîne YAML construite. */ function yaml_symfony_encode($structure, $options = array()) { function symfony_yaml_encode($structure, $options = array()) { // Traitement des options du dump if (empty($options['inline']) or (isset($options['inline']) and !is_int($options['inline']))) { Chargement en cours Chargement en cours @@ -55,17 +55,14 @@ function yaml_symfony_encode($structure, $options = array()) { * @return bool|mixed * Structure PHP produite par le parsing de la chaîne YAML. */ function yaml_symfony_decode($input = true, $options = array()) { function symfony_yaml_decode($input = true, $options = array()) { $parsed = false; // Traitement des options du parsing. $flags = 0; // if (!empty($options['include'])) { // $flags = Yaml::PARSE_CUSTOM_TAGS; // } if (isset($options['flags']) and is_int($options['flags'])) { $flags = $flags | $options['flags']; $flags = $options['flags']; } try { Chargement en cours @@ -74,6 +71,9 @@ function yaml_symfony_decode($input = true, $options = array()) { if ((is_bool($options) and $options) or (!empty($options['show_error']))) { printf('Unable to parse the YAML string: %s', $exception->getMessage()); } // Pour compenser l'absence par défaut d'erreurs, on loge l'erreur dans les logs SPIP. spip_log("Erreur d'analyse YAML : " . $exception->getMessage(), 'yaml' . _LOG_ERREUR); } return $parsed; Chargement en cours