<?php
 if (!defined('IN_59MIAO'))
{
	exit('Access Defined');
}
$url = 'http://gw.api.59miao.com';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>欢迎使用59秒网络科技，环境测试程序-安装向导，第二步,环境检测</title>
<META http-equiv=expires content=0>
<META content="59秒网络科技购物导航LSV" name=keywords>
<META content="59秒网络科技购物导航LSV" name=description>
<link rel="stylesheet" type="text/css" href="template/css/login.css">
</HEAD>
<BODY>
<div id="login">

<TABLE>
<TR>
	<TD><h1><A HREF="#">安装向导第二步,环境检测</A></h1></TD>
	<TD><h1 style="color:#6CA1B4;font-size:36px;">2. 环境检测</h1></TD>
</TR>
</TABLE>

<form method="post" action="index.php?step=3" id="loginform" name="loginform">
	<p>
		<div class="lable"><h2>环境检测:</h2>
		
		<TABLE>
		<TR>
			<TH>项目</TH>
			<TH>所需配置</TH>
			<TH>最佳配置</TH>
			<TH>当前配置</TH>
		</TR>
		<TR>
			<TD>操作系统</TD>
			<TD>不限</TD>
			<TD>Linux/Unix</TD>
			<TD style="color:#339900" class="w"><?php echo PATH_SEPARATOR==':'?'Linux/Unix':'windows';?></TD>
		</TR>
		<TR>
			<TD>WEB服务器</TD>
			<TD>Apache/Nginx/IIS</TD>
			<TD>Apache</TD>
			<TD style="color:#339900" class="w"><?php echo $_SERVER['SERVER_SOFTWARE'];;?></TD>
		</TR>
		<TR>
			<TD>PHP版本</TD>
			<TD>5.1以上</TD>
			<TD>5.1以上，支持Mysql</TD>
			<TD style="color:#339900" class="w"><?php echo PHP_VERSION;?></TD>
		</TR>
		<TR>
			<TD>GD支持</TD>
			<TD>1.0</TD>
			<TD>2.0</TD>
			<TD style="color:#339900" class="w"><?php echo $gd_v?$gd_v:'<span style="color:#ff0000;">不支持</span><input type="hidden" name="error[]" value="1"/>';?></TD>
		</TR>
		<TR>
			<TD>磁盘空间</TD>
			<TD>100M</TD>
			<TD>不限</TD>
			<TD style="color:#339900" class="w"><?php echo $disk_total;?></TD>
		</TR>
		</TABLE>
		</div>
		<div class="lable"><h2>文件夹权限检测:</h2>
		
		<TABLE>
		<TR>
			<TH>文件</TH>
			<TH>所需状态</TH>
			<TH>当前状态</TH>
		</TR>
		
		<?php
		 foreach ($filelist AS $dir){ ?>
		 <TR>
			<TD><?php echo $dir;?></TD>
			<TD>可写</TD>
			<TD>
		 <?php 
		 	
		    	
		        if (!file_exists(ROOT_PATH.'/'.$dir))
		        {

					echo '<font style="color:#ff6600" class="nw">文件不存在</font><input type="hidden" name="error[]" value="1"/>';
		            continue;
		        }
		
		        if (file_mode_info(ROOT_PATH . $dir) < 2)
		        {
		            echo '<font style="color:#ff6600" class="nw">不可写</font><input type="hidden" name="error[]" value="1"/>';
		        }
		        else
		        {
		            echo '<font style="color:#339900" class="w">可写</font>';
		        }
		 ?>
		 </TD>
		</TR>
		 <?php 
		    }
		?>		
		</TABLE>
		</div>
		<div class="lable"><h2>所需函数检测:</h2>
		
		<TABLE >
		<TR>
			<TH>函数名</TH>
			<TH>检测结果</TH>
			<TH>建议</TH>
		</TR>
		<TR>
			<TD>是否支持mysql函数</TD>
			<TD><?php echo function_exists('mysql_connect')?'<font style="color:#339900" class="w">支持':'<input type="hidden" name="error[]" value="1"/><font style="color:#ff6600" class="nw">不支持';?></font></TD>
			<TD>需要开启mysql函数支持</TD>
		</TR>
		<TR>
			<TD>file_get_contents</TD>
			<TD><?php echo function_exists('file_get_contents')?'<font style="color:#339900" class="w">支持':'<input type="hidden" name="error[]" value="1"/><font style="color:#ff6600" class="nw">不支持';?></font></TD>
			<TD>需要开启allow_url_fopen支持</TD>
		</TR>
		
		<TR>
			<TD>fsockopen</TD>
			<TD><?php echo function_exists('fsockopen')?'<font style="color:#339900" class="w">支持':'<input type="hidden" name="error[]" value="1"/><font style="color:#ff6600" class="nw">不支持';?></font></TD>
			<TD>需开启socket支持</TD>
		</TR>
		<TR>
			<TD>xml_parser_create</TD>
			<TD><?php echo function_exists('xml_parser_create')?'<font style="color:#339900" class="w">支持':'<input type="hidden" name="error[]" value="1"/><font style="color:#ff6600" class="nw">不支持';?></font></TD>
			<TD>需开启XML支持</TD>
		</TR>
		<tr>
			<td>编码转换</td>
			<TD><?php echo function_exists('mb_convert_encoding')?'<font style="color:#339900" class="w">支持':'<input type="hidden" name="error[]" value="1"/><font style="color:#ff6600" class="nw">不支持';?></font></TD>
			<TD>需开启mb_convert_encoding支持</TD>			
		</tr>
		
		</TABLE>
		</div>
		<div class="lable">  
			<h2>与59秒通信检测:</h2>
			<TABLE>
			<TR>
				<TH>检测内容</TH>
				<TH>检测结果</TH>
				<TH>建议</TH>
			</TR>
			<TR>
				<TD>通信是否成功</TD>
				<TD>
					<?php
						$url = 'http://gw.api.59miao.com';
						$array_url = get_headers($url,1);
						if(preg_match('/200/',$array_url[0])){
						    echo '<font style="color:#339900" class="w">成功</font>';						   
						}else{
						    echo '<input type="hidden" name="error[]" value="1"/><font style="color:#ff6600" class="nw">不成功</font>';
						    
						} 
					?>					
				</TD>
				<TD>与您的空间提供商联系，或者联系59miao客服</TD>
			</TR>
			</TABLE>
		</div>
	</p>
	<p class="submit">
		<input type="button" value="上一步" onclick="location.href='index.php?step=1'">
		<input type="submit" tabindex="100" value="下一步" id="wp-submit" name="wp-submit">
	</p>
</form>

</div>
</body></html>
