app/admin/lib/Upgrade.php

(开头部分) 11KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php
/**
 * 人人站CMS
 * ============================================================================
 * 版权所有 2015-2030 山东康程信息科技有限公司,并保留所有权利。
 * 网站地址: http://www.rrzcms.com
 * ----------------------------------------------------------------------------
 * 如果商业用途务必到官方购买正版授权, 以免引起不必要的法律纠纷.
 * ============================================================================
 */

namespace app\admin\lib;

use think\facade\Db;

class Upgrade
{
    public $dataPath;
    public $rootPath;
    public $curentVersion;
    public $upgradeUrl;

    function __construct() {
        $this->rootPath = app()->getRootPath();
        $this->dataPath = $this->rootPath . 'runtime' . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR;
        $config = include $this->rootPath . '/app/admin/config/config.php';
        $this->curentVersion = $config['sys_version'];
        $url = base64_decode('aHR0cDovL3d3dy5ycnpjbXMuY29tL0FwaS9ScnpjbXMvY2hlY2tWZXJzaW9u');
        $md5 = sysConfig('system.upgrade_md5') ?: '';
        $this->upgradeUrl = $url . '?domain=' . request()->host(true) . '&v=' . $this->curentVersion . '&md5=' . $md5;
    }

    //检查是否有更新包
    function checkVersion(&$msg = '') {
        $url = $this->upgradeUrl;
        $res = get_curl($url, 'json');
        if (empty($res) || !$res['data']) {
            $msg = '已是最新版';
            return false;
        }
        $upgrade = end($res['data']);//最新版本
        $tips = [];
        foreach ($res['data'] as $item) {
            $tips[] = '<p class="f15 cl-000">版本 ' . $item['title'] . '&nbsp;<span class="f12 cl-999 pr" style="top:-1px;">(' . $item['uptime'] . ')</span>' . '</p>' . trim(htmlspecialchars_decode($item['content']));
        }
        $upgrade['upTipsMsg'] = '<font color="red">小提示:系统更新不会涉及前台模板及网站数据等。</font><br>更新日志:<br>' . implode('', array_reverse($tips));
        return $upgrade;
    }

    //一键更新
    function OneKeyUpgrade(&$msg = '') {
        ignore_user_abort(true);//忽略断开
        error_reporting(0);//关闭所有错误报告
        if (!extension_loaded('zip')) {
            $msg = '请联系空间商,开启 php.ini 中的php-zip扩展';
            return false;
        }
        $res = get_curl($this->upgradeUrl, 'json');
        if (!$res) {
            $msg = '无法连接远程升级服务器!';
后面还有 222 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。