function check_dirfile(){
$items = array(
array('dir', '可写', 'success', './Uploads/Download'),
array('dir', '可写', 'success', './Uploads/Picture'),
array('dir', '可写', 'success', './Uploads/Editor'),
array('dir', '可写', 'success', './Runtime'),
array('file', '可写', 'success', './index.php'),
array('file', '可写', 'success', './Application/Common/Conf/config.php'),
array('file', '可写', 'success', './Application/User/Conf/config.php'),
);
foreach ($items as &$val) {
if('dir' == $val[0]){
if(!is_writable(INSTALL_APP_PATH . $val[3])) {
////////////////////////////////////////////////////////////////////////
if(is_dir($items[1])) {//此处是否有误?
/////////////////////////////////////////////////////////////////////////////
$val[1] = '可读';
$val[2] = 'error';
session('error', true);
} else {
$val[1] = '不存在';
$val[2] = 'error';
session('error', true);
}
}
} else {
if(file_exists(INSTALL_APP_PATH . $val[3])) {
if(!is_writable(INSTALL_APP_PATH . $val[3])) {
$val[1] = '不可写';
$val[2] = 'error';
session('error', true);
}
} else {
if(!is_writable(dirname(INSTALL_APP_PATH . $val[3]))) {
$val[1] = '不存在';
$val[2] = 'error';
session('error', true);
}
}
}
}
return $items;
} 最佳答案