Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jcy2004x
ShopXO
提交
0c4bff1a
ShopXO
项目概览
jcy2004x
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0c4bff1a
编写于
11月 14, 2018
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
安装程序优化
上级
a228b541
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
236 addition
and
59 deletion
+236
-59
service/Install/create.html
service/Install/create.html
+1
-2
service/Install/index.php
service/Install/index.php
+21
-25
service/Install/shopxo.sql
service/Install/shopxo.sql
+0
-0
service/Install/static/css/install.css
service/Install/static/css/install.css
+7
-0
service/Install/success.html
service/Install/success.html
+0
-1
service/Install/test.html
service/Install/test.html
+207
-31
未找到文件。
service/Install/create.html
浏览文件 @
0c4bff1a
...
...
@@ -79,6 +79,5 @@
</div>
</div>
</div>
</body>
</html>
</html>
\ No newline at end of file
service/Install/index.php
浏览文件 @
0c4bff1a
...
...
@@ -28,7 +28,7 @@ if($c == 'agreement' || empty($c))
// 环境检测页面
if
(
$c
==
'test'
)
{
new
behavior
(
array
(
'msg'
=>
'环境检测'
));
new
behavior
(
array
(
'msg'
=>
'环境检测'
));
exit
(
require
'./test.html'
);
}
// 创建数据库页面
...
...
@@ -44,57 +44,53 @@ if($c == 'success')
$mysql_ver
=
''
;
// 判断是否为post
if
(
$_SERVER
[
'REQUEST_METHOD'
]
==
'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'
]);
$link
=
@
mysqli_connect
(
$data
[
'DB_HOST'
],
$data
[
'DB_USER'
],
$data
[
'DB_PWD'
],
null
,
$data
[
'DB_PORT'
]);
// 获取错误信息
$error
=
$link
->
connect_error
;
if
(
!
is_null
(
$error
))
{
if
(
!
$link
)
{
// 转义防止和alert中的引号冲突
$error
=
addslashes
(
$error
);
$error
=
addslashes
(
mysqli_connect_error
()
.
'['
.
mysqli_connect_errno
()
.
']'
);
// 数据库连接失败上报
new
behavior
(
array
(
'msg'
=>
'数据库连接失败['
.
$error
.
']'
));
die
(
"<script>alert('数据库链接失败:
$error
');history.go(-1)</script>"
);
}
// 设置字符集
$link
->
query
(
"SET NAMES 'utf8mb4'"
);
mysqli_query
(
$link
,
"SET NAMES 'utf8mb4'"
);
// 数据库版本校验
if
(
$link
->
server_info
<
5.0
)
$mysql_ver
=
mysqli_get_server_info
(
$link
);
if
(
$mysql_ver
<
5.0
)
{
// 数据库版本过低上报
new
behavior
(
array
(
'msg'
=>
'数据库版本过低['
.
$
link
->
server_info
.
']'
,
'mysql_version'
=>
$link
->
server_info
));
new
behavior
(
array
(
'msg'
=>
'数据库版本过低['
.
$
mysql_ver
.
']'
,
'mysql_version'
=>
$mysql_ver
));
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
))
if
(
!
mysqli_select_db
(
$link
,
$data
[
'DB_NAME'
])){
$create_sql
=
'CREATE DATABASE IF NOT EXISTS '
.
$data
[
'DB_NAME'
]
.
' DEFAULT CHARACTER SET utf8mb4;'
;
if
(
!
mysqli_query
(
$link
,
$create_sql
))
{
// 数据库创建失败上报
new
behavior
(
array
(
'msg'
=>
'创建数据库失败'
,
'mysql_version'
=>
$mysql_ver
));
die
(
'创建数据库失败'
);
die
(
"<script>alert('创建数据库失败');history.go(-1)</script>"
);
}
$link
->
select_db
(
$data
[
'DB_NAME'
]);
mysqli_select_db
(
$link
,
$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
));
$sql_array
=
preg_split
(
"/;[
\r\n
]+/"
,
str_replace
(
'`s_'
,
'`'
.
$data
[
'DB_PREFIX'
],
file_get_contents
(
'./shopxo.sql'
)));
$success
=
0
;
$failure
=
0
;
foreach
(
$sql_array
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
))
{
if
(
$link
->
query
(
$v
))
if
(
mysqli_query
(
$link
,
$v
))
{
$success
++
;
}
else
{
...
...
@@ -102,7 +98,7 @@ if($c == 'success')
}
}
}
$link
->
close
(
);
mysqli_close
(
$link
);
// 数据表创建上报
new
behavior
(
array
(
'msg'
=>
'运行sql[成功'
.
$success
.
', 失败'
.
$failure
.
']'
,
'mysql_version'
=>
$mysql_ver
));
...
...
@@ -116,7 +112,7 @@ if($c == 'success')
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 201
6-12-0
1T21:51:08+0800
* @datetime 201
8-11-1
1T21:51:08+0800
*/
return array(
// 数据库配置信息
...
...
service/Install/shopxo.sql
100644 → 100755
浏览文件 @
0c4bff1a
文件模式从 100644 更改为 100755
service/Install/static/css/install.css
浏览文件 @
0c4bff1a
...
...
@@ -143,4 +143,11 @@ h2 {
.create
.one
input
{
width
:
70%
;
}
}
#out
table
tr
.yes
td
{
background
:
#f8fff9
;
}
#out
table
tr
:not
(
.yes
)
td
{
background
:
#ffbdb7
;
color
:
#f00
;
}
\ No newline at end of file
service/Install/success.html
浏览文件 @
0c4bff1a
...
...
@@ -44,7 +44,6 @@
<h2>
恭喜您安装成功
</h2>
<p
class=
"content"
>
<a
href=
"../admin.php"
target=
"_blank"
>
后台管理
</a><br
/>
<a
href=
"../index.php"
target=
"_blank"
>
首页
</a><br
/>
<span
class=
"admin_hint"
>
默认账号:admin
 
密码为:shopxo
</span>
<br
/><br
/>
<a
href=
"../index.php"
target=
"_blank"
>
访问首页
</a>
...
...
service/Install/test.html
浏览文件 @
0c4bff1a
...
...
@@ -16,8 +16,10 @@
<![endif]-->
<link
rel=
"stylesheet"
href=
"./static/css/install.css"
>
<script>
function
testClick
(){
if
(
$
(
'
.yes
'
).
length
!=
7
){
function
TestClick
(){
var
count
=
$
(
'
#out table tr
'
).
length
-
3
;
if
(
$
(
'
#out .yes
'
).
length
!=
count
)
{
alert
(
'
您的配置或权限不符合要求
'
);
}
else
{
location
.
href
=
'
./index.php?c=create
'
;
...
...
@@ -50,27 +52,46 @@ function testClick(){
<div
id=
"out"
>
<div
class=
"inside"
>
<div
class=
"box test"
>
<h2>
环境
监测
</h2>
<h2>
环境
检查
</h2>
<table
class=
"table table-border"
>
<tr>
<th
width=
"25%"
>
坏境
</th>
<th
width=
"25%"
>
最低配置
</th>
<th
width=
"25%"
>
当前
配置
</th>
<th
width=
"25%"
>
程序所需
</th>
<th
width=
"25%"
>
当前
服务器
</th>
<th
width=
"25%"
>
是否符合
</th>
</tr>
<tr>
<tr
class=
"yes"
>
<td>
操作系统
</td>
<td>
不限
</td>
<td>
无限制
</td>
<td>
<?php echo php_uname('s'); ?>
</td>
<td
class=
"yes"
>
√
</td>
<td>
√
</td>
</tr>
<tr>
<td>
php版本
</td>
<td>
>
5.4
</td>
<?php $php_version = explode('.', PHP_VERSION); ?>
<tr
class=
"<?php if(($php_version['0'] >= 7) || ($php_version['0'] >=5 && $php_version['1'] >=4 ))echo 'yes'; ?>"
>
<td>
PHP版本
</td>
<td>
>=5.4
</td>
<td>
<?php echo PHP_VERSION ?>
</td>
<?php $php_version=explode('.', PHP_VERSION); ?>
<td
class=
"<?php if(($php_version['0']>=7) || ($php_version['0']>=5 && $php_version['1']>=4))echo 'yes'; ?>"
>
<?php if (($php_version['0']>=7) || ($php_version['0']>=5 && $php_version['1']>=4)): ?>
<td>
<?php if(($php_version['0']>=7) || ($php_version['0']>=5 && $php_version['1']>=4)): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<?php
$tmp = function_exists('gd_info') ? gd_info() : array();
preg_match("/[\d.]+/", $tmp['GD Version'], $match);
unset($tmp);
?>
<tr
class=
"<?php if($match[0] > 2)echo 'yes'; ?>"
>
<td>
GD库
</td>
<td>
2.0
</td>
<td>
<?php echo $match[0]; ?>
</td>
<td>
<?php if($match[0] > 2): ?>
√
<?php else: ?>
×
...
...
@@ -78,15 +99,16 @@ function testClick(){
</td>
</tr>
</table>
<h2>
目录权限
</h2>
<h2>
目录/文件权限检查
</h2>
<table
class=
"table table-border"
>
<tr>
<th
width=
"25%"
>
坏境
</th>
<th
width=
"25%"
>
最低配置
</th>
<th
width=
"25%"
>
当前
配置
</th>
<th
width=
"25%"
>
所需状态
</th>
<th
width=
"25%"
>
当前
状态
</th>
<th
width=
"25%"
>
是否符合
</th>
</tr>
<tr>
<tr
class=
"<?php if(is_writable('../'))echo 'yes'; ?>"
>
<td>
./
</td>
<td>
可写
</td>
<td>
...
...
@@ -96,7 +118,7 @@ function testClick(){
不可写
<?php endif ?>
</td>
<td
class=
"<?php if(is_writable('../'))echo 'yes'; ?>"
>
<td>
<?php if (is_writable('../')): ?>
√
<?php else: ?>
...
...
@@ -104,7 +126,7 @@ function testClick(){
<?php endif ?>
</td>
</tr>
<tr>
<tr
class=
"<?php if(is_writable('../Application'))echo 'yes'; ?>"
>
<td>
./Application
</td>
<td>
可写
</td>
<td>
...
...
@@ -114,7 +136,7 @@ function testClick(){
不可写
<?php endif ?>
</td>
<td
class=
"<?php if(is_writable('../Application'))echo 'yes'; ?>"
>
<td>
<?php if (is_writable('../Application')): ?>
√
<?php else: ?>
...
...
@@ -122,7 +144,7 @@ function testClick(){
<?php endif ?>
</td>
</tr>
<tr>
<tr
class=
"<?php if(is_writable('../Application/Common/Conf'))echo 'yes'; ?>"
>
<td>
./Application/Common/Conf
</td>
<td>
可写
</td>
<td>
...
...
@@ -132,7 +154,7 @@ function testClick(){
不可写
<?php endif ?>
</td>
<td
class=
"<?php if(is_writable('../Application/Common/Conf'))echo 'yes'; ?>"
>
<td>
<?php if (is_writable('../Application/Common/Conf')): ?>
√
<?php else: ?>
...
...
@@ -140,25 +162,43 @@ function testClick(){
<?php endif ?>
</td>
</tr>
<tr>
<td>
./Application/
Runtime/Cache
</td>
<tr
class=
"<?php if(is_writable('../Application/Library/Payment'))echo 'yes'; ?>"
>
<td>
./Application/
Library/Payment
</td>
<td>
可写
</td>
<td>
<?php if (is_writable('../Application/
Runtime/Cache
')): ?>
<?php if (is_writable('../Application/
Library/Payment
')): ?>
可写
<?php else: ?>
不可写
<?php endif ?>
</td>
<td
class=
"<?php if(is_writable('../Application/Runtime/Cache'))echo 'yes'; ?>"
>
<?php if (is_writable('../Application/
Runtime/Cache
')): ?>
<td>
<?php if (is_writable('../Application/
Library/Payment
')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<tr>
<tr
class=
"<?php if(is_writable('../Public'))echo 'yes'; ?>"
>
<td>
./Public
</td>
<td>
可写
</td>
<td>
<?php if (is_writable('../Public')): ?>
可写
<?php else: ?>
不可写
<?php endif ?>
</td>
<td>
<?php if (is_writable('../Public')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<tr
class=
"<?php if(is_writable('./'))echo 'yes'; ?>"
>
<td>
./Install
</td>
<td>
可写
</td>
<td>
...
...
@@ -168,7 +208,7 @@ function testClick(){
不可写
<?php endif ?>
</td>
<td
class=
"<?php if(is_writable('./'))echo 'yes'; ?>"
>
<td>
<?php if (is_writable('./')): ?>
√
<?php else: ?>
...
...
@@ -177,9 +217,145 @@ function testClick(){
</td>
</tr>
</table>
<h2>
函数
</h2>
<table
class=
"table table-border"
>
<tr>
<th
width=
"25%"
>
坏境
</th>
<th
width=
"25%"
>
所需状态
</th>
<th
width=
"25%"
>
当前状态
</th>
<th
width=
"25%"
>
是否符合
</th>
</tr>
<tr
class=
"<?php if(function_exists('curl_init'))echo 'yes'; ?>"
>
<td>
curl_init
</td>
<td>
支持
</td>
<td>
<?php if (function_exists('curl_init')): ?>
支持
<?php else: ?>
不支持
<?php endif ?>
</td>
<td>
<?php if (function_exists('curl_init')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<tr
class=
"<?php if(function_exists('fsockopen'))echo 'yes'; ?>"
>
<td>
fsockopen
</td>
<td>
支持
</td>
<td>
<?php if (function_exists('fsockopen')): ?>
支持
<?php else: ?>
不支持
<?php endif ?>
</td>
<td>
<?php if (function_exists('fsockopen')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<tr
class=
"<?php if(function_exists('mysqli_connect'))echo 'yes'; ?>"
>
<td>
mysqli_connect
</td>
<td>
支持
</td>
<td>
<?php if (function_exists('mysqli_connect')): ?>
支持
<?php else: ?>
不支持
<?php endif ?>
</td>
<td>
<?php if (function_exists('mysqli_connect')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<tr
class=
"<?php if(function_exists('file_get_contents'))echo 'yes'; ?>"
>
<td>
file_get_contents
</td>
<td>
支持
</td>
<td>
<?php if (function_exists('file_get_contents')): ?>
支持
<?php else: ?>
不支持
<?php endif ?>
</td>
<td>
<?php if (function_exists('file_get_contents')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<tr
class=
"<?php if(function_exists('mb_convert_encoding'))echo 'yes'; ?>"
>
<td>
mb_convert_encoding
</td>
<td>
支持
</td>
<td>
<?php if (function_exists('mb_convert_encoding')): ?>
支持
<?php else: ?>
不支持
<?php endif ?>
</td>
<td>
<?php if (function_exists('mb_convert_encoding')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<tr
class=
"<?php if(function_exists('json_encode'))echo 'yes'; ?>"
>
<td>
json_encode
</td>
<td>
支持
</td>
<td>
<?php if (function_exists('json_encode')): ?>
支持
<?php else: ?>
不支持
<?php endif ?>
</td>
<td>
<?php if (function_exists('json_encode')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
<tr
class=
"<?php if(function_exists('json_decode'))echo 'yes'; ?>"
>
<td>
json_decode
</td>
<td>
支持
</td>
<td>
<?php if (function_exists('json_decode')): ?>
支持
<?php else: ?>
不支持
<?php endif ?>
</td>
<td>
<?php if (function_exists('json_decode')): ?>
√
<?php else: ?>
×
<?php endif ?>
</td>
</tr>
</table>
<p
class=
"agree"
>
<a
class=
"btn btn-primary"
href=
"./index.php?c=agreement"
>
上一步
</a>
<a
class=
"btn btn-success"
href=
"javascript:;"
onclick=
"
t
estClick()"
>
下一步
</a>
<a
class=
"btn btn-success"
href=
"javascript:;"
onclick=
"
T
estClick()"
>
下一步
</a>
</p>
</div>
</div>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录