qqq
This commit is contained in:
+4
-4
@@ -12,6 +12,7 @@ use Kiri\Events\EventProvider;
|
|||||||
use Kiri\Exception\ConfigException;
|
use Kiri\Exception\ConfigException;
|
||||||
use Kiri\Router\Request;
|
use Kiri\Router\Request;
|
||||||
use Kiri\Router\Response;
|
use Kiri\Router\Response;
|
||||||
|
use Kiri\Router\Router;
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
use Psr\Http\Message\RequestInterface;
|
use Psr\Http\Message\RequestInterface;
|
||||||
@@ -941,7 +942,6 @@ if (!function_exists('config')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!function_exists('created')) {
|
if (!function_exists('created')) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -953,7 +953,7 @@ if (!function_exists('created')) {
|
|||||||
*/
|
*/
|
||||||
function created($key, array $construct = [], array $config = []): ?object
|
function created($key, array $construct = [], array $config = []): ?object
|
||||||
{
|
{
|
||||||
return Kiri::getDi()->make($key,$construct, $config);
|
return Kiri::getDi()->make($key, $construct, $config);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1007,7 +1007,7 @@ if (!function_exists('sweep')) {
|
|||||||
function sweep(string $configPath = APP_PATH . 'config'): bool|array|string|null
|
function sweep(string $configPath = APP_PATH . 'config'): bool|array|string|null
|
||||||
{
|
{
|
||||||
$array = [];
|
$array = [];
|
||||||
foreach (glob($configPath . '/*') as $config) {
|
foreach (glob($configPath . '/*.php') as $config) {
|
||||||
$array = array_merge(require "$config", $array);
|
$array = array_merge(require "$config", $array);
|
||||||
}
|
}
|
||||||
return $array;
|
return $array;
|
||||||
@@ -1082,7 +1082,7 @@ if (!function_exists('router')) {
|
|||||||
*/
|
*/
|
||||||
function router(): Router
|
function router(): Router
|
||||||
{
|
{
|
||||||
return Kiri::getDi()->get(Router::class);
|
return Kiri::getDi()->get(Rout::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ConfigProvider
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->hashMap = new HashMap();
|
$this->hashMap = new HashMap();
|
||||||
$this->load(sweep(APP_PATH . '/config'));
|
$this->load(sweep(APP_PATH . 'config'));
|
||||||
|
|
||||||
$this->enableEnvConfig(APP_PATH . '.env');
|
$this->enableEnvConfig(APP_PATH . '.env');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user