From 2cca7bc9c3f62da8c19b5840ed174715ace3994f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 31 Aug 2020 01:59:30 +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 --- function.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/function.php b/function.php index cebfdeff..01da6ab4 100644 --- a/function.php +++ b/function.php @@ -91,7 +91,6 @@ if (!function_exists('alias')) { } - if (!function_exists('name')) { /** @@ -130,7 +129,6 @@ if (!function_exists('redirect')) { } - if (!function_exists('env')) { /** @@ -148,3 +146,20 @@ if (!function_exists('env')) { } } + +if (!function_exists('sweep')) { + + /** + * @param string $configPath + * @return array|false|string|null + */ + function sweep($configPath = APP_PATH . '/config') + { + $array = []; + foreach (glob($configPath . '/*') as $config) { + $array = array_merge(require_once "$config", $array); + } + return $array; + } + +}