移动安装目录,支持根目录index.php访问,也可以像tp5一样只对外开放crmeb一个目录

This commit is contained in:
xurongyao 2018-09-15 11:10:42 +08:00
parent e8564ab46c
commit 4912532f0d
2 changed files with 26 additions and 16 deletions

View File

@ -336,17 +336,25 @@ switch ($step) {
}
function testwrite($d) {
$tfile = "_test.txt";
$fp = @fopen($d . "/" . $tfile, "w");
if (!$fp) {
if(is_dir($d)){
$tfile = "_test.txt";
$fp = @fopen($d . "/" . $tfile, "w");
if (!$fp) {
return false;
}
fclose($fp);
$rs = @unlink($d . "/" . $tfile);
if ($rs) {
return true;
}
return false;
}else{
if(is_writeable($d)){
return true;
}
return false;
}
fclose($fp);
$rs = @unlink($d . "/" . $tfile);
if ($rs) {
return true;
}
return false;
}
function sql_execute($sql, $tablepre) {

View File

@ -84,13 +84,15 @@
foreach($folder as $dir){
$Testdir = CRMEBDIR.$dir;
// echo $Testdir."<br/>";
dir_create($Testdir);
if(TestWrite($Testdir)){
$w = '<span class="correct_span">&radic;</span>可写 ';
}else{
$w = '<span class="correct_span error_span">&radic;</span>不可写 ';
$err++;
}
dir_create($Testdir);
if(testwrite($Testdir)){
$w = '<span class="correct_span">&radic;</span>可写 ';
}else{
$w = '<span class="correct_span error_span">&radic;</span>不可写 ';
$err++;
}
if(is_readable($Testdir)){
$r = '<span class="correct_span">&radic;</span>可读' ;
}else{