当前位置:首页>python>分享一个openssh自动升级的python工具源代码

分享一个openssh自动升级的python工具源代码

  • 2026-06-29 08:36:03
分享一个openssh自动升级的python工具源代码

正 文 开 始

相逢即是缘,关注⭐星标不错过~,每天分享实操教程和技巧。


将需要的包上传即可。备注:此工具暂时只支持centos。代码如下:
#!/usr/bin/env python3# -*- coding: utf-8 -*-"""OpenSSH 离线升级工具支持交互式输入路径或命令行参数指定兼容 Python 3.6+"""import osimport sysimport subprocessimport argparseimport tarfileimport shutilfrom pathlib import Path# 颜色输出class Colors:    RED = '\033[31m'    GREEN = '\033[32m'    YELLOW = '\033[33m'    BLUE = '\033[34m'    NC = '\033[0m'def print_colored(text, color=Colors.NC):    print(f"{color}{text}{Colors.NC}")def run_cmd(cmd, check=True, shell=True, capture_output=False):    try:        if capture_output:            result = subprocess.run(cmd, shell=shell, check=check,                                    stdout=subprocess.PIPE, stderr=subprocess.PIPE,                                    universal_newlines=True)            return result.stdout.strip()        else:            subprocess.run(cmd, shell=shell, check=check)    except subprocess.CalledProcessError as e:        print_colored(f"命令执行失败: {cmd}", Colors.RED)        if capture_output:            print_colored(f"错误信息: {e.stderr}", Colors.RED)        else:            print_colored(f"错误信息: {str(e)}", Colors.RED)        sys.exit(1)def get_ssh_version():    try:        version = run_cmd("ssh -V 2>&1", capture_output=True)        return version    except:        return "未安装或无法获取版本"def check_root():    if os.geteuid() != 0:        print_colored("错误:必须使用 root 用户执行此脚本!", Colors.RED)        sys.exit(1)def check_environment():    print_colored("\n[1/8] 正在检查系统环境...", Colors.BLUE)    redhat_release = Path("/etc/redhat-release")    if redhat_release.exists():        content = redhat_release.read_text()        if "CentOS Linux 7.9" not in content:            print_colored("警告:建议使用 CentOS 7.9,当前版本可能不完全兼容", Colors.YELLOW)    else:        print_colored("警告:未检测到 /etc/redhat-release,可能不是 RHEL/CentOS 系统", Colors.YELLOW)    arch = run_cmd("uname -m", capture_output=True)    if arch != "x86_64":        print_colored("错误:仅支持 64 位系统!", Colors.RED)        sys.exit(1)    print_colored("环境检查通过", Colors.GREEN)def smart_extract(tar_path, extract_to="/opt"):    tar_path = Path(tar_path)    if not tar_path.exists():        print_colored(f"错误:文件不存在 - {tar_path}", Colors.RED)        sys.exit(1)    if tar_path.stat().st_size == 0:        print_colored(f"错误:文件 {tar_path.name} 大小为0,可能未完整下载", Colors.RED)        sys.exit(1)    print_colored(f"解压 {tar_path.name} 到 {extract_to} ...", Colors.NC)    try:        with tarfile.open(tar_path, 'r:*') as tar:            tar.extractall(path=extract_to)            members = tar.getmembers()            if members:                top_dir = members[0].name.split('/')[0]                return top_dir            else:                return tar_path.name.replace('.tar.gz', '').replace('.tgz', '').replace('.tar', '')    except (tarfile.ReadError, EOFError) as e:        print_colored(f"Python tarfile 解压失败:{e}", Colors.RED)        print_colored("尝试使用系统 tar 命令解压...", Colors.YELLOW)        try:            subprocess.run(f"tar -xf {tar_path} -C {extract_to}", shell=True, check=True)            for item in Path(extract_to).iterdir():                if item.is_dir() and not item.name.startswith('.'):                    return item.name            return tar_path.name.replace('.tar.gz', '').replace('.tgz', '').replace('.tar', '')        except subprocess.CalledProcessError:            print_colored("系统 tar 命令也解压失败,文件可能严重损坏。", Colors.RED)            sys.exit(1)def install_dependencies(dep_file):    print_colored("\n[2/8] 安装基础依赖...", Colors.BLUE)    dep_path = Path(dep_file)    if not dep_path.exists():        print_colored(f"错误:依赖文件不存在: {dep_file}", Colors.RED)        skip = input("是否跳过依赖安装并继续?(y/n) [n]: ").strip().lower()        if skip in ('y', 'yes'):            print_colored("跳过依赖安装,请注意系统必须已具备编译环境!", Colors.YELLOW)            return        else:            sys.exit(1)    temp_dir = Path("/opt/deps_temp")    temp_dir.mkdir(exist_ok=True)    try:        top_dir_name = smart_extract(dep_file, extract_to=str(temp_dir))    except SystemExit:        skip = input("依赖包解压失败,是否跳过依赖安装并继续?(y/n) [n]: ").strip().lower()        if skip in ('y', 'yes'):            print_colored("跳过依赖安装,请注意系统必须已具备编译环境!", Colors.YELLOW)            shutil.rmtree(temp_dir, ignore_errors=True)            return        else:            shutil.rmtree(temp_dir, ignore_errors=True)            sys.exit(1)    extract_dir = temp_dir / top_dir_name    if not extract_dir.exists():        rpm_files = list(temp_dir.glob("**/*.rpm"))        if not rpm_files:            print_colored("错误:解压后未找到 RPM 包", Colors.RED)            shutil.rmtree(temp_dir)            sys.exit(1)        print_colored(f"找到 {len(rpm_files)} 个 RPM 包(分散存放),开始安装...", Colors.NC)        rpm_list = " ".join(f"'{f}'" for f in rpm_files)        run_cmd(f"rpm -ivh {rpm_list} --nodeps --force")    else:        os.chdir(extract_dir)        rpm_files = list(Path(".").glob("*.rpm"))        if not rpm_files:            print_colored("错误:yilai 目录下未找到任何 RPM 包", Colors.RED)            os.chdir("/opt")            shutil.rmtree(temp_dir)            sys.exit(1)        print_colored(f"在目录 '{top_dir_name}' 中找到 {len(rpm_files)} 个 RPM 包,开始安装...", Colors.NC)        run_cmd("rpm -ivh *.rpm --nodeps --force")        os.chdir("/opt")    shutil.rmtree(temp_dir)    print_colored("依赖包安装完成", Colors.GREEN)def build_zlib(zlib_file):    print_colored("\n[3/8] 编译安装 zlib...", Colors.BLUE)    zlib_path = Path(zlib_file)    if not zlib_path.exists():        print_colored(f"错误:zlib 源码包不存在: {zlib_file}", Colors.RED)        sys.exit(1)    dir_name = smart_extract(zlib_file)    extract_dir = Path("/opt") / dir_name    os.chdir(extract_dir)    run_cmd("./configure --prefix=/usr/local/zlib")    run_cmd("make")    run_cmd("make install")    with open("/etc/ld.so.conf", "a") as f:        f.write("/usr/local/zlib/lib\n")    run_cmd("ldconfig -v")    print_colored("zlib 安装完成", Colors.GREEN)def build_openssl(openssl_file):    print_colored("\n[4/8] 编译安装 OpenSSL...", Colors.BLUE)    ssl_path = Path(openssl_file)    if not ssl_path.exists():        print_colored(f"错误:OpenSSL 源码包不存在: {openssl_file}", Colors.RED)        sys.exit(1)    if "3." in ssl_path.name:        print_colored("警告:您正在使用 OpenSSL 3.x 版本,在 CentOS 7 下可能与 OpenSSH 存在链接问题。", Colors.YELLOW)        print_colored("强烈建议使用 OpenSSL 1.1.1 系列(如 openssl-1.1.1o.tar.gz)。", Colors.YELLOW)        cont = input("是否继续尝试?(y/n) [n]: ").strip().lower()        if cont not in ('y', 'yes'):            print_colored("用户取消操作,退出脚本。", Colors.YELLOW)            sys.exit(0)    dir_name = smart_extract(openssl_file)    extract_dir = Path("/opt") / dir_name    os.chdir(extract_dir)    run_cmd("make clean 2>/dev/null", check=False)    os.environ['CFLAGS'] = '-std=gnu99 -O2 -fPIC'    print_colored("已设置 CFLAGS=-std=gnu99 -O2 -fPIC", Colors.NC)    run_cmd("./config --prefix=/usr/local/ssl -d shared")    run_cmd("make")    run_cmd("make install")    with open("/etc/ld.so.conf", "a") as f:        f.write("/usr/local/ssl/lib\n")    run_cmd("ldconfig -v")    if not verify_openssl_install():        print_colored("OpenSSL 安装验证失败,请检查编译日志。", Colors.RED)        sys.exit(1)    print_colored("OpenSSL 安装完成并通过验证", Colors.GREEN)def verify_openssl_install():    libdir = Path("/usr/local/ssl/lib")    incdir = Path("/usr/local/ssl/include/openssl")    if not incdir.exists():        print_colored("错误:OpenSSL 头文件目录缺失", Colors.RED)        return False    libcrypto_so = libdir / "libcrypto.so"    libssl_so = libdir / "libssl.so"    libcrypto_a = libdir / "libcrypto.a"    libssl_a = libdir / "libssl.a"    if libcrypto_so.exists() and libssl_so.exists():        print_colored("OpenSSL 动态库 (.so) 存在", Colors.NC)        return True    elif libcrypto_a.exists() and libssl_a.exists():        print_colored("OpenSSL 静态库 (.a) 存在,将使用静态链接", Colors.YELLOW)        return True    else:        print_colored("错误:未找到 OpenSSL 库文件", Colors.RED)        return Falsedef get_openssl_version():    openssl_bin = Path("/usr/local/ssl/bin/openssl")    if openssl_bin.exists():        try:            version_str = subprocess.check_output([str(openssl_bin), "version"],                                                  universal_newlines=True).strip()            parts = version_str.split()            if len(parts) >= 2:                return parts[1]        except:            pass    return "unknown"def install_openssh(openssh_file):    print_colored("\n[5/8] 升级 OpenSSH...", Colors.BLUE)    ssh_path = Path(openssh_file)    if not ssh_path.exists():        print_colored(f"错误:OpenSSH 源码包不存在: {openssh_file}", Colors.RED)        sys.exit(1)    print_colored("卸载旧版本 OpenSSH...", Colors.NC)    run_cmd("rpm -e --nodeps openssh-server openssh openssh-clients 2>/dev/null", check=False)    dir_name = smart_extract(openssh_file)    extract_dir = Path("/opt") / dir_name    os.chdir(extract_dir)    sys_ssl_inc = Path("/usr/include/openssl")    sys_ssl_inc_backup = Path("/usr/include/openssl.bak")    if sys_ssl_inc.exists():        print_colored("备份系统 OpenSSL 头文件目录...", Colors.NC)        shutil.move(str(sys_ssl_inc), str(sys_ssl_inc_backup))    try:        run_cmd("ldconfig")        libdir = Path("/usr/local/ssl/lib")        use_static = False        if not (libdir / "libcrypto.so").exists():            use_static = True            print_colored("未找到动态库,将使用静态链接", Colors.YELLOW)        extra_cflags = "-I/usr/local/ssl/include"        ssl_version = get_openssl_version()        if ssl_version.startswith("3."):            extra_cflags += " -DOPENSSL_API_COMPAT=0x10100000L"            print_colored("已为 OpenSSL 3.x 添加兼容性宏", Colors.NC)        os.environ['CFLAGS'] = extra_cflags        os.environ['CPPFLAGS'] = extra_cflags        if use_static:            os.environ['LDFLAGS'] = f"-L{libdir}"            os.environ['LIBS'] = f"{libdir}/libcrypto.a {libdir}/libssl.a -ldl -lpthread"        else:            os.environ['LDFLAGS'] = f"-L{libdir} -Wl,-rpath,{libdir}"            os.environ['LIBS'] = "-lcrypto -lssl"            os.environ['LD_LIBRARY_PATH'] = str(libdir)        run_cmd("./configure --prefix=/usr/local/openssh "                "--with-zlib=/usr/local/zlib "                "--with-ssl-dir=/usr/local/ssl "                "--without-openssl-header-check")        run_cmd("make")        run_cmd("make install")    finally:        if sys_ssl_inc_backup.exists():            shutil.move(str(sys_ssl_inc_backup), str(sys_ssl_inc))    print_colored("配置 SSH 服务...", Colors.NC)    sshd_config = Path("/usr/local/openssh/etc/sshd_config")    with open(sshd_config, "a") as f:        f.write("\nPermitRootLogin yes\n")        f.write("PubkeyAuthentication yes\n")        f.write("PasswordAuthentication yes\n")    shutil.copy(sshd_config, "/etc/ssh/sshd_config")    with open("/etc/ssh/sshd_config", "a") as f:        f.write("HostKeyAlgorithms ssh-rsa,ssh-dss\n")    # 复制服务端二进制    sshd_bin = Path("/usr/sbin/sshd")    if sshd_bin.exists():        sshd_bin.rename("/usr/sbin/sshd.bak")    shutil.copy("/usr/local/openssh/sbin/sshd", "/usr/sbin/sshd")    os.chmod("/usr/sbin/sshd", 0o755)    # 复制客户端工具(包括 scp, sftp, ssh-add, ssh-agent, ssh-keyscan 等)    print_colored("安装客户端工具 (scp, sftp, ssh-keygen, ssh-add ...)", Colors.NC)    src_bin_dir = Path("/usr/local/openssh/bin")    dst_bin_dir = Path("/usr/bin")    tools_to_copy = [        "scp", "sftp", "ssh", "ssh-add", "ssh-agent", "ssh-keygen",        "ssh-keyscan", "sftp-server", "ssh-keysign"    ]    for tool in tools_to_copy:        src = src_bin_dir / tool        if src.exists():            dst = dst_bin_dir / tool            if dst.exists():                dst.rename(dst_bin_dir / f"{tool}.bak")            shutil.copy(src, dst)            os.chmod(dst, 0o755)            print_colored(f"  已安装: {tool}", Colors.NC)        else:            print_colored(f"  警告: 未找到 {tool},跳过", Colors.YELLOW)    # 启动脚本    init_script = Path("/opt") / dir_name / "contrib/redhat/sshd.init"    if init_script.exists():        shutil.copy(init_script, "/etc/init.d/sshd")        os.chmod("/etc/init.d/sshd", 0o755)        run_cmd("chkconfig --add sshd")        run_cmd("chkconfig sshd on")    print_colored("OpenSSH 安装完成,所有客户端工具已就绪", Colors.GREEN)def final_check(old_version=""):    print_colored("\n[6/8] 执行最终检查...", Colors.BLUE)    run_cmd("systemctl daemon-reload")    run_cmd("systemctl restart sshd")    new_version = get_ssh_version()    if "OpenSSH_" in new_version:        print_colored("=" * 50, Colors.GREEN)        print_colored("升级成功!", Colors.GREEN)        if old_version:            print_colored(f"升级前版本:{old_version}", Colors.YELLOW)        print_colored(f"升级后版本:{new_version}", Colors.GREEN)        print_colored("=" * 50, Colors.GREEN)        print_colored("警告:请通过新 SSH 端口连接确认无误后,再关闭 Telnet 服务!", Colors.YELLOW)        # 验证 scp 是否可用        if Path("/usr/bin/scp").exists():            print_colored("scp 命令已安装,可以使用。", Colors.GREEN)    else:        print_colored(f"错误:升级失败,当前版本: {new_version}", Colors.RED)        sys.exit(1)def prompt_file(prompt_text, default_path=None, allow_skip=False):    while True:        if default_path:            user_input = input(f"{prompt_text} [默认: {default_path}]: ").strip()            if not user_input:                user_input = default_path        else:            user_input = input(f"{prompt_text}: ").strip()        if allow_skip and user_input.lower() in ('skip', 's', ''):            return None        if not user_input:            print_colored("路径不能为空,请重新输入。", Colors.YELLOW)            continue        if Path(user_input).exists():            return user_input        else:            print_colored(f"文件不存在: {user_input}", Colors.RED)            choice = input("是否重新输入?(y/n) [y]: ").strip().lower()            if choice in ('n', 'no'):                print_colored("用户取消操作,退出脚本。", Colors.YELLOW)                sys.exit(0)def main():    parser = argparse.ArgumentParser(description="OpenSSH 离线升级工具")    parser.add_argument("--dep", help="依赖包完整路径")    parser.add_argument("--zlib", help="zlib 源码包完整路径")    parser.add_argument("--openssl", help="OpenSSL 源码包完整路径")    parser.add_argument("--openssh", help="OpenSSH 源码包完整路径")    parser.add_argument("--skip-env-check", action="store_true", help="跳过环境检查")    args = parser.parse_args()    print_colored("========================================", Colors.BLUE)    print_colored("      OpenSSH 离线升级工具 (Python版)    ", Colors.GREEN)    print_colored("========================================", Colors.BLUE)    check_root()    old_version = get_ssh_version()    print_colored(f"\n当前系统 SSH 版本:{old_version}", Colors.YELLOW)    if not args.skip_env_check:        check_environment()    else:        print_colored("警告:已跳过环境检查", Colors.YELLOW)    print_colored("\n>>> 请准备以下四个文件(必须全部存在):", Colors.YELLOW)    print_colored("    1. 依赖包 (yilai.tar.gz)  - 包含编译所需的 RPM 包", Colors.NC)    print_colored("    2. zlib 源码包 (如 zlib-1.3.1.tar.gz)", Colors.NC)    print_colored("    3. OpenSSL 源码包 (强烈建议使用 openssl-1.1.1o.tar.gz)", Colors.NC)    print_colored("    4. OpenSSH 源码包 (如 openssh-9.9p1.tar.gz)", Colors.NC)    dep_file = args.dep or prompt_file("请输入依赖包路径", default_path="/opt/yilai.tar.gz")    zlib_file = args.zlib or prompt_file("请输入 zlib 源码包路径", default_path="/opt/zlib-1.3.1.tar.gz")    openssl_file = args.openssl or prompt_file("请输入 OpenSSL 源码包路径", default_path="/opt/openssl-1.1.1o.tar.gz")    openssh_file = args.openssh or prompt_file("请输入 OpenSSH 源码包路径", default_path="/opt/openssh-9.9p1.tar.gz")    print_colored("\n========================================", Colors.BLUE)    print_colored("即将使用以下文件进行升级:", Colors.GREEN)    print_colored(f"依赖包路径: {dep_file}", Colors.NC)    print_colored(f"zlib 包路径: {zlib_file}", Colors.NC)    print_colored(f"OpenSSL 包路径: {openssl_file}", Colors.NC)    print_colored(f"OpenSSH 包路径: {openssh_file}", Colors.NC)    print_colored("========================================", Colors.BLUE)    confirm = input("确认开始升级?(y/n) [y]: ").strip().lower()    if confirm not in ('', 'y', 'yes'):        print_colored("用户取消操作,退出脚本。", Colors.YELLOW)        sys.exit(0)    install_dependencies(dep_file)    build_zlib(zlib_file)    build_openssl(openssl_file)    install_openssh(openssh_file)    final_check(old_version)if __name__ == "__main__":    main()
👍 有用就点赞+收藏+转发 三连支持💬 有问题?评论区见,每条必回
⚠️ 免责声明:本文提供的配置建议仅供参考,生产环境部署前请在测试环境充分验证。因配置不当导致的业务中断,责任自负。
【如有疏漏,敬请指正!】

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 08:11:50 HTTP/2.0 GET : https://f.mffb.com.cn/a/488754.html
  2. 运行时间 : 0.163622s [ 吞吐率:6.11req/s ] 内存消耗:4,538.91kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=09de3c9b81a6df7057799f8bdb8e107e
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000539s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000787s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.006765s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.025174s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000890s ]
  6. SELECT * FROM `set` [ RunTime:0.000613s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000636s ]
  8. SELECT * FROM `article` WHERE `id` = 488754 LIMIT 1 [ RunTime:0.041096s ]
  9. UPDATE `article` SET `lasttime` = 1783123910 WHERE `id` = 488754 [ RunTime:0.010742s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.002908s ]
  11. SELECT * FROM `article` WHERE `id` < 488754 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000576s ]
  12. SELECT * FROM `article` WHERE `id` > 488754 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000380s ]
  13. SELECT * FROM `article` WHERE `id` < 488754 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.003508s ]
  14. SELECT * FROM `article` WHERE `id` < 488754 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000775s ]
  15. SELECT * FROM `article` WHERE `id` < 488754 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000660s ]
0.165139s