mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
ready to replace legacy config
This commit is contained in:
@@ -7,7 +7,7 @@ namespace ZM\Config;
|
||||
use OneBot\V12\Config\Config;
|
||||
use ZM\Exception\ConfigException;
|
||||
|
||||
class RefactoredConfig
|
||||
class ZMConfig
|
||||
{
|
||||
/**
|
||||
* @var array 支持的文件扩展名
|
||||
@@ -29,7 +29,7 @@ class ContainerServicesProvider
|
||||
* connection: open, close, message
|
||||
* ```
|
||||
*
|
||||
* @param string $scope 作用域
|
||||
* @param string $scope 作用域
|
||||
* @throws ConfigException
|
||||
*/
|
||||
public function registerServices(string $scope, ...$params): void
|
||||
@@ -81,6 +81,12 @@ class ContainerServicesProvider
|
||||
|
||||
// 注册logger
|
||||
$container->instance(LoggerInterface::class, logger());
|
||||
|
||||
// 注册config
|
||||
$container->instance(ZMConfig::class, new ZMConfig([
|
||||
SOURCE_ROOT_DIR . '/config',
|
||||
]));
|
||||
$container->alias(ZMConfig::class, 'config');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user