From 0723e4ad5f270ca300b96c748feff595a76ac7e3 Mon Sep 17 00:00:00 2001 From: icret Date: Fri, 21 Jan 2022 19:09:31 +0800 Subject: [PATCH] fix --- application/function.php | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/application/function.php b/application/function.php index 4ac4d92..9ddf40d 100755 --- a/application/function.php +++ b/application/function.php @@ -472,28 +472,24 @@ function getVersion() if ($config['checkEnv']) { require_once APP_ROOT . '/application/class.version.php'; + // 获取版本地址 + $url = "https://api.github.com/repositories/188228357/releases/latest"; + $getVersion = new getVerson($url); - if (file_get_contents('https://github.com/icret/EasyImages2.0')) { - // 判断服务器是否可以访问GitHub - // 获取版本地址 - $url = "https://api.github.com/repositories/188228357/releases/latest"; - $getVersion = new getVerson($url); + $now = date('dH'); // 当前日期时间 + $get_ver_day = array('1006', '2501'); // 检测日期的时间 - $now = date('dH'); // 当前日期时间 - $get_ver_day = array('1006', '2501'); // 检测日期的时间 - - foreach ($get_ver_day as $day) { - if (empty($getVersion->readJson())) { // 不存在就下载 - $getVersion->downJson(); - } else if ($day == $now) { // 是否在需要更新的日期 - $getVersion->downJson(); - /* + foreach ($get_ver_day as $day) { + if (empty($getVersion->readJson())) { // 不存在就下载 + $getVersion->downJson(); + } else if ($day == $now) { // 是否在需要更新的日期 + $getVersion->downJson(); + /* } elseif ($config['version'] == $getVersion->readJson()) { // 版本相同不提示 return null; */ - } else { // 返回版本 - return $getVersion->readJson(); - } + } else { // 返回版本 + return $getVersion->readJson(); } } }