]> git.nbdom.net Git - nb.git/commitdiff
lib/php/nb.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 10 Sep 2018 03:20:27 +0000 (04:20 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 10 Sep 2018 03:20:27 +0000 (04:20 +0100)
lib/php/db.php
lib/php/nb.php

index bec6a50392537ba571f9e1e3ba1038e8fc2ac874..dfe27487e5f961aacf02e13b2caf5ec93f4ebfec 100644 (file)
@@ -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)) {
index 889abdc52bc95119b71f5034822d04bedc1fe997..d625c603d6ef05014460a3478e9fe808394fa3f4 100644 (file)
@@ -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);