Add detection of directory write permission
This commit is contained in:
parent
b6506e2776
commit
f4dc8cbcf9
@ -404,5 +404,16 @@ if (! function_exists('runtime_check')) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (array_get($requirements, 'write_permission', []) as $dir) {
|
||||
$realPath = realpath(__DIR__."/../$dir");
|
||||
|
||||
if (!is_writable($realPath)) {
|
||||
exit(
|
||||
"[Error] The program lacks write permission to directory $dir <br>".
|
||||
"[错误] 程序缺少对 $dir 目录的写权限或目录不存在,请手动授权/创建"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ require __DIR__.'/bootstrap/autoload.php';
|
||||
|
||||
// check the runtime environment
|
||||
runtime_check(array(
|
||||
'extensions' => array('pdo_mysql', 'openssl', 'gd', 'mbstring', 'tokenizer')
|
||||
'extensions' => array('pdo_mysql', 'openssl', 'gd', 'mbstring', 'tokenizer'),
|
||||
'write_permission' => array('storage', 'resources', 'plugins')
|
||||
));
|
||||
|
||||
// handle the request
|
||||
|
Loading…
Reference in New Issue
Block a user