From 7a2d3a54ae23be6fe0b3d9fab34957614b64e057 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 10 Sep 2018 04:20:27 +0100 Subject: [PATCH] lib/php/nb.php --- lib/php/db.php | 2 +- lib/php/nb.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/php/db.php b/lib/php/db.php index bec6a503..dfe27487 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -744,7 +744,7 @@ class Db extends nb { else $done[$file] = 1; if (!is_readable($file)) continue; - if (preg_match('/\.(yaml|yml)$/i',$file) and ($yaml = self::yaml_parse_file($file))) { + if (preg_match('/\.(yaml|yml)$/i',$file) and ($yaml = self::yaml_decode_file($file))) { self::$dbq = self::ar_merge(self::$dbq,$yaml); } elseif (preg_match('/\.php$/i',$file)) { diff --git a/lib/php/nb.php b/lib/php/nb.php index 889abdc5..d625c603 100644 --- a/lib/php/nb.php +++ b/lib/php/nb.php @@ -432,6 +432,9 @@ class NB { */ public static function object2array($o) { return $array = json_decode(json_encode($o), true); } + /* + * Function: yaml_init + */ private static function yaml_init() { static $Spyc; if (!isset($Spyc)) { @@ -452,14 +455,11 @@ class NB { } } - public static function yaml_parse_file($file) { + public static function yaml_decode_file($file) { self::yaml_init(); return _yaml_parse_file($file); } - /* - * Function: yaml_encode - */ public static function yaml_encode($row) { self::yaml_init(); $yaml = _yaml_emit($row); -- 2.47.3