From ef7efe271c8626d61642b14040de43a4cad7266b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 17 May 2021 18:33:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Runtime.php | 5 +++++ function.php | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/System/Runtime.php b/System/Runtime.php index 9d4f80fa..29f5bc6e 100644 --- a/System/Runtime.php +++ b/System/Runtime.php @@ -38,6 +38,11 @@ class Runtime extends Command $runtime = storage(static::CACHE_NAME); $configs = Snowflake::app()->getConfig()->getData(); + array_walk_recursive($configs, function (&$value, $key) { + if ($value instanceof \Closure) { + $value = null; + } + }); Snowflake::writeFile(storage(static::CONFIG_NAME), serialize($configs)); Snowflake::writeFile($runtime, serialize($annotation->getLoader())); diff --git a/function.php b/function.php index 260832d5..78d76386 100644 --- a/function.php +++ b/function.php @@ -678,10 +678,7 @@ if (!function_exists('sweep')) { { $array = []; foreach (glob($configPath . '/*') as $config) { - $_array = require_once "$config"; - if (!is_array($_array)) continue; - - $array = array_merge($_array, $array); + $array = array_merge(require_once "$config", $array); } return $array; }