已绑定手机签到天数: 273 天 [LV.8]以坛为家I
|
据统计90%查看本帖的人,都已经注册本站了哦
您需要 登录 才可以下载或查看,没有账号?立即注册
x
火山编程助手更新程序Setup开源
助手发布之后 就有会员反馈 想要这个开源 今天 整理发一份
开源部分分为2部分
1.服务器布局部分
首先,需要你建立一个文件夹(可以直接放在网站根目录) 然后把index.php传上去
代码解释
在index.php的目录 上传 version.txt(版本号) 和 log.txt(更新日志) 每次更新 自己手动更新一下内容 当然 你也可以自己搞成自动的
- // 读取版本号
- function getCurrentVersion() {
- return trim(file_get_contents("version.txt"));
- }
- // 函数1:返回当前版本号
- function getActionCurrentVersion() {
- return json_encode(['current_version' => getCurrentVersion()]);
- }
- // 函数2:返回当前版本的更新日志
- function getCurrentVersionChangelog() {
- $changelog = file_get_contents("log.txt");
- return json_encode(['changelog' => $changelog]);
- }
复制代码
需要什么后缀名 就在 ['dll', 'exe'] 修改 或者添加
- // 函数3:返回当前目录下所有的DLL和EXE的名字、大小和MD5
- function listDllAndExeFiles() {
- $directory = '.';
- $filesInfo = [];
- if ($handle = opendir($directory)) {
- while (false !== ($entry = readdir($handle))) {
- if (in_array(pathinfo($entry, PATHINFO_EXTENSION), ['dll', 'exe'], true)) {
- $fullPath = realpath($directory . DIRECTORY_SEPARATOR . $entry);
- // 确保文件名正确编码为UTF-8
- $fileName = mb_convert_encoding($entry, 'UTF-8', mb_detect_encoding($entry));
- $fileSize = filesize($fullPath);
- $fileMd5 = md5_file($fullPath);
- $filesInfo[] = [
- 'name' => $fileName,
- 'size' => $fileSize,
- 'md5' => $fileMd5
- ];
- }
- }
- closedir($handle);
- }
- return json_encode(['files' => $filesInfo]);
- }
复制代码
2.客户端部分 (本部分使用的是 本站模块 )
乐易模块火山版——您的火山视窗开发神器
https://www.leybc.cn/thread-10-1-1.html
(出处: 火山编程教程培训交流论坛-乐易网络)
需要手动修改 这几个 里面的 域名 替换成你自己的
然后就可以了
|
|