This commit is contained in:
2023-07-20 17:12:31 +08:00
parent 0b1be47fb6
commit 2004391c9b
2 changed files with 815 additions and 815 deletions
+3 -3
View File
@@ -12,6 +12,7 @@ use Kiri\Events\EventProvider;
use Kiri\Exception\ConfigException;
use Kiri\Router\Request;
use Kiri\Router\Response;
use Kiri\Router\Router;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\RequestInterface;
@@ -941,7 +942,6 @@ if (!function_exists('config')) {
}
if (!function_exists('created')) {
/**
@@ -1007,7 +1007,7 @@ if (!function_exists('sweep')) {
function sweep(string $configPath = APP_PATH . 'config'): bool|array|string|null
{
$array = [];
foreach (glob($configPath . '/*') as $config) {
foreach (glob($configPath . '/*.php') as $config) {
$array = array_merge(require "$config", $array);
}
return $array;
@@ -1082,7 +1082,7 @@ if (!function_exists('router')) {
*/
function router(): Router
{
return Kiri::getDi()->get(Router::class);
return Kiri::getDi()->get(Rout::class);
}
}
+1 -1
View File
@@ -16,7 +16,7 @@ class ConfigProvider
public function __construct()
{
$this->hashMap = new HashMap();
$this->load(sweep(APP_PATH . '/config'));
$this->load(sweep(APP_PATH . 'config'));
$this->enableEnvConfig(APP_PATH . '.env');
}