ready to replace legacy config

This commit is contained in:
sunxyw
2022-08-23 17:51:20 +08:00
parent 6cbde80a1c
commit 18892a14c2
5 changed files with 39 additions and 174 deletions

View File

@@ -7,7 +7,7 @@ namespace ZM\Config;
use OneBot\V12\Config\Config;
use ZM\Exception\ConfigException;
class RefactoredConfig
class ZMConfig
{
/**
* @var array 支持的文件扩展名

View File

@@ -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');
}
/**