#66 install php version check

#16 install rewrite module usable check
#48 htmlspecialchars function params add
This commit is contained in:
akasima 2013-11-18 16:54:17 +09:00 committed by bnu
parent 51b6b21cf2
commit 736f382b27
93 changed files with 240 additions and 215 deletions

View file

@ -329,9 +329,8 @@ class installController extends install
{
// Check each item
$checklist = array();
// 0. check your version of php (5.2.4 upper)
$checkPHPVersion = phpversion();
if(version_compare($checkPHPVersion, '5.2.4') == -1) $checklist['php_version'] = false;
// 0. check your version of php (5.2.4 or higher)
if(version_compare(PHP_VERSION, '5.2.4') == -1) $checklist['php_version'] = false;
else $checklist['php_version'] = true;
// 1. Check permission
if(is_writable('./')||is_writable('./files')) $checklist['permission'] = true;
@ -358,11 +357,50 @@ class installController extends install
// Save the checked result to the Context
Context::set('checklist', $checklist);
Context::set('install_enable', $install_enable);
Context::set('phpversion', $checkPHPVersion);
Context::set('phpversion', PHP_VERSION);
return $install_enable;
}
/**
* check this server can use rewrite module
* make a file to files/config and check url approach by ".htaccess" rules
*
* @return bool
*/
function checkRewriteUsable() {
$checkString = "isApproached";
$checkFilePath = 'files/config/tmpRewriteCheck.txt';
FileHandler::writeFile(_XE_PATH_.$checkFilePath, trim($checkString));
$hostname = $_SERVER['SERVER_NAME'];
$port = $_SERVER['SERVER_PORT'];
$query = "/JUST/CHECK/REWRITE/" . $checkFilePath;
$fp = @fsockopen($hostname, $port, $errno, $errstr);
if(!$fp) return false;
fputs($fp, "GET {$query} HTTP/1.0\r\n");
fputs($fp, "Host: {$hostname}\r\n\r\n");
$buff = '';
while(!feof($fp)) {
$str = fgets($fp, 1024);
if(trim($str)=='') $start = true;
if($start) $buff .= $str;
}
fclose($fp);
$ret = trim($buff);
FileHandler::removeFile(_XE_PATH_.$checkFilePath);
if( $ret == $checkString )
return true;
else
return false;
}
/**
* @brief Create files and subdirectories
* Local evironment setting before installation by using DB information