From d7e264bac0fccd9ce4f9ee9bb34bebd7d6cfe693 Mon Sep 17 00:00:00 2001 From: Cerdic <cedric@yterium.com> Date: Sat, 6 Jul 2013 14:24:42 +0000 Subject: [PATCH] =?UTF-8?q?Report=20de=20r20701=20:=20puisqu'on=20embarque?= =?UTF-8?q?=20Textwheel=20(en=20g=C3=A9n=C3=A9ral),=20et=20son=20decodeur?= =?UTF-8?q?=20Yaml,=20autant=20proposer=20par=20defaut=20un=20yaml=5Fto=5F?= =?UTF-8?q?array,=20quitte=20a=20lancer=20une=20Exception=20si=20finalemen?= =?UTF-8?q?t=20on=20ne=20touve=20pas=20le=20decodeur=20(cas=20rare)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ecrire/iterateur/data.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ecrire/iterateur/data.php b/ecrire/iterateur/data.php index 990930ec1d..4a3f5b0544 100644 --- a/ecrire/iterateur/data.php +++ b/ecrire/iterateur/data.php @@ -649,6 +649,23 @@ function inc_glob_to_array_dist($u) { return $a ? $a : array(); } +/** + * YAML -> tableau + * @param string $u + * @return bool|array + * @throws Exception + */ +function inc_yaml_to_array_dist($u){ + include_spip('inc/yaml-mini'); + if (!function_exists("yaml_decode")){ + throw new Exception('YAML: impossible de trouver la fonction yaml_decode'); + return false; + } + + return yaml_decode($u); +} + + /** * pregfiles -> tableau * lister des fichiers a partir d'un dossier de base et selon une regexp. -- GitLab