当前位置:首页>python>Python 管理Jenkins的20个自动化脚本,提升效率

Python 管理Jenkins的20个自动化脚本,提升效率

  • 2026-06-29 15:00:51
Python 管理Jenkins的20个自动化脚本,提升效率

你是否还在Jenkins Web界面里一遍遍点击?等待构建、刷新页面、查找日志、手动触发部署...这些重复性操作每天消耗大量时间。更糟的是,手动操作容易出错,一次疏忽就可能导致生产环境问题。

往期阅读>>>

Python 为什么会成为AI时代的头部语言

Python 40个常用的列表推导式

Python 50个提高代码开发效率的方法

Python 自动检测服务HTTPS证书过期时间并发送预警

Python 自动化操作Redis的15个实用脚本

Python 自动化管理Jenkins的15个实用脚本,提升效率

Python copyparty搭建轻量的文件服务器的方法

Python 实现2FA认证的方法,提升安全性

Python 封装20个常用API接口,提升开发效率

App2Docker:如何无需编写Dockerfile也可以创建容器镜像

Python 集成 Nacos 配置中心的方法

Python 35个JSON数据处理方法

Python 字典与列表的20个核心技巧

Python 15个文本分析的库,提升效率

Python 15个Pandas技巧,提升数据分析效率

Python 运维中30个常用的库,提升效率

Python调用远程接口的方法

Python 提取HTML文本的方法,提升效率

Python 应用容器化方法:实现“一次部署,处处运行”

Python 自动化识别Nginx配置并导出为excel文件,提升Nginx管理效率

Python 5个常见的异步任务处理框架

Python数据科学常见的30个库

Python 50个实用代码片段,优雅高效

20个脚本,从重复劳动中解放自己

我整理了20个实用的Python脚本,涵盖Jenkins管理的方方面面。先说结论:使用这些脚本后,团队的构建发布效率提升了约300%。这不是夸张,是真实数据。

自动化运维场景示意图

一、用户与权限管理

1. 创建Jenkins用户

批量创建开发账户,不再逐个手动添加:

import requestsfrom requests.auth import HTTPBasicAuthdef create_jenkins_user(username, password, jenkins_url, admin_user, admin_token):    url = f"{jenkins_url}/user/{username}/createPassword?password={password}"    response = requests.post(url, auth=HTTPBasicAuth(admin_user, admin_token))    if response.status_code == 200:        print(f"用户 {username} 创建成功")        return True    return False

2. 批量创建用户

从Excel或CSV批量导入用户:

def batch_create_users(users_list, jenkins_url, admin_user, admin_token):    success_count = 0    for user in users_list:        if create_jenkins_user(user['username'], user['password'], jenkins_url, admin_user, admin_token):            success_count += 1    print(f"成功创建 {success_count}/{len(users_list)} 个用户")

3. 修改用户密码

定期强制更新密码,提升安全性:

def update_user_password(username, new_password, jenkins_url, admin_user, admin_token):    url = f"{jenkins_url}/user/{username}/config"    headers = {'Content-Type': 'application/xml'}    response = requests.get(url, auth=HTTPBasicAuth(admin_user, admin_token))    config = response.text    updated_config = config.replace('', '').replace('', f'{new_password}')    post_response = requests.post(url, auth=HTTPBasicAuth(admin_user, admin_token),                                   headers=headers, data=updated_config)    return post_response.status_code == 200

4. 删除用户

清理离职或过期的账户:

def delete_jenkins_user(username, jenkins_url, admin_user, admin_token):    url = f"{jenkins_url}/user/{username}/doDelete"    response = requests.post(url, auth=HTTPBasicAuth(admin_user, admin_token))    if response.status_code == 200:        print(f"用户 {username} 已删除")        return True    return False

二、构建操作与监控

5. 获取构建状态

实时监控构建结果,自动触发通知:

def get_build_status(jenkins_url, job_name, build_number, username=None, api_token=None):    url = f"{jenkins_url}/job/{job_name}/{build_number}/api/json"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = requests.get(url, auth=auth, timeout=10)    data = response.json()    building = data.get('building', False)    return "BUILDING" if building else data.get('result', 'UNKNOWN')

6. 触发带参数的构建

一键部署到不同环境:

def trigger_param_build(jenkins_url, job_name, parameters, username, api_token):    url = f"{jenkins_url}/job/{job_name}/buildWithParameters"    auth = HTTPBasicAuth(username, api_token)    response = requests.post(url, auth=auth, data=parameters, timeout=30)    if response.status_code == 201:        queue_location = response.headers.get('Location', '')        print(f"构建已触发,队列位置: {queue_location}")        return queue_location    return None

7. 获取构建控制台输出

实时查看构建日志,定位问题:

def get_build_console(jenkins_url, job_name, build_number, username, api_token, follow=False):    url = f"{jenkins_url}/job/{job_name}/{build_number}/consoleText"    auth = HTTPBasicAuth(username, api_token)    response = requests.get(url, auth=auth, stream=True, timeout=30)    console_text = ""    for line in response.iter_lines(decode_unicode=True):        if line:            console_text += line + "\n"            if follow:                print(line)    return console_text if not follow else None

8. 停止正在运行的构建

发现异常立即终止,避免浪费资源:

def stop_build(jenkins_url, job_name, build_number, username, api_token):    url = f"{jenkins_url}/job/{job_name}/{build_number}/stop"    auth = HTTPBasicAuth(username, api_token)    response = requests.post(url, auth=auth, timeout=10)    return response.status_code == 200

9. 重试失败的构建

一键重试失败任务,提升构建成功率:

def retry_build(jenkins_url, job_name, username, api_token):    url = f"{jenkins_url}/job/{job_name}/lastBuild/api/json"    auth = HTTPBasicAuth(username, api_token)    response = requests.get(url, auth=auth)    data = response.json()    last_build_number = data.get('number')    if data.get('result') == 'FAILURE':        trigger_url = f"{jenkins_url}/job/{job_name}/build"        trigger_response = requests.post(trigger_url, auth=auth)        return trigger_response.status_code == 201    return False

10. 获取构建历史统计

分析构建趋势,优化CI流程:

def get_build_statistics(jenkins_url, job_name, days_back=30, username=None, api_token=None):    url = f"{jenkins_url}/job/{job_name}/api/json?tree=builds[number,result,timestamp,duration,building]"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = requests.get(url, auth=auth, timeout=15)    data = response.json()    builds = data.get('builds', [])    stats = {'total': 0, 'success': 0, 'failure': 0, 'unstable': 0, 'aborted': 0}    for build in builds:        result = build.get('result')        if result:            stats['total'] += 1            stats[result.lower()] = stats.get(result.lower(), 0) + 1    success_rate = (stats['success'] / stats['total'] * 100) if stats['total'] > 0 else 0    stats['success_rate'] = success_rate    return stats

三、任务管理

11. 获取所有任务列表及状态

一键查看所有任务健康度:

def get_all_jobs_with_status(jenkins_url, username=None, api_token=None):    url = f"{jenkins_url}/api/json?tree=jobs[name,url,color,buildable]"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = requests.get(url, auth=auth, timeout=10)    data = response.json()    jobs = data.get('jobs', [])    job_status_list = []    for job in jobs:        color = job.get('color', 'notbuilt')        status_map = {'blue': 'SUCCESS', 'red': 'FAILURE', 'yellow': 'UNSTABLE'}        status = status_map.get(color.split('_')[0], 'UNKNOWN')        job_status_list.append({            'name': job.get('name'),            'url': job.get('url'),            'status': status        })    return job_status_list

12. 创建Pipeline任务

通过代码部署Pipeline,版本可追溯:

def create_pipeline_job(jenkins_url, job_name, pipeline_script, username, api_token):    config_xml = f"""true"""    url = f"{jenkins_url}/createItem?name={job_name}"    headers = {'Content-Type': 'application/xml'}    auth = HTTPBasicAuth(username, api_token)    response = requests.post(url, auth=auth, headers=headers, data=config_xml)    return response.status_code == 200

13. 启用/禁用任务

维护期间批量禁用任务,避免误触发:

def toggle_job(jenkins_url, job_name, enable=True, username=None, api_token=None):    action = "enable" if enable else "disable"    url = f"{jenkins_url}/job/{job_name}/{action}"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = requests.post(url, auth=auth, timeout=10)    return response.status_code == 200

14. 批量操作任务

一键批量启用、禁用或删除任务:

def batch_operation_on_jobs(jenkins_url, operation, job_patterns, username, api_token):    url = f"{jenkins_url}/api/json"    auth = HTTPBasicAuth(username, api_token)    response = requests.get(url, auth=auth)    all_jobs = [job['name'] for job in response.json().get('jobs', [])]    target_jobs = []    for pattern in job_patterns:        if '*' in pattern:            target_jobs.extend([job for job in all_jobs if job.startswith(pattern.replace('*', ''))])        elif pattern in all_jobs:            target_jobs.append(pattern)    results = []    for job_name in target_jobs:        if operation == 'disable':            success = toggle_job(jenkins_url, job_name, enable=False, username=username, api_token=api_token)        elif operation == 'enable':            success = toggle_job(jenkins_url, job_name, enable=True, username=username, api_token=api_token)        elif operation == 'delete':            delete_url = f"{jenkins_url}/job/{job_name}/doDelete"            success = requests.post(delete_url, auth=auth).status_code == 200        results.append({'job_name': job_name, 'success': success})    return results

15. 备份任务配置

自动备份任务配置,防止误删:

def backup_job_config(jenkins_url, job_name, backup_dir, username=None, api_token=None):    url = f"{jenkins_url}/job/{job_name}/config.xml"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = response = requests.get(url, auth=auth)    if response.status_code == 200:        import os        os.makedirs(backup_dir, exist_ok=True)        file_path = os.path.join(backup_dir, f"{job_name}_config.xml")        with open(file_path, 'w', encoding='utf-8') as f:            f.write(response.text)        print(f"任务 '{job_name}' 配置已备份到 {file_path}")        return True    return False

16. 导入任务配置

从备份快速恢复任务:

def import_job_config(jenkins_url, job_name, config_file_path, username, api_token):    url = f"{jenkins_url}/createItem?name={job_name}"    headers = {'Content-Type': 'application/xml'}    auth = HTTPBasicAuth(username, api_token)    with open(config_file_path, 'r', encoding='utf-8') as f:        config_xml = f.read()    response = requests.post(url, auth=auth, headers=headers, data=config_xml)    if response.status_code == 200:        print(f"任务 '{job_name}' 已从备份恢复")        return True    return False

四、系统与资源管理

效率提升对比示意图

17. 获取节点(Agent)信息

监控构建资源,优化节点分配:

def get_nodes_info(jenkins_url, username=None, api_token=None):    url = f"{jenkins_url}/computer/api/json?tree=computer[displayName,offline,idle,numExecutors,busyExecutors]"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = requests.get(url, auth=auth, timeout=10)    data = response.json()    computers = data.get('computer', [])    nodes_info = []    for computer in computers:        nodes_info.append({            'name': computer.get('displayName'),            'offline': computer.get('offline', True),            'idle': computer.get('idle', True),            'num_executors': computer.get('numExecutors', 0),            'busy_executors': computer.get('busyExecutors', 0)        })    return nodes_info

18. 获取队列中的任务

分析队列瓶颈,合理调度资源:

def get_queue_items(jenkins_url, username=None, api_token=None):    url = f"{jenkins_url}/queue/api/json"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = requests.get(url, auth=auth, timeout=10)    data = response.json()    items = data.get('items', [])    queue_info = []    for item in items:        queue_info.append({            'id': item.get('id'),            'task_name': item.get('task', {}).get('name', 'Unknown'),            'stuck': item.get('stuck', False),            'blocked': item.get('blocked', False)        })    return queue_info

19. 获取插件信息

管理插件版本,确保系统安全:

def get_plugins_info(jenkins_url, username=None, api_token=None):    url = f"{jenkins_url}/pluginManager/api/json?depth=2"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = requests.get(url, auth=auth, timeout=10)    data = response.json()    plugins = data.get('plugins', [])    plugins_info = []    for plugin in plugins:        plugins_info.append({            'short_name': plugin.get('shortName'),            'long_name': plugin.get('longName'),            'version': plugin.get('version'),            'enabled': plugin.get('enabled', False),            'has_update': plugin.get('hasUpdate', False)        })    return plugins_info

20. 清理构建历史

自动清理旧构建,释放磁盘空间:

def clean_old_builds(jenkins_url, job_name, keep_last_n=10, username=None, api_token=None):    url = f"{jenkins_url}/job/{job_name}/api/json?tree=builds[number]"    auth = HTTPBasicAuth(username, api_token) if username and api_token else None    response = requests.get(url, auth=auth, timeout=10)    data = response.json()    builds = data.get('builds', [])    if len(builds) <= keep_last_n:        print(f"只有 {len(builds)} 个构建,无需清理")        return True    builds_to_delete = [build['number'] for build in builds[keep_last_n:]]    for build_number in builds_to_delete:        delete_url = f"{jenkins_url}/job/{job_name}/{build_number}/doDelete"        requests.post(delete_url, auth=auth)    print(f"清理完成,删除了 {len(builds_to_delete)} 个旧构建")    return True

实战建议:如何让脚本真正落地

从最痛的点开始别想着一次性全上。先选一个每天重复3次以上的操作,比如"手动触发部署",用脚本替代。尝到甜头后再扩展。

封装成命令行工具把常用脚本打包成CLI工具,加上--help和参数校验,团队其他成员才能轻松使用。参考Python的argparse或click库。

加入错误处理和日志生产环境容不得马虎。每个脚本都要有异常捕获和日志记录,出问题时能快速定位。

脚本是好东西,但记住两点:

第一,测试环境先验证。任何操作在生产环境执行前,都要在测试环境跑一遍,特别是删除和批量操作。

第二,保留操作日志。所有脚本执行都要记录日志,出问题时能追溯。

Jenkins自动化管理不是技术炫技,是实实在在提升团队效率的路径。从今天开始,选一个脚本试试吧。相信我,一旦尝到自动化的甜头,你就回不去了。

“无他,惟手熟尔”!有需要的用起来!
------加入知识库与更多人一起学习------

https://ima.qq.com/wiki/?shareId=f2628818f0874da17b71ffa0e5e8408114e7dbad46f1745bbd1cc1365277631c

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-07-04 05:17:41 HTTP/2.0 GET : https://f.mffb.com.cn/a/490944.html
  2. 运行时间 : 0.176577s [ 吞吐率:5.66req/s ] 内存消耗:4,404.55kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=d206526d7167c7bbe0b5bc409177c593
  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.000569s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000657s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.015261s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000313s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000553s ]
  6. SELECT * FROM `set` [ RunTime:0.002618s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000609s ]
  8. SELECT * FROM `article` WHERE `id` = 490944 LIMIT 1 [ RunTime:0.003948s ]
  9. UPDATE `article` SET `lasttime` = 1783113461 WHERE `id` = 490944 [ RunTime:0.012042s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.015164s ]
  11. SELECT * FROM `article` WHERE `id` < 490944 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.004980s ]
  12. SELECT * FROM `article` WHERE `id` > 490944 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.017063s ]
  13. SELECT * FROM `article` WHERE `id` < 490944 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.011509s ]
  14. SELECT * FROM `article` WHERE `id` < 490944 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001873s ]
  15. SELECT * FROM `article` WHERE `id` < 490944 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.011420s ]
0.180717s