mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-18 05:04:51 +08:00
fix read config before loaded
This commit is contained in:
parent
a7324f6c49
commit
9e08919ce0
@ -97,7 +97,7 @@ class Framework
|
||||
$this->registerBaseBindings();
|
||||
|
||||
// 初始化配置
|
||||
ZMConfig::setDirectory($this->container->get('path.config'));
|
||||
ZMConfig::setDirectory(app('path.config'));
|
||||
ZMConfig::setEnv($args['env'] ?? '');
|
||||
if (ZMConfig::get('global') === false) {
|
||||
echo zm_internal_errcode('E00007') . 'Global config load failed: ' . ZMConfig::$last_error . "\nError path: " . DataProvider::getSourceRootDir() . "\nPlease init first!\nSee: https://github.com/zhamao-robot/zhamao-framework/issues/37\n";
|
||||
@ -624,7 +624,9 @@ class Framework
|
||||
$this->container->instance('path.source', DataProvider::getSourceRootDir());
|
||||
$this->container->alias('path.source', 'path.base');
|
||||
$this->container->instance('path.config', DataProvider::getSourceRootDir() . '/config');
|
||||
$this->container->instance('path.module_config', ZMConfig::get('global', 'config_dir'));
|
||||
$this->container->singleton('path.module_config', function () {
|
||||
return ZMConfig::get('global', 'config_dir');
|
||||
});
|
||||
$this->container->singleton('path.data', function () {
|
||||
return DataProvider::getDataFolder();
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user