Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Commit

Permalink
check php version when install
Browse files Browse the repository at this point in the history
  • Loading branch information
prinsss committed Mar 13, 2016
1 parent 28d318c commit bfdfb25
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions admin/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Author: printempw
* @Date: 2016-01-16 23:01:33
* @Last Modified by: printempw
* @Last Modified time: 2016-03-12 21:15:22
* @Last Modified time: 2016-03-13 09:06:08
*
* Blessing Skin Server Installer
*/
Expand Down Expand Up @@ -45,6 +45,12 @@
<p id="logo"><a href="https://github.com/printempw/blessing-skin-server" tabindex="-1">Blessing Skin Server</a></p>
<?php

// if php version < 5.4
if (strnatcasecmp(phpversion(), '5.4') < 0): ?>
<h1>PHP 版本过低</h1>
<p>由于使用了一些新特性,Blessing Skin Server 需要 PHP 版本 >= 5.4。您当前的 PHP 版本为 <?php echo phpversion(); ?></p>
<?php die(); endif;

$conn = new mysqli(DB_HOST, DB_USER, DB_PASSWD, DB_NAME, DB_PORT);

if ($conn->connect_error): ?>
Expand All @@ -57,8 +63,7 @@
<h1>已安装过</h1>
<p>Blessing Skin Server 看起来已经安装妥当。如果想重新安装,请删除数据库中的旧数据表。</p>
<p class="step"><a href="../index.php" class="button button-large">返回首页</a></p>
<?php die();
endif;
<?php die(); endif;

/*
* Stepped installation
Expand Down

0 comments on commit bfdfb25

Please sign in to comment.