提交 a228b541 编写于 作者: G gongfuxiang

install

上级 76c0a7b1
......@@ -17,7 +17,7 @@ return array(
'DB_PORT' => 3306, // 端口
'DB_PARAMS' => array(), // 数据库连接参数
'DB_PREFIX' => 's_', // 数据库表前缀
'DB_CHARSET'=> 'utf8', // 字符集
'DB_CHARSET'=> 'utf8mb4', // 字符集
'DB_DEBUG' => false, // 数据库调试模式 开启后可以记录SQL日志
);
?>
\ No newline at end of file
......@@ -17,7 +17,7 @@ return array(
'DB_PORT' => 3306, // 端口
'DB_PARAMS' => array(), // 数据库连接参数
'DB_PREFIX' => 's_', // 数据库表前缀
'DB_CHARSET'=> 'utf8', // 字符集
'DB_CHARSET'=> 'utf8mb4', // 字符集
'DB_DEBUG' => false, // 数据库调试模式 开启后可以记录SQL日志
);
?>
\ No newline at end of file
......@@ -17,7 +17,7 @@ return array(
'DB_PORT' => 3306, // 端口
'DB_PARAMS' => array(), // 数据库连接参数
'DB_PREFIX' => 's_', // 数据库表前缀
'DB_CHARSET'=> 'utf8', // 字符集
'DB_CHARSET'=> 'utf8mb4', // 字符集
'DB_DEBUG' => false, // 数据库调试模式 开启后可以记录SQL日志
);
?>
\ No newline at end of file
<?php
/**
* 多语言支持定义
* 扩展钩子
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
......
......@@ -17,7 +17,7 @@ return array(
'DB_PORT' => 3306, // 端口
'DB_PARAMS' => array(), // 数据库连接参数
'DB_PREFIX' => 's_', // 数据库表前缀
'DB_CHARSET'=> 'utf8', // 字符集
'DB_CHARSET'=> 'utf8mb4', // 字符集
'DB_DEBUG' => false, // 数据库调试模式 开启后可以记录SQL日志
);
?>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ShopXO安装程序</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="./static/js/jquery-2.0.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="./static/bootstrap-3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./static/bootstrap-3.3.5/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="./static/font-awesome-4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="./static/css/bjy.css">
<script type="text/javascript" src="./static/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="./static/js/html5shiv.min.js"></script>
<script type="text/javascript" src="./static/js/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="./static/css/install.css">
</head>
<body>
<div id="nav">
<div class="inside">
<p class="name">ShopXO<span>安装向导</span></p>
<ul class="schedule active">
<li class="number">1</li>
<li class="word">使用协议</li>
</ul>
<ul class="schedule">
<li class="number">2</li>
<li class="word">环境检测</li>
</ul>
<ul class="schedule">
<li class="number">3</li>
<li class="word">创建数据</li>
</ul>
<ul class="schedule">
<li class="number">4</li>
<li class="word">安装完成</li>
</ul>
</div>
</div>
<div id="out">
<div class="inside">
<div class="box agreement">
<h2>安装协议</h2>
<div class="content">
版权所有 (c) 2014-至今,ShopXO保留所有权利。<br />
感谢您选择ShopXO产品。希望我们的努力能为您提供一个高效快速、强大的企业级电商系统解决方案,ShopXO网址为 <a href="http://shopxo.net" target="_blank">http://shopxo.net</a><br /><br />
用户须知:本协议是您与ShopXO之间关于您使用ShopXO提供的各种软件产品及服务的法律协议。无论您是个人或组织、盈利与否、用途如何(包括以学习和研究为目的),均需仔细阅读本协议,包括免除或者限制ShopXO责任的免责条款及对您的权利限制。请您审阅并接受或不接受本服务条款。如您不同意本服务条款及/或ShopXO随时对其的修改,您应不使用或主动取消ShopXO提供的ShopXO产品。否则,您的任何对ShopXO产品中的相关服务的注册、登陆、下载、查看等使用行为将被视为您对本服务条款全部的完全接受,包括接受ShopXO对服务条款随时所做的任何修改。<br /><br />
本服务条款一旦发生变更, ShopXO将在网页上公布修改内容。修改后的服务条款一旦在网站管理后台上公布即有效代替原来的服务条款。您可随时登陆ShopXO官方论坛查阅最新版服务条款。如果您选择接受本条款,即表示您同意接受协议各项条件的约束。如果您不同意本服务条款,则不能获得使用本服务的权利。您若有违反本条款规定,ShopXO有权随时中止或终止您对ShopXO产品的使用资格并保留追究相关法律责任的权利。<br /><br />
在理解、同意、并遵守本协议的全部条款后,方可开始使用ShopXO产品。您可能与ShopXO直接签订另一书面协议,以补充或者取代本协议的全部或者任何部分。<br /><br />
ShopXO拥有本软件的全部知识产权。本软件只供许可协议,并非出售。ShopXO只允许您在遵守本协议各项条款的情况下复制、下载、安装、使用或者以其他方式受益于本软件的功能或者知识产权。<br /><br />
I. 协议许可的权利<br /><br />
您可以在完全遵守本许可协议的基础上,将本软件应用于非商业用途,而不必支付软件版权许可费用。<br /><br />
您可以在协议规定的约束和限制范围内修改ShopXO产品源代码(如果被提供的话)或界面风格以适应您的网站要求。<br /><br />
您拥有使用本软件构建的网站中全部会员资料、文章及相关信息的所有权,并独立承担与使用本软件构建的网站内容的审核、注意义务,确保其不侵犯任何人的合法权益,独立承担因使用ShopXO软件和服务带来的全部责任,若造成ShopXO或用户损失的,您应予以全部赔偿。<br /><br />
若您需将ShopXO软件或服务用户商业用途,必须另行获得ShopXO的书面许可,您在获得商业授权之后,您可以将本软件应用于商业用途,同时依据所购买的授权类型中确定的技术支持期限、技术支持方式和技术支持内容,自购买时刻起,在技术支持期限内拥有通过指定的方式获得指定范围内的技术支持服务。商业授权用户享有反映和提出意见的权力,相关意见将被作为首要考虑,但没有一定被采纳的承诺或保证。<br /><br />
您可以从ShopXO提供的应用中心服务中下载适合您网站的应用程序,但应向应用程序开发者/所有者支付相应的费用。
II. 协议规定的约束和限制<br /><br />
未获ShopXO书面商业授权之前,不得将本软件用于商业用途(包括但不限于企业网站、经营性网站、以营利为目或实现盈利的网站)。购买商业授权请登陆http://shopxo.net参考相关说明。<br /><br />
不得对本软件或与之关联的商业授权进行出租、出售、抵押或发放子许可证。<br /><br />
无论如何,即无论用途如何、是否经过修改或美化、修改程度如何,只要使用ShopXO产品的整体或任何部分,未经书面许可,页面页脚处的ShopXO产品名称和ShopXO下属网站(http://shopxo.net、或 http://gong.gg 的链接都必须保留,而不能清除或修改。<br /><br />
禁止在ShopXO产品的整体或任何部分基础上以发展任何派生版本、修改版本或第三方版本用于重新分发。<br /><br />
您从应用中心下载的应用程序,未经应用程序开发者/所有者的书面许可,不得对其进行反向工程、反向汇编、反向编译等,不得擅自复制、修改、链接、转载、汇编、发表、出版、发展与之有关的衍生产品、作品等。<br /><br />
如果您未能遵守本协议的条款,您的授权将被终止,所许可的权利将被收回,同时您应承担相应法律责任。
III. 有限担保和免责声明<br /><br />
本软件及所附带的文件是作为不提供任何明确的或隐含的赔偿或担保的形式提供的。<br /><br />
用户出于自愿而使用本软件,您必须了解使用本软件的风险,在尚未购买产品技术服务之前,我们不承诺提供任何形式的技术支持、使用担保,也不承担任何因使用本软件而产生问题的相关责任。<br /><br />
ShopXO不对使用本软件构建的网站中或者论坛中的文章或信息承担责任,全部责任由您自行承担。<br /><br />
ShopXO无法全面监控由第三方上传至应用中心的应用程序,因此不保证应用程序的合法性、安全性、完整性、真实性或品质等;您从应用中心下载应用程序时,同意自行判断并承担所有风险,而不依赖于ShopXO。但在任何情况下,ShopXO有权依法停止应用中心服务并采取相应行动,包括但不限于对于相关应用程序进行卸载,暂停服务的全部或部分,保存有关记录,并向有关机关报告。由此对您及第三人可能造成的损失,ShopXO不承担任何直接、间接或者连带的责任。<br /><br />
ShopXO对ShopXO提供的软件和服务之及时性、安全性、准确性不作担保,由于不可抗力因素、ShopXO无法控制的因素(包括黑客攻击、停断电等)等造成软件使用和服务中止或终止,而给您造成损失的,您同意放弃追究ShopXO责任的全部权利。 6.ShopXO特别提请您注意,ShopXO为了保障公司业务发展和调整的自主权,ShopXO拥有随时经或未经事先通知而修改服务内容、中止或终止部分或全部软件使用和服务的权利,修改会公布于ShopXO网站相关页面上,一经公布视为通知。 <br /><br />ShopXO行使修改或中止、终止部分或全部软件使用和服务的权利而造成损失的,ShopXO不需对您或任何第三方负责。
有关ShopXO产品最终用户授权协议、商业授权与技术服务的详细内容,均由ShopXO独家提供。ShopXO拥有在不事先通知的情况下,修改授权协议和服务价目表的权利,修改后的协议或价目表对自改变之日起的新授权用户生效。<br /><br />
一旦您开始安装ShopXO产品,即被视为完全理解并接受本协议的各项条款,在享有上述条款授予的权利的同时,受到相关的约束和限制。协议许可范围以外的行为,将直接违反本授权协议并构成侵权,我们有权随时终止授权,责令停止损害,并保留追究相关责任的权力。<br /><br />
本许可协议条款的解释,效力及纠纷的解决,适用于中华人民共和国大陆法律。<br /><br />
若您和ShopXO之间发生任何纠纷或争议,首先应友好协商解决,协商不成的,您在此完全同意将纠纷或争议提交ShopXO所在地上海市浦东新区人民法院管辖。ShopXO拥有对以上各项条款内容的解释权及修改权。<br /><br />
(正文完)<br />
</div>
<p class="agree">
<button class="btn btn-primary">拒绝</button>
<a class="btn btn-success" href="./index.php?c=test">同意</a>
</p>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
<?php
/**
* 行为记录
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:50:41+0800
*/
class behavior
{
/**
* [__construct 开始收集数据]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:51:02+0800
* @param [array] $param [参数]
*/
public function __construct($param = array())
{
// 数据列表
$data = array(
'user' => $this->GetUserCookie(),
'host' => $this->GetUrl('host'),
'server_port' => $this->GetServerPort(),
'server_ip' => $this->GetServerIP(),
'url' => $this->GetUrl('url'),
'request_url' => $this->GetUrl('request'),
'source_url' => $this->GetSourceUrl(),
'client_ip' => $this->GetClientIP(),
'os' => $this->GetOs(),
'browser' => $this->GetBrowser(),
'method' => $this->GetMethod(),
'scheme' => $this->GetScheme(),
'version' => $this->GetHttpVersion(),
'client' => $this->GetClinet(),
'php_os' => PHP_OS,
'php_version' => PHP_VERSION,
'php_sapi_name' => php_sapi_name(),
'client_date' => date('Y-m-d H:i:s'),
'ymd' => date('Ymd'),
'ver' => '2.3.1',
);
// 描述信息
if(!empty($param['msg']))
{
$data['msg'] = $param['msg'];
}
// mysql版本
if(!empty($param['mysql_version']))
{
$data['mysql_version'] = $param['mysql_version'];
}
// 上报数据
$url = 'http://schoolcms.gong.gg/report/innstall.php';
if(function_exists('curl_init'))
{
$this->CurlPost($url, $data);
} else {
$this->Fsockopen_Post($url, $data);
}
}
/**
* [CurlPost curl post]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T21:58:54+0800
* @param [string] $url [请求地址]
* @param [array] $post [发送的post数据]
*/
private function CurlPost($url, $post)
{
$options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HEADER => false,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $post,
);
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
/**
* [Fsockopen_Post fsockopen方式]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-03T21:58:54+0800
* @param [string] $url [url地址]
* @param [string] $data [发送参数]
*/
private function Fsockopen_Post($url, $data = '')
{
$row = parse_url($url);
$host = $row['host'];
$port = isset($row['port']) ? $row['port'] : 80;
$file = $row['path'];
$post = '';
while (list($k,$v) = each($data))
{
if(isset($k) && isset($v)) $post .= rawurlencode($k)."=".rawurlencode($v)."&"; //转URL标准码
}
$post = substr( $post , 0 , -1 );
$len = strlen($post);
$fp = @fsockopen( $host ,$port, $errno, $errstr, 10);
if (!$fp) {
return "$errstr ($errno)\n";
} else {
$receive = '';
$out = "POST $file HTTP/1.0\r\n";
$out .= "Host: $host\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Connection: Close\r\n";
$out .= "Content-Length: $len\r\n\r\n";
$out .= $post;
fwrite($fp, $out);
while (!feof($fp)) {
$receive .= fgets($fp, 128);
}
fclose($fp);
$receive = explode("\r\n\r\n",$receive);
unset($receive[0]);
return implode("",$receive);
}
}
/**
* [GetScheme http类型]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:04:33+0800
*/
private function GetScheme()
{
return empty($_SERVER['HTTPS']) ? 'HTTP' : 'HTTPS';
}
/**
* [GetClinet 客户端]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:04:56+0800
*/
private function GetClinet()
{
return empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT'];
}
/**
* [GetHttpVersion http版本]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:04:43+0800
*/
private function GetHttpVersion()
{
return empty($_SERVER['SERVER_PROTOCOL']) ? '' : str_replace(array('HTTP/', 'HTTPS/'), '', $_SERVER['SERVER_PROTOCOL']);
}
/**
* [GetMethod 请求类型]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:04:23+0800
*/
private function GetMethod()
{
return empty($_SERVER['REQUEST_METHOD']) ? '' : $_SERVER['REQUEST_METHOD'];
}
/**
* [GetOs 用户操作系统]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:02:06+0800
*/
private function GetOs()
{
if(!empty($_SERVER['HTTP_USER_AGENT']))
{
$os = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/win/i', $os))
{
$os = 'Windows';
} elseif (preg_match('/mac/i',$os))
{
$os = 'MAC';
} elseif (preg_match('/linux/i', $os))
{
$os = 'Linux';
} elseif (preg_match('/unix/i', $os))
{
$os = 'Unix';
} elseif (preg_match('/bsd/i', $os))
{
$os = 'BSD';
} elseif (preg_match('/iphone/i', $os))
{
$os = 'iPhone';
} elseif (preg_match('/android/i', $os))
{
$os = 'Android';
} else {
$os = 'Other';
}
return $os;
}
return 'unknown';
}
/**
* [GetBrowser 用户浏览器]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:03:14+0800
*/
private function GetBrowser()
{
if(!empty($_SERVER['HTTP_USER_AGENT']))
{
$br = $_SERVER['HTTP_USER_AGENT'];
if(preg_match('/MSIE/i', $br))
{
$br = 'MSIE';
} elseif(preg_match('/Firefox/i', $br))
{
$br = 'Firefox';
} elseif(preg_match('/Chrome/i', $br))
{
$br = 'Chrome';
} elseif(preg_match('/Safari/i', $br))
{
$br = 'Safari';
} elseif (preg_match('/Opera/i', $br))
{
$br = 'Opera';
} else {
$br = 'Other';
}
return $br;
}
return 'unknown';
}
/**
* [GetUrl 获取url地址]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:29:03+0800
* @param [string] $type [host:host地址, url:url地址, request:完整url地址]
*/
private function GetUrl($type = 'url')
{
// 当前host
$host = empty($_SERVER['HTTP_HOST']) ? '' : $_SERVER['HTTP_HOST'];
// 是否获取host
if($type == 'host')
{
return $host;
}
// http类型
$http = empty($_SERVER['HTTPS']) ? 'http' : 'https';
// 根目录
if(!empty($_SERVER['SCRIPT_NAME']))
{
$root = substr($_SERVER['SCRIPT_NAME'], 0, strrpos($_SERVER['SCRIPT_NAME'], '/')+1);
} else {
if(!empty($_SERVER['PHP_SELF']))
{
$root = substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], '/')+1);
}
}
// url 或 request
if($type == 'url')
{
return $http.'://'.$host.$root;
} else {
if(!empty($_SERVER['REQUEST_URI']))
{
return $http.'://'.$host.$_SERVER['REQUEST_URI'];
}
}
}
/**
* [GetServerIP 获取服务器ip]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:34:24+0800
*/
private function GetServerIP()
{
return empty($_SERVER['SERVER_ADDR']) ? '' : $_SERVER['SERVER_ADDR'];
}
/**
* [GetServerPort 获取当前web端口]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:35:42+0800
*/
private function GetServerPort()
{
return empty($_SERVER['SERVER_PORT']) ? 80 : $_SERVER['SERVER_PORT'];
}
/**
* [GetClientIP 获取用户ip]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T16:00:10+0800
* @param [boolean] $long [是否转换成整数]
*/
function GetClientIP($long = false)
{
$onlineip = '';
if(getenv('HTTP_CLIENT_IP') && strcasecmp(getenv('HTTP_CLIENT_IP'),'unknown'))
{
$onlineip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR') && strcasecmp(getenv('HTTP_X_FORWARDED_FOR'), 'unknown'))
{
$onlineip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR' ) && strcasecmp(getenv('REMOTE_ADDR'),'unknown'))
{
$onlineip = getenv('REMOTE_ADDR');
} elseif(isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] && strcasecmp($_SERVER['REMOTE_ADDR'],'unknown'))
{
$onlineip = $_SERVER['REMOTE_ADDR'];
}
if($long)
{
$onlineip = sprintf("%u", ip2long($realip));
}
return $onlineip;
}
/**
* [GetSourceUrl 获取来源url地址]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T15:57:00+0800
*/
private function GetSourceUrl()
{
return empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'];
}
/**
* [GetUserCookie 获取用户cookieid]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T15:55:12+0800
*/
private function GetUserCookie()
{
if(!empty($_COOKIE['behavior_user_cookie'])) return $_COOKIE['behavior_user_cookie'];
$user_cookie = $this->GetUserNumberRand();
setcookie('behavior_user_cookie', $user_cookie);
return $user_cookie;
}
/**
* [GetUserNumberRand 生成用户cookie编号]
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-04-11T15:56:14+0800
*/
private function GetUserNumberRand()
{
$str = date('YmdHis');
for($i=0; $i<6; $i++) $str .= rand(0, 9);
return $str;
}
}
?>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ShopXO安装程序</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="text/javascript" src="./static/js/jquery-2.0.0.min.js"></script>
<link rel="stylesheet" type="text/css" href="./static/bootstrap-3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./static/bootstrap-3.3.5/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="./static/font-awesome-4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="./static/css/bjy.css">
<script type="text/javascript" src="./static/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script type="text/javascript" src="./static/js/html5shiv.min.js"></script>
<script type="text/javascript" src="./static/js/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" href="./static/css/install.css">
</head>
<body>
<div id="nav">
<div class="inside">
<p class="name">ShopXO<span>安装向导</span></p>
<ul class="schedule">
<li class="number">1</li>
<li class="word">使用协议</li>
</ul>
<ul class="schedule">
<li class="number">2</li>
<li class="word">环境检测</li>
</ul>
<ul class="schedule active">
<li class="number">3</li>
<li class="word">创建数据</li>
</ul>
<ul class="schedule">
<li class="number">4</li>
<li class="word">安装完成</li>
</ul>
</div>
</div>
<div id="out">
<div class="inside">
<div class="box create">
<form class="form-inline" action="./index.php?c=success" method="post" >
<h2>数据库信息</h2>
<div class="one">
<label class="control-label">数据库类型</label>
<input class="form-control" type="text" name="DB_TYPE" value="mysql" disabled="disabled" />
</div>
<div class="one">
<label class="control-label"> 数据库服务器</label>
<input class="form-control" type="text" name="DB_HOST" value="127.0.0.1" />
</div>
<div class="one">
<label class="control-label"> 数据库端口</label>
<input class="form-control" type="text" name="DB_PORT" value="3306" />
</div>
<div class="one">
<label class="control-label">数据库名</label>
<input class="form-control" type="text" name="DB_NAME" value="shopxo" />
</div>
<div class="one">
<label class="control-label">数据库用户名</label>
<input class="form-control" type="text" name="DB_USER" value="root">
</div>
<div class="one">
<label class="control-label"> 数据库密码</label>
<input class="form-control" type="text" name="DB_PWD">
</div>
<div class="one">
<label class="control-label"> 数据表前缀</label>
<input class="form-control" type="text" name="DB_PREFIX" value="s_" />
</div>
<p class="agree">
<a class="btn btn-primary" href="./index.php?c=test">上一步</a>
<input class="btn btn-success" type="submit" value="确认" />
</p>
</form>
</div>
</div>
</div>
</body>
</html>
<?php
/**
* 安装向导
*/
// 编码
header('Content-type:text/html;charset=utf-8');
date_default_timezone_set("PRC");
// 检测是否安装过
if(file_exists('./install.lock'))
{
exit('你已经安装过该系统,重新安装需要先删除./Install/install.lock 文件');
}
// 行为类库
require './behavior.class.php';
// 参数
$c = isset($_GET['c']) ? trim($_GET['c']) : '';
// 同意协议页面
if($c == 'agreement' || empty($c))
{
new behavior(array('msg'=>'协议阅读'));
exit(require './agreement.html');
}
// 环境检测页面
if($c == 'test')
{
new behavior(array('msg'=>'环境检测'));
exit(require './test.html');
}
// 创建数据库页面
if($c == 'create')
{
new behavior(array('msg'=>'数据信息填写'));
exit(require './create.html');
}
// 安装成功页面
if($c == 'success')
{
// mysql版本信息
$mysql_ver = '';
// 判断是否为post
if($_SERVER['REQUEST_METHOD']=='POST')
{
$data = $_POST;
// 连接数据库
$constr = "{$data['DB_HOST']}";
if(!empty($data['DB_PORT']))
{
$constr .= ":{$data['DB_PORT']}";
}
$link = @new mysqli($constr, $data['DB_USER'], $data['DB_PWD']);
// 获取错误信息
$error = $link->connect_error;
if (!is_null($error)) {
// 转义防止和alert中的引号冲突
$error = addslashes($error);
// 数据库连接失败上报
new behavior(array('msg'=>'数据库连接失败['.$error.']'));
die("<script>alert('数据库链接失败:$error');history.go(-1)</script>");
}
// 设置字符集
$link->query("SET NAMES 'utf8mb4'");
// 数据库版本校验
if($link->server_info < 5.0)
{
// 数据库版本过低上报
new behavior(array('msg'=>'数据库版本过低['.$link->server_info.']', 'mysql_version'=>$link->server_info));
die("<script>alert('请将您的mysql升级到5.0以上');history.go(-1)</script>");
}
$mysql_ver = $link->server_info;
// 创建数据库并选中
if(!$link->select_db($data['DB_NAME'])){
$create_sql='CREATE DATABASE IF NOT EXISTS '.$data['DB_NAME'].' DEFAULT CHARACTER SET utf8mb4;';
if(!$link->query($create_sql))
{
// 数据库创建失败上报
new behavior(array('msg'=>'创建数据库失败', 'mysql_version'=>$mysql_ver));
die('创建数据库失败');
}
$link->select_db($data['DB_NAME']);
}
// 导入sql数据并创建表
$shopxo_str = file_get_contents('./shopxo.sql');
$sql_array = preg_split("/;[\r\n]+/", str_replace('s_', $data['DB_PREFIX'], $shopxo_str));
$success = 0;
$failure = 0;
foreach ($sql_array as $k => $v) {
if (!empty($v)) {
if($link->query($v))
{
$success++;
} else {
$failure++;
}
}
}
$link->close();
// 数据表创建上报
new behavior(array('msg'=>'运行sql[成功'.$success.', 失败'.$failure.']', 'mysql_version'=>$mysql_ver));
// 配置文件信息处理
$db_str=<<<php
<?php
/**
* 数据库配置信息-自动安装生成
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2016-12-01T21:51:08+0800
*/
return array(
// 数据库配置信息
'DB_TYPE' => 'mysql', // 数据库类型
'DB_HOST' => '{$data['DB_HOST']}', // 服务器地址
'DB_NAME' => '{$data['DB_NAME']}', // 数据库名
'DB_USER' => '{$data['DB_USER']}', // 用户名
'DB_PWD' => '{$data['DB_PWD']}', // 密码
'DB_PORT' => {$data['DB_PORT']}, // 端口
'DB_PARAMS' => array(), // 数据库连接参数
'DB_PREFIX' => '{$data['DB_PREFIX']}', // 数据库表前缀
'DB_CHARSET'=> 'utf8mb4', // 字符集
'DB_DEBUG' => false, // 数据库调试模式 开启后可以记录SQL日志
);
?>
php;
// 创建数据库链接配置文件,master,develop,test,debug 分别都更新,core模式没更改
@file_put_contents('../Application/Common/Conf/master.php', $db_str);
@file_put_contents('../Application/Common/Conf/develop.php', $db_str);
@file_put_contents('../Application/Common/Conf/test.php', $db_str);
@file_put_contents('../Application/Common/Conf/debug.php', $db_str);
@touch('./install.lock');
// 安装完成上报
new behavior(array('msg'=>'安装完成', 'mysql_version'=>$mysql_ver));
// 显示安装成功信息
exit(require './success.html');
}
}
exit('非法访问');
?>
\ No newline at end of file
此差异已折叠。
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')
\ No newline at end of file
@charset "utf-8";
/* CSS Document */
/* 清除内外边距 */
body,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
blockquote,
dl,
dt,
dd,
ul,
ol,
li,
pre,
fieldset,
lengend,
button,
input,
textarea,
th,
td {
/* table elements 表格元素 */
margin: 0;
padding: 0;
}
/* 将斜体扶正 */
em,
i {
font-style: normal;
}
/* 重置列表元素 */
ul,
ol,
li {
list-style: none;
}
/* 重置a标签属性 */
a {
text-decoration: none;
}
a:hover {
text-decoration: none;
transition: all 0.5s ease 0s;
color: #0B7DF2;
}
a:focus {
outline: none;
text-decoration: none;
-moz-outline: none;
}
/* 让链接里的 img 无边框 */
img {
border: none;
}
/* 使得表单元素在 ie 下能继承字体大小 */
button,
input,
select,
textarea {
font-size: 100%;
}
/*表格内容自动换行*/
table {
word-break: break-all;
word-wrap: break-word;
}
/*禁止textarea拖动*/
textarea {
resize: none;
}
/* 常用样式 */
.b-clear-float {
clear: both;
}
.b-ta-center {
text-align: center;
}
.b-h-10 {
width: 100%;
height: 10px;
}
.b-h-20 {
width: 100%;
height: 20px;
}
.b-h-30 {
width: 100%;
height: 30px;
}
.b-h-40 {
width: 100%;
height: 40px;
}
.b-h-50 {
width: 100%;
height: 50px;
}
.b-h-60 {
width: 100%;
height: 60px;
}
.b-h-70 {
width: 100%;
height: 70px;
}
.b-h-80 {
width: 100%;
height: 80px;
}
.b-h-90 {
width: 100%;
height: 90px;
}
.b-h-100 {
width: 100%;
height: 100px;
}
.b-h-110 {
width: 100%;
height: 110px;
}
.b-h-120 {
width: 100%;
height: 120px;
}
.b-h-130 {
width: 100%;
height: 130px;
}
.b-h-140 {
width: 100%;
height: 140px;
}
.b-h-150 {
width: 100%;
height: 150px;
}
.b-h-160 {
width: 100%;
height: 160px;
}
.b-h-170 {
width: 100%;
height: 170px;
}
.b-h-180 {
width: 100%;
height: 180px;
}
.b-h-190 {
width: 100%;
height: 190px;
}
.b-h-200 {
width: 100%;
height: 200px;
}
/* 分页开始 */
.b-page {
background: #fff;
box-shadow: 0px 1px 2px 0px #E2E2E2;
}
.page {
width: 100%;
padding: 30px 15px;
background: #FFF;
text-align: center;
overflow: hidden;
}
.page .first,
.page .prev,
.page .current,
.page .num,
.page .current,
.page .next,
.page .end {
padding: 8px 16px;
margin: 0px 5px;
display: inline-block;
color: #008CBA;
border: 1px solid #F2F2F2;
border-radius: 5px;
}
.page .first:hover,
.page .prev:hover,
.page .current:hover,
.page .num:hover,
.page .current:hover,
.page .next:hover,
.page .end:hover {
text-decoration: none;
background: #F8F5F5;
}
.page .current {
background-color: #008CBA;
color: #FFF;
border-radius: 5px;
border: 1px solid #008CBA;
}
.page .current:hover {
text-decoration: none;
background: #008CBA;
}
/* 分页结束 */
.pace {
-webkit-pointer-events: none;
pointer-events: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
position: fixed;
top: 0;
left: 0;
z-index: 999999999999;
width: 100%;
-webkit-transform: translate3d(0, -50px, 0);
-ms-transform: translate3d(0, -50px, 0);
transform: translate3d(0, -50px, 0);
-webkit-transition: -webkit-transform 0.5s ease-out;
-ms-transition: -webkit-transform 0.5s ease-out;
transition: transform 0.5s ease-out;
}
.pace.pace-active {
-webkit-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.pace .pace-progress {
display: block;
position: fixed;
z-index: 999999999999;
top: 0;
right: 100%;
width: 100%;
height: 3px;
background: #0B94C1;
pointer-events: none;
}
@charset "utf-8";
/* CSS Document */
body {
background: #fff;
}
.agree {
width: 100%;
height: 60px;
line-height: 60px;
text-align: center;
}
.b-display-none {
display: none;
}
#nav {
width: 100%;
height: 40px;
background: #333333;
color: #fff;
}
#nav .inside {
margin: 0 auto;
height: 40px;
}
#nav .inside .name {
width: 160px;
height: 40px;
font-size: 20px;
float: left;
margin-top: 7px;
}
#nav .inside .name span {
font-size: 12px;
margin-left: 2px;
}
#nav .inside .schedule {
margin-left: 5px;
width: 17%;
height: 30px;
float: left;
margin-top: 8px;
}
#nav .inside .schedule .number {
width: 25px;
height: 25px;
line-height: 25px;
text-align: center;
font-size: 12px;
border-radius: 50%;
background: #80AAB7;
float: left;
}
#nav .inside .schedule .word {
width: 60px;
height: 25px;
float: left;
line-height: 28px;
text-indent: 5px;
font-size: 12px;
}
#nav .inside .active .number {
background: #008CBA;
}
#nav .inside .active .word {
color: #008CBA;
}
#out {
width: 100%;
overflow: hidden;
}
#out .inside {
margin: 0 auto;
padding: 10px;
background: #fff;
overflow: hidden;
}
#out .inside, #nav .inside {
width: 80%;
}
#out .inside .agreement {
overflow: hidden;
}
#out .inside .agreement .content {
font-size: 14px;
margin-top: 10px;
}
#out .inside .agreement .admin_hint {
color: red;
}
#out .inside .create .one {
margin-top: 10px;
}
#out .inside .create .one label {
width: 100px;
}
h2 {
font-size: 16px;
margin-bottom: 5px;
}
.agree .btn-primary {
margin-right: 20px;
}
.agree .btn-success {
margin-left: 20px;
}
.test h2 {
background: #eaeaea;
margin-bottom: 0px;
padding: 5px;
}
@media only screen and (max-width: 641px) {
#nav .inside .name span {
font-size: 12px;
}
#nav .inside .schedule .number {
width: 20px;
height: 20px;
line-height: 20px;
}
#nav .inside .schedule {
margin-top: 10px;
}
#nav .inside .schedule .word {
width: 53px;
height: 20px;
line-height: 20px;
}
#nav .inside .schedule .word
{
text-indent: 3px;
}
#nav .inside .schedule {
width: 23%;
}
#out .inside, #nav .inside {
width: 100%;
}
#nav .inside .name {
display: none;
}
}
@media only screen and (min-width: 641px) {
.create .one input {
width: 70%;
}
}
\ No newline at end of file
I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project,
Fonticons (https://fonticons.com). It makes it easy to put the perfect icons on your website. Choose from our awesome,
comprehensive icon sets or copy and paste your own.
Please. Check it out.
-Dave Gandy
// Animated Icons
// --------------------------
.@{fa-css-prefix}-spin {
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
.@{fa-css-prefix}-pulse {
-webkit-animation: fa-spin 1s infinite steps(8);
animation: fa-spin 1s infinite steps(8);
}
@-webkit-keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
// Bordered & Pulled
// -------------------------
.@{fa-css-prefix}-border {
padding: .2em .25em .15em;
border: solid .08em @fa-border-color;
border-radius: .1em;
}
.@{fa-css-prefix}-pull-left { float: left; }
.@{fa-css-prefix}-pull-right { float: right; }
.@{fa-css-prefix} {
&.@{fa-css-prefix}-pull-left { margin-right: .3em; }
&.@{fa-css-prefix}-pull-right { margin-left: .3em; }
}
/* Deprecated as of 4.4.0 */
.pull-right { float: right; }
.pull-left { float: left; }
.@{fa-css-prefix} {
&.pull-left { margin-right: .3em; }
&.pull-right { margin-left: .3em; }
}
// Base Class Definition
// -------------------------
.@{fa-css-prefix} {
display: inline-block;
font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// Fixed Width Icons
// -------------------------
.@{fa-css-prefix}-fw {
width: (18em / 14);
text-align: center;
}
/*!
* Font Awesome 4.4.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/
@import "variables.less";
@import "mixins.less";
@import "path.less";
@import "core.less";
@import "larger.less";
@import "fixed-width.less";
@import "list.less";
@import "bordered-pulled.less";
@import "animated.less";
@import "rotated-flipped.less";
@import "stacked.less";
@import "icons.less";
// Icon Sizes
// -------------------------
/* makes the font 33% larger relative to the icon container */
.@{fa-css-prefix}-lg {
font-size: (4em / 3);
line-height: (3em / 4);
vertical-align: -15%;
}
.@{fa-css-prefix}-2x { font-size: 2em; }
.@{fa-css-prefix}-3x { font-size: 3em; }
.@{fa-css-prefix}-4x { font-size: 4em; }
.@{fa-css-prefix}-5x { font-size: 5em; }
// List Icons
// -------------------------
.@{fa-css-prefix}-ul {
padding-left: 0;
margin-left: @fa-li-width;
list-style-type: none;
> li { position: relative; }
}
.@{fa-css-prefix}-li {
position: absolute;
left: -@fa-li-width;
width: @fa-li-width;
top: (2em / 14);
text-align: center;
&.@{fa-css-prefix}-lg {
left: (-@fa-li-width + (4em / 14));
}
}
// Mixins
// --------------------------
.fa-icon() {
display: inline-block;
font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.fa-icon-rotate(@degrees, @rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation);
-webkit-transform: rotate(@degrees);
-ms-transform: rotate(@degrees);
transform: rotate(@degrees);
}
.fa-icon-flip(@horiz, @vert, @rotation) {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=@rotation, mirror=1);
-webkit-transform: scale(@horiz, @vert);
-ms-transform: scale(@horiz, @vert);
transform: scale(@horiz, @vert);
}
/* FONT PATH
* -------------------------- */
@font-face {
font-family: 'FontAwesome';
src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}');
src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'),
url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'),
url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'),
url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'),
url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg');
// src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts
font-weight: normal;
font-style: normal;
}
// Rotated & Flipped Icons
// -------------------------
.@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); }
.@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); }
.@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); }
.@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); }
.@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); }
// Hook for IE8-9
// -------------------------
:root .@{fa-css-prefix}-rotate-90,
:root .@{fa-css-prefix}-rotate-180,
:root .@{fa-css-prefix}-rotate-270,
:root .@{fa-css-prefix}-flip-horizontal,
:root .@{fa-css-prefix}-flip-vertical {
filter: none;
}
// Stacked Icons
// -------------------------
.@{fa-css-prefix}-stack {
position: relative;
display: inline-block;
width: 2em;
height: 2em;
line-height: 2em;
vertical-align: middle;
}
.@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x {
position: absolute;
left: 0;
width: 100%;
text-align: center;
}
.@{fa-css-prefix}-stack-1x { line-height: inherit; }
.@{fa-css-prefix}-stack-2x { font-size: 2em; }
.@{fa-css-prefix}-inverse { color: @fa-inverse; }
// Spinning Icons
// --------------------------
.#{$fa-css-prefix}-spin {
-webkit-animation: fa-spin 2s infinite linear;
animation: fa-spin 2s infinite linear;
}
.#{$fa-css-prefix}-pulse {
-webkit-animation: fa-spin 1s infinite steps(8);
animation: fa-spin 1s infinite steps(8);
}
@-webkit-keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
@keyframes fa-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
// Bordered & Pulled
// -------------------------
.#{$fa-css-prefix}-border {
padding: .2em .25em .15em;
border: solid .08em $fa-border-color;
border-radius: .1em;
}
.#{$fa-css-prefix}-pull-left { float: left; }
.#{$fa-css-prefix}-pull-right { float: right; }
.#{$fa-css-prefix} {
&.#{$fa-css-prefix}-pull-left { margin-right: .3em; }
&.#{$fa-css-prefix}-pull-right { margin-left: .3em; }
}
/* Deprecated as of 4.4.0 */
.pull-right { float: right; }
.pull-left { float: left; }
.#{$fa-css-prefix} {
&.pull-left { margin-right: .3em; }
&.pull-right { margin-left: .3em; }
}
// Base Class Definition
// -------------------------
.#{$fa-css-prefix} {
display: inline-block;
font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration
font-size: inherit; // can't have font-size inherit on line above, so need to override
text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
// Fixed Width Icons
// -------------------------
.#{$fa-css-prefix}-fw {
width: (18em / 14);
text-align: center;
}
// Icon Sizes
// -------------------------
/* makes the font 33% larger relative to the icon container */
.#{$fa-css-prefix}-lg {
font-size: (4em / 3);
line-height: (3em / 4);
vertical-align: -15%;
}
.#{$fa-css-prefix}-2x { font-size: 2em; }
.#{$fa-css-prefix}-3x { font-size: 3em; }
.#{$fa-css-prefix}-4x { font-size: 4em; }
.#{$fa-css-prefix}-5x { font-size: 5em; }
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册