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; }