Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
纵之格
ShopXO
提交
fd9e53cc
ShopXO
项目概览
纵之格
/
ShopXO
通知
394
Star
16
Fork
11
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fd9e53cc
编写于
2月 18, 2021
作者:
D
Devil
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
插件、主题新增下载记录更新
上级
bd9119a5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
99 addition
and
13 deletion
+99
-13
application/service/AppMiniService.php
application/service/AppMiniService.php
+57
-13
application/service/PluginsAdminService.php
application/service/PluginsAdminService.php
+21
-0
application/service/ThemeService.php
application/service/ThemeService.php
+21
-0
未找到文件。
application/service/AppMiniService.php
浏览文件 @
fd9e53cc
...
...
@@ -349,6 +349,13 @@ class AppMiniService
}
}
// 历史信息更新
$ret
=
self
::
HistoryUpdateHandle
(
$new_dir
);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 生成压缩包
$zip
=
new
\
base\ZipFolder
();
if
(
!
$zip
->
zip
(
$new_dir
.
'.zip'
,
$new_dir
))
...
...
@@ -514,6 +521,13 @@ class AppMiniService
return
$ret
;
}
// 历史信息更新
$ret
=
self
::
HistoryUpdateHandle
(
$new_dir
);
if
(
isset
(
$ret
[
'code'
])
&&
$ret
[
'code'
]
!=
0
)
{
return
$ret
;
}
// 生成压缩包
$zip
=
new
\
base\ZipFolder
();
if
(
!
$zip
->
zip
(
$new_dir
.
'.zip'
,
$new_dir
))
...
...
@@ -527,6 +541,36 @@ class AppMiniService
return
DataReturn
(
'生成成功'
,
0
);
}
/**
* 历史信息更新
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2021-02-18
* @desc description
* @param [string] $new_dir [新源码包目录]
*/
public
static
function
HistoryUpdateHandle
(
$new_dir
)
{
// 配置信息
$file
=
$new_dir
.
DS
.
'app.json'
;
$config
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
empty
(
$config
[
'history'
]))
{
$config
[
'history'
]
=
[];
}
$config
[
'history'
][]
=
[
'host'
=>
__MY_HOST__
,
'url'
=>
__MY_URL__
,
'ip'
=>
__MY_ADDR__
,
'time'
=>
date
(
'Y-m-d H:i:s'
),
];
if
(
@
file_put_contents
(
$file
,
JsonFormat
(
$config
))
===
false
)
{
return
DataReturn
(
'新应用配置文件更新失败'
,
-
11
);
}
}
/**
* 扩展处理 - 微信
* @author Devil
...
...
@@ -534,7 +578,7 @@ class AppMiniService
* @version 1.0.0
* @date 2018-12-21
* @desc description
* @param [string] $new_dir [新
得
源码包目录]
* @param [string] $new_dir [新源码包目录]
*/
private
static
function
ExtendHandleWeixin
(
$new_dir
)
{
...
...
@@ -543,14 +587,14 @@ class AppMiniService
{
// app.json
$file
=
$new_dir
.
DS
.
'app.json'
;
$
data
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
is_array
(
$
data
)
&&
isset
(
$data
[
'plugins'
]))
$
config
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
is_array
(
$
config
)
&&
isset
(
$config
[
'plugins'
]))
{
$
data
[
'plugins'
][
'goodsSharePlugin'
]
=
[
$
config
[
'plugins'
][
'goodsSharePlugin'
]
=
[
'version'
=>
MyC
(
'common_app_is_good_thing_ver'
,
'4.0.1'
,
true
),
'provider'
=>
'wx56c8f077de74b07c'
,
];
if
(
file_put_contents
(
$file
,
JsonFormat
(
$
data
))
===
false
)
if
(
file_put_contents
(
$file
,
JsonFormat
(
$
config
))
===
false
)
{
return
DataReturn
(
'好物推荐主配置失败'
,
-
50
);
}
...
...
@@ -558,11 +602,11 @@ class AppMiniService
// goods-detail.json
$file
=
$new_dir
.
DS
.
'pages'
.
DS
.
'goods-detail'
.
DS
.
'goods-detail.json'
;
$
data
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
is_array
(
$
data
)
&&
isset
(
$data
[
'usingComponents'
]))
$
config
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
is_array
(
$
config
)
&&
isset
(
$config
[
'usingComponents'
]))
{
$
data
[
'usingComponents'
][
'share-button'
]
=
'plugin://goodsSharePlugin/share-button'
;
if
(
file_put_contents
(
$file
,
JsonFormat
(
$
data
))
===
false
)
$
config
[
'usingComponents'
][
'share-button'
]
=
'plugin://goodsSharePlugin/share-button'
;
if
(
file_put_contents
(
$file
,
JsonFormat
(
$
config
))
===
false
)
{
return
DataReturn
(
'好物推荐商品配置失败'
,
-
51
);
}
...
...
@@ -574,14 +618,14 @@ class AppMiniService
{
// app.json
$file
=
$new_dir
.
DS
.
'app.json'
;
$
data
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
is_array
(
$
data
)
&&
isset
(
$data
[
'plugins'
]))
$
config
=
json_decode
(
file_get_contents
(
$file
),
true
);
if
(
is_array
(
$
config
)
&&
isset
(
$config
[
'plugins'
]))
{
$
data
[
'plugins'
][
'live-player-plugin'
]
=
[
$
config
[
'plugins'
][
'live-player-plugin'
]
=
[
'version'
=>
MyC
(
'common_app_weixin_liveplayer_ver'
,
'1.2.7'
,
true
),
'provider'
=>
'wx2b03c6e691cd7370'
,
];
if
(
file_put_contents
(
$file
,
JsonFormat
(
$
data
))
===
false
)
if
(
file_put_contents
(
$file
,
JsonFormat
(
$
config
))
===
false
)
{
return
DataReturn
(
'直播配置失败'
,
-
50
);
}
...
...
application/service/PluginsAdminService.php
浏览文件 @
fd9e53cc
...
...
@@ -1292,6 +1292,27 @@ php;
}
}
// 配置文件历史信息更新
$new_config_file
=
$new_dir
.
DS
.
'_controller_'
.
DS
.
$plugins
.
DS
.
'config.json'
;
if
(
!
file_exists
(
$new_config_file
))
{
return
DataReturn
(
'新配置文件有误'
,
-
10
);
}
if
(
empty
(
$config
[
'history'
]))
{
$config
[
'history'
]
=
[];
}
$config
[
'history'
][]
=
[
'host'
=>
__MY_HOST__
,
'url'
=>
__MY_URL__
,
'ip'
=>
__MY_ADDR__
,
'time'
=>
date
(
'Y-m-d H:i:s'
),
];
if
(
@
file_put_contents
(
$new_config_file
,
JsonFormat
(
$config
))
===
false
)
{
return
DataReturn
(
'新应用配置文件更新失败'
,
-
11
);
}
// 生成压缩包
$zip
=
new
\
base\ZipFolder
();
if
(
!
$zip
->
zip
(
$new_dir
.
'.zip'
,
$new_dir
))
...
...
application/service/ThemeService.php
浏览文件 @
fd9e53cc
...
...
@@ -332,6 +332,27 @@ class ThemeService
}
}
// 配置文件历史信息更新
$new_config_file
=
$new_dir
.
DS
.
'_html_'
.
DS
.
'config.json'
;
if
(
!
file_exists
(
$new_config_file
))
{
return
DataReturn
(
'新配置文件有误'
,
-
10
);
}
if
(
empty
(
$config
[
'history'
]))
{
$config
[
'history'
]
=
[];
}
$config
[
'history'
][]
=
[
'host'
=>
__MY_HOST__
,
'url'
=>
__MY_URL__
,
'ip'
=>
__MY_ADDR__
,
'time'
=>
date
(
'Y-m-d H:i:s'
),
];
if
(
@
file_put_contents
(
$new_config_file
,
JsonFormat
(
$config
))
===
false
)
{
return
DataReturn
(
'新应用配置文件更新失败'
,
-
11
);
}
// 生成压缩包
$zip
=
new
\
base\ZipFolder
();
if
(
!
$zip
->
zip
(
$new_dir
.
'.zip'
,
$new_dir
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录