mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-02 14:25:38 +08:00
merge framework and kernel
This commit is contained in:
@@ -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',
|
||||
],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user