merge framework and kernel

This commit is contained in:
sunxyw
2023-03-07 23:07:52 +08:00
parent 8f43012a5c
commit 772288b517
19 changed files with 153 additions and 176 deletions

View File

@@ -8,7 +8,7 @@ use Psr\Log\LoggerInterface;
use ZM\Config\Environment;
use ZM\Config\EnvironmentInterface;
use ZM\Framework;
use ZM\Kernel;
use ZM\HasRuntimeInfo;
/*
* 这里是容器的配置文件,你可以在这里配置容器的绑定和其他一些参数。
@@ -28,6 +28,8 @@ return [
Driver::class => fn () => Framework::getInstance()->getDriver(),
LoggerInterface::class => fn () => logger(),
EnvironmentInterface::class => Environment::class,
HasRuntimeInfo::class => Framework::class,
],
// 容器的缓存配置,默认情况下,只有在生产环境下才会启用缓存
@@ -37,7 +39,7 @@ return [
// 详细介绍请参阅https://php-di.org/doc/performances.html#caching
'cache' => [
// 是否启用缓存,支持 bool、callable
'enable' => fn () => Kernel::getInstance()->environment('production'),
'enable' => fn () => Framework::getInstance()->environment('production'),
'namespace' => 'zm',
],
];