{% extends "layout.html.twig" %}

{% block main %}

	<table  class="table table-striped table-bordered">
		<thead>
			<tr>
				<th width="40%">环境检测</th>
				<th width="20%">推荐配置</th>
				<th width="20%">当前状态</th>
				<th width="20%">最低要求</th>
			</tr>
		</thead>
		<tbody>

	    <tr>
	      <td>操作系统</td>
	      <td>Linux</td>
	      <td>
	        <span class="text-success">√ {{ env.os }}</span>
	      </td>
	      <td>--</td>
	    </tr>

      <tr>
        <td>PHP版本</td>
        <td>5.5.x</td>
        <td>
          {% if env.phpVersionOk %}
            <span class="text-success">√ {{ env.phpVersion }}</span>
          {% else %}
            <span class="text-danger">X {{ env.phpVersion }}</span>
          {% endif %}
        </td>
        <td>5.3.3</td>
      </tr>

      <tr>
				<td>PDO_MySQL</td>
				<td>必须</td>
				<td>
				  {% if env.pdoMysqlOk %}
				    <span class="text-success">√ 已安装</span>
				  {% else %}
				    <span class="text-danger">X 尚未安装MySQL_PDO</span>
				  {% endif %}
				</td>
				<td>必须</td>
      </tr>

      <tr>
				<td>
					文件上传大小
					<div class="text-muted">该值决定可以上传视频的最大大小</div>
				</td>
				<td>大于200M</td>
				<td>
				  {% if env.uploadMaxFilesizeOk %}
					  <span class="text-success">√ {{ env.uploadMaxFilesize }}</span>
				  {% else %}
					  <span class="text-danger">X {{ env.uploadMaxFilesize }}</span>
				  {% endif %}
				</td>
				<td>2M</td>
      </tr>

      <tr>
				<td>
				  表单数据大小
				  <div class="text-muted">该值不能小于文件上传大小的值</div>
				</td>
				<td>大于200M</td>
				<td>
				  {% if env.postMaxsizeOk %}
					  <span class="text-success">√ {{ env.postMaxsize }}</span>
				  {% else %}
					  <span class="text-danger">X {{ env.postMaxsize }}</span>
				  {% endif %}
				</td>
				<td>8M</td>
      </tr>

      <tr>
				<td>
				  PHP脚本最大执行时间
				  <div class="text-muted">该值决定上传视频时，最长可使用的时间</div>
				</td>
				<td>大于300秒</td>
				<td>
				  {% if env.maxExecutionTimeOk %}
					  <span class="text-success">√ {{ env.maxExecutionTime }}秒</span>
				  {% else %}
					  <span class="text-danger">X {{ env.maxExecutionTime }}秒</span>
				  {% endif %}
				</td>
				<td>30秒</td>
      </tr>

      <tr>
				<td>
				  PHP扩展：mbstring
				  <div class="text-muted">该扩展用于处理中文字符</div>
				</td>
				<td>必须</td>
				<td>
				  {% if env.mbstringOk %}
					  <span class="text-success">√ 已安装</span>
				  {% else %}
					  <span class="text-danger">X 尚未安装</span>
				  {% endif %}
				</td>
				<td>必须</td>
      </tr>

      <tr>
				<td>
				  PHP扩展：curl
				  <div class="text-muted">该扩展用于远程读取文件</div>
				</td>
				<td>必须</td>
				<td>
				  {% if env.curlOk %}
					  <span class="text-success">√ 已安装</span>
				  {% else %}
					  <span class="text-danger">X 尚未安装</span>
				  {% endif %}
				</td>
				<td>必须</td>
      </tr>

      <tr>
				<td>
				  PHP扩展：GD
				  <div class="text-muted">该扩展用于处理图片</div>
				</td>
				<td>必须</td>
				<td>
				  {% if env.gdOk %}
					  <span class="text-success">√ 已安装</span>
				  {% else %}
					  <span class="text-danger">X 尚未安装</span>
				  {% endif %}
				</td>
				<td>必须</td>
      </tr>
		</tbody>
	</table>

  <table class="table table-hover table-striped table-bordered">
    <thead>
      <tr>
        <th width="60%">文件、目录权限检查</th>
        <th width="20%">当前状态</th>
        <th width="20%">所需状态</th>
      </tr>
    </thead>
    <tbody>
      <tr>
      	<td> 安全模式 </td>
      	<td>
	      	{% if safemode == 'Off' %}
	            <span class="text-danger">√ 开启</span>
	        {% else %}
	        	<span class="text-success">√ 关闭</span>
	        {% endif %}
	    </td>
         <td>关闭</td>
      </tr>
      {% for path, status in paths %}
        <tr>
          <td>{{ path }}</td>
          <td>
          	{% if status == true %}
          	  <span class="text-success">√ 可写</span>
          	{% else %}
          	  <span class="text-danger">X 不可写</span>
          	{% endif %}
          </td>
          <td>可写</td>
        	
        </tr>
      {% endfor %}
    </tbody>
  </table>

  <div class="actions">
    {% if pass %}
      <a class="btn btn-primary btn-lg" href="start-install.php?step=2">下一步</a>
    {% else %}
      <a class="btn btn-danger btn-lg" href="start-install.php?step=1">重新检测</a>
    {% endif %}
  </div>
{% endblock %}