mirror of
https://github.com/ledccn/IYUUPlus.git
synced 2025-05-01 19:41:11 +00:00
fix bug:未创建db目录时,无法运行
This commit is contained in:
parent
b995041b40
commit
eade3677ba
@ -24,7 +24,8 @@ if (class_exists('app\\common\\ICheck')) {
|
||||
//不存在env时,复制一份
|
||||
is_file(__DIR__ . DIRECTORY_SEPARATOR . '.env') || copy(__DIR__ . DIRECTORY_SEPARATOR . '.env.example', __DIR__ . DIRECTORY_SEPARATOR . '.env');
|
||||
//检查db_path目录
|
||||
is_writable(db_path()) || exit('错误:'.db_path().'目录无写入权限,程序终止!');
|
||||
is_dir(db_path()) or mkdir(db_path(), 0777, true);
|
||||
is_writable(db_path()) or exit('错误:'.db_path().'目录无写入权限,程序终止!');
|
||||
|
||||
if (method_exists('Dotenv\Dotenv', 'createUnsafeImmutable')) {
|
||||
Dotenv::createUnsafeImmutable(base_path())->load();
|
||||
|
Loading…
x
Reference in New Issue
Block a user