Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
starsw001
ShopXO
提交
440bf075
ShopXO
项目概览
starsw001
/
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,发现更多精彩内容 >>
提交
440bf075
编写于
9月 25, 2020
作者:
D
devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
配置细节优化
上级
9fe07ee8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
149 addition
and
75 deletion
+149
-75
application/admin/view/default/site/cache.html
application/admin/view/default/site/cache.html
+5
-0
application/install/controller/Index.php
application/install/controller/Index.php
+11
-3
application/service/BaseConfigHandleService.php
application/service/BaseConfigHandleService.php
+35
-16
config/shopxo.sql
config/shopxo.sql
+98
-56
未找到文件。
application/admin/view/default/site/cache.html
浏览文件 @
440bf075
...
...
@@ -61,6 +61,11 @@
<button
class=
"am-btn am-btn-default"
type=
"button"
>
秒
</button>
</span>
</div>
<div
class=
"am-alert am-alert-warning"
data-am-alert
>
<button
type=
"button"
class=
"am-close"
>
×
</button>
<p>
1. session下过期时间默认为3600秒
</p>
<p>
2. 数据缓存下过期时间默认0(表示默认永久缓存)
</p>
</div>
</div>
<div
class=
"am-form-group"
>
<label>
{{$data.common_cache_redis_prefix.name}}
<span
class=
"am-form-group-label-tips"
>
{{$data.common_cache_redis_prefix.describe}}
</span></label>
...
...
application/install/controller/Index.php
浏览文件 @
440bf075
...
...
@@ -11,6 +11,7 @@
namespace
app\install\controller
;
use
think\Db
;
use
app\service\BaseConfigHandleService
;
/**
* 安装程序
...
...
@@ -160,6 +161,13 @@ class Index extends Common
die
(
'非法访问'
);
}
// 校验cache和session配置生成
$ret
=
BaseConfigHandleService
::
Run
();
if
(
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 参数
$params
=
input
(
'post.'
);
$ret
=
$this
->
ParamsCheck
(
$params
);
...
...
@@ -217,8 +225,8 @@ class Index extends Common
return
$ret
;
}
// 生成配置文件
return
$this
->
CreateConfig
(
$params
);
// 生成
数据库
配置文件
return
$this
->
Create
Db
Config
(
$params
);
}
/**
...
...
@@ -230,7 +238,7 @@ class Index extends Common
* @desc description
* @param [array] $params [输入参数]
*/
private
function
CreateConfig
(
$params
=
[])
private
function
Create
Db
Config
(
$params
=
[])
{
// 配置文件信息处理
$db_str
=
<<<php
...
...
application/service/BaseConfigHandleService.php
浏览文件 @
440bf075
...
...
@@ -76,22 +76,26 @@ class BaseConfigHandleService
}
else
{
$config
=
[
// session_id
'id'
=>
''
,
'id'
=>
''
,
// SESSION_ID的提交变量,解决flash上传跨域
'var_session_id'
=>
''
,
'var_session_id'
=>
''
,
// SESSION 前缀
'prefix'
=>
'shopxo'
,
'prefix'
=>
'shopxo'
,
// 驱动方式 支持redis memcache memcached
'type'
=>
''
,
'type'
=>
''
,
// 过期时间(默认3600秒)
'expire'
=>
3600
,
// 是否自动开启 SESSION
'auto_start'
=>
true
,
'auto_start'
=>
true
,
];
}
// 配置文件
$config_file
=
ROOT
.
'config'
.
DS
.
'session.php'
;
$file_dir
=
ROOT
.
'config'
.
DS
;
$file_name
=
'session.php'
;
// 保存文件
return
self
::
ConfigFileSave
(
$
config_fil
e
,
$config
,
'Session配置'
);
return
self
::
ConfigFileSave
(
$
file_dir
,
$file_nam
e
,
$config
,
'Session配置'
);
}
/**
...
...
@@ -137,10 +141,11 @@ class BaseConfigHandleService
}
// 配置文件
$config_file
=
ROOT
.
'config'
.
DS
.
'cache.php'
;
$file_dir
=
ROOT
.
'config'
.
DS
;
$file_name
=
'cache.php'
;
// 保存文件
return
self
::
ConfigFileSave
(
$
config_fil
e
,
$config
,
'缓存配置'
);
return
self
::
ConfigFileSave
(
$
file_dir
,
$file_nam
e
,
$config
,
'缓存配置'
);
}
/**
...
...
@@ -150,16 +155,30 @@ class BaseConfigHandleService
* @version 1.0.0
* @date 2020-09-25
* @desc description
* @param [string] $config_file [文件路径]
* @param [array] $config [配置信息]
* @param [string] $name [描述名称]
* @param [string] $file_dir [文件路径]
* @param [string] $file_name [文件名称]
* @param [array] $config [配置信息]
* @param [string] $name [描述名称]
*/
private
static
function
ConfigFileSave
(
$
config_fil
e
,
$config
,
$name
)
private
static
function
ConfigFileSave
(
$
file_dir
,
$file_nam
e
,
$config
,
$name
)
{
// 是否有写权限
if
(
file_exists
(
$config_file
)
&&
!
is_writable
(
$config_file
))
$config_file
=
$file_dir
.
$file_name
;
if
(
file_exists
(
$config_file
))
{
return
DataReturn
(
'缓存配置文件没有操作权限'
.
'['
.
$config_file
.
']'
,
-
3
);
if
(
!
is_writable
(
$config_file
))
{
return
DataReturn
(
$name
.
'文件没有操作权限'
.
'['
.
$config_file
.
']'
,
-
10
);
}
}
else
{
if
(
!
is_dir
(
$file_dir
))
{
return
DataReturn
(
$name
.
'路径不存在'
.
'['
.
$file_dir
.
']'
,
-
11
);
}
if
(
!
is_writable
(
$file_dir
))
{
return
DataReturn
(
$name
.
'路径没有操作权限'
.
'['
.
$file_dir
.
']'
,
-
12
);
}
}
// 生成配置文件
...
...
@@ -177,7 +196,7 @@ class BaseConfigHandleService
//
{
$name
}
\n
return "
.
var_export
(
$config
,
true
)
.
";
\n
?>"
);
if
(
$ret
===
false
)
{
return
DataReturn
(
$name
.
'处理失败['
.
$config_file
.
']'
,
-
10
);
return
DataReturn
(
$name
.
'处理失败['
.
$config_file
.
']'
,
-
10
0
);
}
return
DataReturn
(
'处理成功'
,
0
);
}
...
...
config/shopxo.sql
浏览文件 @
440bf075
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录