移动安装目录,支持根目录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,6 +336,7 @@ switch ($step) {
} }
function testwrite($d) { function testwrite($d) {
if(is_dir($d)){
$tfile = "_test.txt"; $tfile = "_test.txt";
$fp = @fopen($d . "/" . $tfile, "w"); $fp = @fopen($d . "/" . $tfile, "w");
if (!$fp) { if (!$fp) {
@ -347,6 +348,13 @@ function testwrite($d) {
return true; return true;
} }
return false; return false;
}else{
if(is_writeable($d)){
return true;
}
return false;
}
} }
function sql_execute($sql, $tablepre) { function sql_execute($sql, $tablepre) {

View File

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