<!doctype html>
<html>
<head>
<meta charset="gbk" />
<title>爱青檬二次开发CMS产品 - Powered by 27meng.com</title>
<link rel="stylesheet" href="<?=install_path?>csdj/install/images/css.css" />
</head>
<body>
	<div class="wrap">
		<div class="header">
			<h1 class="logo">logo</h1>
					<div class="icon_install">安装向导</div>
					<div class="version">v4.0</div>
		</div><div class="section">
	<div class="step">
		<ul>
			<li class="current"><em>1</em>检测环境</li>
			<li><em>2</em>创建数据</li>
			<li><em>3</em>完成安装</li>
		</ul>
	</div>
	<div class="server">
		<table width="100%">
			<tr>
				<td class="td1">环境检测</td>
				<td class="td1" width="25%">推荐配置</td>
				<td class="td1" width="25%">当前状态</td>
				<td class="td1" width="25%">最低要求</td>
			</tr>
			
			<tr>
				<td>操作系统</td>
				<td>Linux</td>
				<td>
<span class="correct_span">&radic;</span>
<?php $up=TRUE; $os = explode(" ", php_uname()); echo $os[0];?></td>
				<td>不限制</td>
			</tr>
			<tr>
				<td>PHP版本</td>
				<td>>5.2.x</td>
				<td>
<?php $PHPALL=explode(".",PHP_VERSION); if($PHPALL[1] < 1 && $PHPALL[1] < 2){$up=false; echo '<span class="error_span">&times;</span>';}else{ echo '<span class="correct_span">&radic;</span>';}?>
<?php echo PHP_VERSION;?></td>
				<td>5.1.2</td>
			</tr>
			<tr>
				<td>Mysql扩展（client）</td>
				<td>>5.x.x</td>
				<td>
<?php if(extension_loaded('mysql')){ echo '<span class="correct_span">&radic;</span>正常';}else{$up=false; echo '<span class="error_span">&times;</span>未开启';}?>
				</td>
				<td>必须开启</td>
			</tr>
			<tr>
				<td>Session</td>
				<td>开启</td>
				<td>
<?php if(function_exists('session_start')){ echo '<span class="correct_span">&radic;</span>正常';}else{$up=false;echo '<span class="error_span">&times;</span>';}?></td>
				<td>必须开启</td>
			</tr>
			<tr>
				<td>附件上传</td>
				<td>>20M</td>
				<td>
<span class="correct_span">&radic;</span>
<?php echo ini_get('upload_max_filesize');?></td>
				<td>不限制</td>
			</tr>
		</table>
		<table width="100%">
			<tr>
				<td class="td1">目录、文件权限检查</td>
				<td class="td1" width="25%">当前状态</td>
				<td class="td1" width="25%">所需状态</td>
			</tr>
<?php 
$dirall="./|./plugins/|./attachment/|./cache/|./csdj/lib/|./csdj/install/|./skins/";
$cscms=explode('|',$dirall);
for($j=0;$j<count($cscms);$j++){
     echo '			<tr>
				<td>'.$cscms[$j].'</td>
          ';
if(EDITDIR($cscms[$j])){
     echo '<td><span class="correct_span">&radic;</span>可写</td>';
}else{ 
     $up=false; 
     echo '<td><span class="error_span">&times;</span>不可写或不存在</td>';
}
                   echo '<td>读/写</td>
			</tr>';
}
?>
		</table>
	</div>
	<div class="bottom tac">
		<a href="<?=install_url?>save1" class="btn">重新检测</a><a href="<?=install_url?>save2" class="btn" <?php if(!$up) echo 'disabled';?>>下一步</a> <?php if(!$up) echo '<font color=red>请先完成以上没有通过的信息!</font>';?>
	</div>
</section>
	</div>
	<div class="footer">
				&copy; 2009-2015 <a href="http://www.27meng.com" target="_blank">27meng.com</a>（爱青檬二次开发CMS旗下品牌）
	</div>
<?php
//判断可写
function EDITDIR($filename){
   if(is_dir($filename)){ //文件夹是否存在
     $cswj=$filename."cs_text.txt";
     if(@fwrite(fopen($cswj,"wb"),"cscms")){
         $rs=@unlink($cswj);
         if($rs){
              return true;
         }
     }else{
         return false;
     }
   }else{
     return false;
   }
}
//获取MYSQL版本
function MysqlBB(){
$getmysqlver=@mysql_get_server_info();
 if(empty($getmysqlver))
 {
  $getmysqlver='5.0';
 }
 if($getmysqlver>='5.0')
 {
  $phome_db_ver='5.0';
 }
 elseif($getmysqlver>='4.1')
 {
  $phome_db_ver='4.1';
 }
 else
 {
  $phome_db_ver='4.0';
 }
return $phome_db_ver;

}
?>
</body>
</html>

