【程序目录】修改安装文件权限检测

This commit is contained in:
sugar1569 2022-08-23 15:16:52 +08:00
parent 0c7048ba81
commit 5172085ea4
2 changed files with 8 additions and 9 deletions

View File

@ -145,7 +145,8 @@ switch ($step) {
);
$file = array(
'.env',
'.version'
'.version',
'.constant',
);
//必须开启函数
$disabled = explode(',', ini_get('disable_functions'));

View File

@ -144,18 +144,16 @@
}
?>
<?php
foreach ($file as $dir) {
$Testdir = APP_DIR . $dir;
@unlink($Testdir);
$file_env = APP_DIR . ".env";
@fopen($file_env, "w");
if (testwrite($file_env)) {
foreach ($file as $filename) {
$filedir = APP_DIR . $filename;
@fopen($filedir, "w");
if (testwrite($filedir)) {
$w = '<span class="correct_span">&radic;</span>可写 ';
} else {
$w = '<span class="correct_span error_span">&radic;</span>不可写 ';
$err++;
}
if (is_readable($file_env)) {
if (is_readable($filedir)) {
$r = '<span class="correct_span">&radic;</span>可读';
} else {
$r = '<span class="correct_span error_span">&radic;</span>不可读';
@ -164,7 +162,7 @@
?>
<tr>
<td><?php echo $dir; ?></td>
<td><?php echo $filename; ?></td>
<td>读写</td>
<td><?php echo $w; ?></td>
<td><?php echo $r; ?></td>