This commit is contained in:
2020-08-31 01:59:30 +08:00
parent b11b132cfc
commit 2cca7bc9c3
+17 -2
View File
@@ -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;
}
}