修复 安装时的空间计算问题

This commit is contained in:
康盛Discuz! 2016-12-20 20:08:37 -05:00
parent b9007797bb
commit a5c2050318
2 changed files with 6 additions and 5 deletions

View File

@ -139,10 +139,7 @@ function env_check(&$env_items) {
unset($tmp); unset($tmp);
} elseif($key == 'diskspace') { } elseif($key == 'diskspace') {
if(function_exists('disk_free_space')) { if(function_exists('disk_free_space')) {
$space = disk_free_space(ROOT_PATH); $env_items[$key]['current'] = disk_free_space(ROOT_PATH);
$env_items[$key]['status'] = $space > $item['r'] ? 1 : 0;
$env_items[$key]['r'] = format_space($item['r']);
$env_items[$key]['current'] = format_space($space);
} else { } else {
$env_items[$key]['current'] = 'unknow'; $env_items[$key]['current'] = 'unknow';
} }
@ -196,6 +193,10 @@ function show_env_result(&$env_items, &$dirfile_items, &$func_items, &$filesock_
} }
} }
} }
if($key == 'diskspace') {
$item['current'] = format_space($item['current']);
$item['r'] = format_space($item['r']);
}
if(VIEW_OFF) { if(VIEW_OFF) {
$env_str .= "\t\t<runCondition name=\"$key\" status=\"$status\" Require=\"$item[r]\" Best=\"$item[b]\" Current=\"$item[current]\"/>\n"; $env_str .= "\t\t<runCondition name=\"$key\" status=\"$status\" Require=\"$item[r]\" Best=\"$item[b]\" Current=\"$item[current]\"/>\n";
} else { } else {

View File

@ -75,7 +75,7 @@ $env_items = array
'gdversion' => array('r' => '1.0', 'b' => '2.0'), 'gdversion' => array('r' => '1.0', 'b' => '2.0'),
'curl' => array('r' => 'notset', 'b' => 'enable'), 'curl' => array('r' => 'notset', 'b' => 'enable'),
'opcache' => array('r' => 'notset', 'b' => 'enable'), 'opcache' => array('r' => 'notset', 'b' => 'enable'),
'diskspace' => array('r' => 30 * 1024 * 1024, 'b' => 'notset'), 'diskspace' => array('r' => 30 * 1048576, 'b' => 'notset'),
); );
$dirfile_items = array $dirfile_items = array