乐于分享
好东西不私藏

OpenClaw 本地操控机制详解

OpenClaw 本地操控机制详解

OpenClaw 本地操控机制详解

深入解析 OpenClaw 如何实现与本地系统的安全交互


引言

OpenClaw 作为新一代 AI 代理平台,其核心能力之一就是对本地系统的深度操控。从简单的文件读写,到复杂的命令执行、进程管理,OpenClaw 如何在保证安全的前提下,实现 AI 与本地环境的无缝协作?本文将深入剖析其底层机制。


一、整体架构概览

1.1 三层架构设计

┌─────────────────────────────────────────────────────────┐
│  Layer 1: AI 推理层 (Model Runtime)                      │
│  - 理解用户意图                                          │
│  - 生成工具调用计划                                       │
│  - 编排多步骤任务                                         │
├─────────────────────────────────────────────────────────┤
│  Layer 2: 工具路由层 (Tool Router)                        │
│  - 工具注册与发现                                         │
│  - 权限检查与策略控制                                     │
│  - 参数解析与转换                                         │
├─────────────────────────────────────────────────────────┤
│  Layer 3: 系统接口层 (OS Interface)                       │
│  - 文件系统操作                                           │
│  - 进程管理                                               │
│  - 网络通信                                               │
└─────────────────────────────────────────────────────────┘

1.2 核心组件关系

OpenClaw Gateway 作为 Node.js 主进程,通过以下组件与本地系统交互:

  • • Tool Registry:工具注册表,管理所有可用工具
  • • Policy Engine:策略引擎,执行安全检查
  • • Process Manager:进程管理器,执行 shell 命令
  • • File System Adapter:文件系统适配器,处理文件 I/O
  • • Audit Logger:审计日志器,记录所有操作

二、工具系统的实现机制

2.1 工具的定义与注册

OpenClaw 采用声明式工具定义,每个工具都是一个包含元数据和处理器函数的对象:

// 工具定义示例 (read.ts)
export
 const readTool = {
  // 工具标识

  name
: 'read',

  // 功能描述(用于模型理解)

  description
: '读取文件内容,支持文本文件和部分二进制文件',

  // 参数模式(JSON Schema)

  parameters
: {
    type
: 'object',
    properties
: {
      file_path
: {
        type
: 'string',
        description
: '文件路径(相对或绝对)'
      },
      limit
: {
        type
: 'number',
        description
: '最大读取行数',
        default
: 2000
      },
      offset
: {
        type
: 'number',
        description
: '起始行号',
        default
: 1
      }
    },
    required
: ['file_path']
  },

  // 处理器函数

  handler
: async (params, context) => {
    // 实际的文件读取逻辑

    return
 await readFileImpl(params);
  }
};

2.2 工具注册流程

  1. 1. 系统启动时扫描:Gateway 启动时扫描内置工具目录
  2. 2. 动态技能加载:加载 skills/ 目录下的技能工具
  3. 3. 权限过滤:根据当前通道策略过滤可用工具
  4. 4. 注入上下文:将可用工具列表注入到模型 Prompt 中

2.3 工具调用的生命周期

用户请求
    │
    ▼
模型生成工具调用意图
    │
    ▼
┌─────────────────────┐
│ 1. 参数校验          │  ◀── 检查参数类型、必填项
│    (Validation)     │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│ 2. 权限检查          │  ◀── 检查工具是否允许使用
│    (Authorization)  │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│ 3. 风险评估          │  ◀── 识别敏感操作
│    (Risk Assessment)│
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│ 4. 用户确认          │  ◀── 高风险操作需确认
│    (Approval)       │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│ 5. 执行操作          │  ◀── 实际调用系统 API
│    (Execution)      │
└──────────┬──────────┘
           │
           ▼
┌─────────────────────┐
│ 6. 结果返回          │  ◀── 格式化输出
│    (Response)       │
└─────────────────────┘

三、文件系统操作详解

3.1 文件读取 (read)

实现原理

  • • 使用 Node.js fs/promises 模块
  • • 支持大文件分块读取(避免内存溢出)
  • • 自动检测文件编码(UTF-8/GBK/二进制)

安全机制

async function readFile(filePath: string, context: Context) {
  // 1. 路径解析与规范化

  const
 resolvedPath = path.resolve(filePath);

  // 2. 工作空间边界检查

  const
 workspaceRoot = context.workspaceRoot;
  if
 (!resolvedPath.startsWith(workspaceRoot)) {
    // 尝试读取外部文件,需要特殊权限

    if
 (!context.hasPermission('read:outside')) {
      throw
 new PermissionError('Access denied: file outside workspace');
    }
  }

  // 3. 敏感文件检查

  const
 sensitivePaths = [
    '/etc/shadow'
,
    '~/.ssh/id_rsa'
,
    process.env.SSH_KEY_PATH
  ];
  if
 (isSensitivePath(resolvedPath)) {
    await
 requireApproval(context, `读取敏感文件: ${resolvedPath}`);
  }

  // 4. 执行读取

  const
 content = await fs.readFile(resolvedPath, 'utf-8');

  // 5. 记录审计日志

  auditLog
('file:read', {
    path
: resolvedPath,
    size
: content.length,
    user
: context.userId,
    timestamp
: Date.now()
  });

  return
 { content, size: content.length };
}

3.2 文件写入 (write)

特殊考量

  • • 原子写入:先写入临时文件,再重命名(防止写入中断损坏原文件)
  • • 备份机制:重要文件自动创建 .bak 备份
  • • 编码处理:自动处理 BOM、换行符差异
async function writeFile(filePath: string, content: string, options?: WriteOptions) {
  const
 resolvedPath = path.resolve(filePath);

  // 检查文件是否存在

  const
 exists = await fs.access(resolvedPath).then(() => true).catch(() => false);

  if
 (exists && !options?.overwrite) {
    throw
 new Error('File exists. Use overwrite: true to replace.');
  }

  // 创建备份(如果文件已存在且大于1KB)

  if
 (exists && options?.backup !== false) {
    const
 backupPath = `${resolvedPath}.bak`;
    await
 fs.copyFile(resolvedPath, backupPath);
  }

  // 原子写入

  const
 tempPath = `${resolvedPath}.tmp.${Date.now()}`;
  await
 fs.writeFile(tempPath, content, 'utf-8');
  await
 fs.rename(tempPath, resolvedPath);

  return
 { path: resolvedPath, bytesWritten: Buffer.byteLength(content) };
}

3.3 文件编辑 (edit)

设计哲学

  • • 采用精确匹配替换策略,避免误替换
  • • 支持多行文本匹配
  • • 失败后自动回滚
async function editFile(filePath: string, oldText: string, newText: string) {
  const
 content = await fs.readFile(filePath, 'utf-8');

  // 精确匹配检查

  if
 (!content.includes(oldText)) {
    throw
 new Error(`Exact text not found in file. Use read() to check current content.`);
  }

  // 统计匹配次数(防止多处匹配导致意外替换)

  const
 matchCount = content.split(oldText).length - 1;
  if
 (matchCount > 1) {
    throw
 new Error(`Multiple matches (${matchCount}) found. Please provide more context.`);
  }

  // 执行替换

  const
 newContent = content.replace(oldText, newText);

  // 写入(使用原子写入)

  await
 writeFile(filePath, newContent, { backup: true });

  return
 {
    path
: filePath,
    replaced
: true,
    oldLength
: oldText.length,
    newLength
: newText.length
  };
}

四、命令执行机制

4.1 三种执行模式

模式
适用场景
特点
exec
简单命令,获取完整输出
等待命令完成,返回 stdout/stderr
spawn
长时间运行、流式输出
实时推送输出,支持取消
pty
交互式命令
模拟终端,支持 TTY 交互

4.2 exec 模式实现

import { exec } from 'child_process';
import
 { promisify } from 'util';

const
 execAsync = promisify(exec);

async
 function execCommand(command: string, options: ExecOptions) {
  // 命令解析与安全性检查

  const
 risk = analyzeRisk(command);

  if
 (risk.level === 'high') {
    await
 requireApproval(`执行高风险命令: ${command}`);
  }

  // 设置执行环境

  const
 execOptions = {
    cwd
: options.workdir || process.cwd(),
    timeout
: (options.timeout || 60) * 1000,
    maxBuffer
: 10 * 1024 * 1024,  // 10MB 输出限制
    env
: {
      ...process.env,
      // 隔离敏感环境变量

      SSH_KEY
: undefined,
      AWS_SECRET
: undefined,
      ...options.env
    }
  };

  // 执行命令

  const
 { stdout, stderr } = await execAsync(command, execOptions);

  return
 {
    stdout
: stdout.trim(),
    stderr
: stderr.trim(),
    exitCode
: 0
  };
}

4.3 spawn 模式实现(流式输出)

import { spawn } from 'child_process';

async
 function spawnCommand(command: string, args: string[], options: SpawnOptions) {
  const
 child = spawn(command, args, {
    cwd
: options.workdir,
    stdio
: ['pipe', 'pipe', 'pipe'],
    detached
: false  // 防止孤儿进程
  });

  let
 output = '';
  let
 errorOutput = '';

  // 实时流式输出

  child.stdout.on('data', (data) => {
    const
 chunk = data.toString();
    output += chunk;

    // 推送到前端(通过 WebSocket)

    context.sendStream({
      type
: 'stdout',
      data
: chunk,
      timestamp
: Date.now()
    });
  });

  child.stderr.on('data', (data) => {
    const
 chunk = data.toString();
    errorOutput += chunk;

    context.sendStream({
      type
: 'stderr',
      data
: chunk,
      timestamp
: Date.now()
    });
  });

  // 超时处理

  const
 timeout = setTimeout(() => {
    child.kill('SIGTERM');
    throw
 new Error(`Command timed out after ${options.timeout}s`);
  }, options.timeout * 1000);

  // 等待完成

  const
 exitCode = await new Promise((resolve) => {
    child.on('close', (code) => {
      clearTimeout
(timeout);
      resolve
(code);
    });
  });

  return
 { stdout: output, stderr: errorOutput, exitCode };
}

4.4 PTY 模式实现(交互式命令)

PTY (Pseudo Terminal) 用于需要终端交互的命令,如 vimtopnpm init

import { spawn as spawnPty } from 'node-pty';

class
 PtySession {
  private
 ptyProcess: any;
  private
 sessionId: string;

  constructor
(command: string, args: string[], options: PtyOptions) {
    this
.sessionId = generateId();

    // 创建 PTY 进程

    this
.ptyProcess = spawnPty(
      command,
      args,
      {
        name
: 'xterm-256color',  // 终端类型
        cols
: options.cols || 80,
        rows
: options.rows || 30,
        cwd
: options.cwd,
        env
: process.env
      }
    );

    // 数据流转发

    this
.ptyProcess.onData((data: string) => {
      this
.emit('data', data);
    });

    this
.ptyProcess.onExit(({ exitCode }) => {
      this
.emit('exit', exitCode);
    });
  }

  // 发送输入

  write
(data: string) {
    this
.ptyProcess.write(data);
  }

  // 调整终端大小

  resize
(cols: number, rows: number) {
    this
.ptyProcess.resize(cols, rows);
  }

  // 发送特殊按键

  sendKey
(key: string) {
    const
 keyMap: Record<string, string> = {
      'Enter'
: '\r',
      'Tab'
: '\t',
      'Escape'
: '\u001b',
      'ArrowUp'
: '\u001b[A',
      'ArrowDown'
: '\u001b[B',
      'Ctrl+C'
: '\u0003',
      'Ctrl+D'
: '\u0004'
    };

    this
.write(keyMap[key] || key);
  }

  // 终止进程

  kill
(signal?: string) {
    this
.ptyProcess.kill(signal || 'SIGTERM');
  }
}

五、安全机制详解

5.1 多层防护体系

┌─────────────────────────────────────────┐
│  Level 1: 输入过滤                       │
│  - 命令注入检测                          │
│  - SQL 注入检测                          │
│  - 路径遍历检测                          │
├─────────────────────────────────────────┤
│  Level 2: 权限控制                       │
│  - 基于角色的访问控制 (RBAC)              │
│  - 工作空间边界限制                       │
│  - 工具白名单/黑名单                      │
├─────────────────────────────────────────┤
│  Level 3: 行为分析                       │
│  - 敏感操作模式识别                       │
│  - 异常行为检测                          │
│  - 风险评分系统                          │
├─────────────────────────────────────────┤
│  Level 4: 用户确认                       │
│  - 高风险操作确认                         │
│  - 超时确认机制                          │
│  - 批量操作确认                          │
├─────────────────────────────────────────┤
│  Level 5: 审计追溯                       │
│  - 全量操作日志                          │
│  - 实时告警系统                          │
│  - 事后溯源能力                          │
└─────────────────────────────────────────┘

5.2 敏感操作识别

// 风险规则定义
const
 RISK_RULES = [
  {
    id
: 'rm_root',
    pattern
: /rm\s+-rf?\s+\/($|\s)/,
    level
: 'extreme',
    description
: '尝试删除根目录',
    action
: 'block'
  },
  {
    id
: 'sudo_elevate',
    pattern
: /sudo|sudo\s+/,
    level
: 'high',
    description
: '使用 sudo 提权',
    action
: 'require_approval'
  },
  {
    id
: 'network_exfil',
    pattern
: /curl.*-d.*http|wget.*-O-\s*\|/,
    level
: 'high',
    description
: '可能的数据外泄',
    action
: 'require_approval'
  },
  {
    id
: 'credential_access',
    pattern
: /cat.*\.env|cat.*config.*\.json/,
    level
: 'medium',
    description
: '访问配置文件',
    action
: 'log'
  }
];

function
 analyzeRisk(command: string): RiskAssessment {
  for
 (const rule of RISK_RULES) {
    if
 (rule.pattern.test(command)) {
      return
 {
        level
: rule.level,
        ruleId
: rule.id,
        description
: rule.description,
        action
: rule.action
      };
    }
  }

  return
 { level: 'low', action: 'allow' };
}

5.3 Approval 确认系统

确认流程状态机

        ┌──────────────┐
        │   等待执行    │
        └──────┬───────┘
               │ 检测到高风险
               ▼
        ┌──────────────┐
        │  发送确认请求  │
        │  (推送到前端)  │
        └──────┬───────┘
               │
       ┌───────┴───────┐
       │               │
       ▼               ▼
┌──────────┐    ┌──────────┐
│ 用户允许  │    │ 用户拒绝  │
└────┬─────┘    └────┬─────┘
     │               │
     ▼               ▼
┌──────────┐    ┌──────────┐
│ 执行操作  │    │ 取消操作  │
└────┬─────┘    └────┬─────┘
     │               │
     └───────┬───────┘
             ▼
     ┌──────────────┐
     │  记录审计日志  │
     └──────────────┘

确认超时处理

async function requestApproval(context: Context, request: ApprovalRequest): Promise<ApprovalResult> {
  const
 timeout = request.timeout || 300000;  // 默认5分钟

  return
 new Promise((resolve, reject) => {
    const
 timeoutId = setTimeout(() => {
      reject
(new Error('Approval request timed out'));
    }, timeout);

    context.once('approval_response', (response: ApprovalResponse) => {
      clearTimeout
(timeoutId);

      if
 (response.granted) {
        // 记录授权

        auditLog
('approval:granted', {
          requestId
: request.id,
          userId
: context.userId,
          operation
: request.operation,
          timestamp
: Date.now()
        });

        resolve
({ granted: true, user: response.user });
      } else {
        resolve
({ granted: false, reason: response.reason });
      }
    });

    // 发送确认请求到用户界面

    context.sendToUser({
      type
: 'approval_request',
      id
: request.id,
      title
: request.title,
      description
: request.description,
      risk
: request.risk,
      timeout
: timeout
    });
  });
}

六、平台适配策略

6.1 跨平台抽象层

interface PlatformAdapter {
  readonly
 platform: 'win32' | 'darwin' | 'linux';

  // Shell 相关

  getDefaultShell
(): string;
  getShellArgs
(command: string): string[];

  // 路径相关

  normalizePath
(path: string): string;
  getHomeDir
(): string;
  getTempDir
(): string;

  // 权限相关

  elevate
(command: string): string;
  checkPermission
(path: string, mode: string): boolean;

  // 进程相关

  kill
(pid: number, signal?: string): void;
  getProcessList
(): ProcessInfo[];
}

// Windows 适配器

class
 WindowsAdapter implements PlatformAdapter {
  readonly
 platform = 'win32';

  getDefaultShell
(): string {
    return
 'powershell.exe';
  }

  getShellArgs
(command: string): string[] {
    return
 ['-NoProfile', '-Command', command];
  }

  normalizePath
(path: string): string {
    return
 path.replace(/\//g, '\\');
  }

  elevate
(command: string): string {
    return
 `Start-Process powershell -Verb runAs -ArgumentList '${command}'`;
  }
}

// Unix 适配器(Linux/macOS)

class
 UnixAdapter implements PlatformAdapter {
  readonly
 platform = process.platform;

  getDefaultShell
(): string {
    return
 process.env.SHELL || '/bin/bash';
  }

  getShellArgs
(command: string): string[] {
    return
 ['-c', command];
  }

  normalizePath
(path: string): string {
    return
 path.replace(/\\/g, '/');
  }

  elevate
(command: string): string {
    return
 `sudo ${command}`;
  }
}

// 工厂函数

function
 createPlatformAdapter(): PlatformAdapter {
  switch
 (process.platform) {
    case
 'win32':
      return
 new WindowsAdapter();
    case
 'darwin':
    case
 'linux':
      return
 new UnixAdapter();
    default
:
      throw
 new Error(`Unsupported platform: ${process.platform}`);
  }
}

6.2 Windows 特殊处理

class WindowsPlatform {
  // PowerShell 执行策略处理

  async
 bypassExecutionPolicy(): Promise<void> {
    // 使用 -ExecutionPolicy Bypass 参数

  }

  // 编码处理(PowerShell 默认 UTF-16)

  encodeOutput
(output: string): string {
    // 转换 UTF-16 到 UTF-8

    return
 iconv.decode(Buffer.from(output, 'binary'), 'utf16le');
  }

  // 路径长度处理(MAX_PATH = 260)

  handleLongPath
(path: string): string {
    if
 (path.length > 260) {
      // 使用 \\?\ 前缀支持长路径

      return
 `\\\\?\\${path}`;
    }
    return
 path;
  }
}

七、技能系统的本地执行

7.1 技能脚本的隔离执行

async function executeSkillScript(skill: Skill, tool: Tool, args: any) {
  const
 scriptPath = path.join(skill.directory, tool.script);

  // 1. 验证脚本存在

  if
 (!await fs.access(scriptPath).then(() => true).catch(() => false)) {
    throw
 new Error(`Script not found: ${scriptPath}`);
  }

  // 2. 构建隔离环境

  const
 env = {
    ...process.env,
    // 技能专用变量

    OPENCLAW_SKILL_ID
: skill.id,
    OPENCLAW_SKILL_DIR
: skill.directory,
    OPENCLAW_WORKSPACE
: workspaceRoot,
    OPENCLAW_SESSION_ID
: context.sessionId,

    // 注入技能配置(API keys 等)

    ...skill.config,

    // 移除敏感环境变量

    SSH_PRIVATE_KEY
: undefined,
    AWS_ACCESS_KEY_ID
: undefined,
    PASSWORD
: undefined
  };

  // 3. 构建命令

  const
 command = tool.interpreter || 'python';
  const
 argsArray = [scriptPath, ...serializeArgs(args)];

  // 4. 执行并监控

  const
 startTime = Date.now();
  const
 result = await spawnCommand(command, argsArray, {
    cwd
: skill.directory,
    env,
    timeout
: tool.timeout || 60000,
    maxOutput
: 10 * 1024 * 1024  // 10MB
  });

  const
 duration = Date.now() - startTime;

  // 5. 记录执行日志

  auditLog
('skill:execute', {
    skillId
: skill.id,
    toolName
: tool.name,
    duration,
    exitCode
: result.exitCode,
    outputSize
: result.stdout.length
  });

  // 6. 解析输出

  if
 (tool.outputFormat === 'json') {
    return
 JSON.parse(result.stdout);
  }

  return
 { output: result.stdout, exitCode: result.exitCode };
}

7.2 技能权限声明

# skill.yaml
name:
 my-skill
version:
 1.0.0

# 权限声明

permissions:

  filesystem:

    -
 path: "./data"
      access:
 "read_write"
    -
 path: "./logs"
      access:
 "write_only"

  network:

    -
 host: "api.example.com"
      ports:
 [443]
    -
 host: "*.openweathermap.org"
      ports:
 [80, 443]

  commands:

    -
 "git"
    -
 "curl"
    -
 "python"

  blocked:

    -
 "rm -rf /"
    -
 "sudo"
    -
 "> /etc/passwd"

# 资源限制

resources:

  maxMemory:
 "512MB"
  maxCpu:
 "50%"
  timeout:
 60

八、性能优化策略

8.1 文件操作优化

// 1. 使用流式读取大文件
async
 function readLargeFile(filePath: string, callback: (chunk: string) => void) {
  const
 stream = createReadStream(filePath, { encoding: 'utf-8' });

  for
 await (const chunk of stream) {
    callback
(chunk);
  }
}

// 2. 文件内容缓存

const
 fileCache = new LRUCache<string, CacheEntry>({
  maxSize
: 100 * 1024 * 1024,  // 100MB
  maxAge
: 5 * 60 * 1000        // 5分钟
});

async
 function readWithCache(filePath: string) {
  const
 stat = await fs.stat(filePath);
  const
 cacheKey = `${filePath}:${stat.mtime.getTime()}`;

  if
 (fileCache.has(cacheKey)) {
    return
 fileCache.get(cacheKey);
  }

  const
 content = await fs.readFile(filePath, 'utf-8');
  fileCache.set(cacheKey, content);

  return
 content;
}

// 3. 批量文件操作

async
 function batchOperations(operations: FileOperation[]) {
  // 使用 Promise.all 并发执行

  const
 results = await Promise.allSettled(
    operations.map(op => executeOperation(op))
  );

  return
 results;
}

8.2 进程管理优化

class ProcessPool {
  private
 pool: Map<string, ChildProcess> = new Map();
  private
 maxConcurrent: number = 10;

  async
 acquire(key: string): Promise<ChildProcess> {
    // 等待直到有可用槽位

    while
 (this.pool.size >= this.maxConcurrent) {
      await
 this.waitForSlot();
    }

    // 创建或复用进程

    if
 (!this.pool.has(key)) {
      const
 proc = this.createManagedProcess(key);
      this
.pool.set(key, proc);
    }

    return
 this.pool.get(key)!;
  }

  private
 createManagedProcess(key: string): ChildProcess {
    const
 proc = spawn('python', ['-u', '-'], {
      stdio
: ['pipe', 'pipe', 'pipe']
    });

    // 自动清理

    proc.on('exit', () => {
      this
.pool.delete(key);
    });

    return
 proc;
  }
}

九、调试与监控

9.1 操作审计日志

interface AuditLogEntry {
  timestamp
: number;
  sessionId
: string;
  userId
: string;
  action
: string;
  resource
: string;
  params
: any;
  result
: 'success' | 'failure';
  duration
: number;
  riskLevel
?: string;
}

class
 AuditLogger {
  private
 logStream: WriteStream;

  constructor
(logPath: string) {
    this
.logStream = createWriteStream(logPath, { flags: 'a' });
  }

  log
(entry: AuditLogEntry) {
    const
 line = JSON.stringify(entry) + '\n';
    this
.logStream.write(line);

    // 实时告警(高风险操作)

    if
 (entry.riskLevel === 'high' || entry.riskLevel === 'extreme') {
      this
.sendAlert(entry);
    }
  }

  // 查询审计日志

  async
 query(filters: AuditQueryFilters): Promise<AuditLogEntry[]> {
    const
 logs: AuditLogEntry[] = [];
    const
 stream = createReadStream(this.logPath);

    const
 rl = createInterface({ input: stream });

    for
 await (const line of rl) {
      const
 entry = JSON.parse(line);

      if
 (this.matchesFilters(entry, filters)) {
        logs.push(entry);
      }
    }

    return
 logs;
  }
}

9.2 实时监控面板

// 提供系统状态的实时查询
class
 SystemMonitor {
  async
 getStats(): Promise<SystemStats> {
    return
 {
      // 活跃会话数

      activeSessions
: this.sessionManager.getActiveCount(),

      // 正在运行的进程

      runningProcesses
: this.processManager.getRunningCount(),

      // 文件操作统计

      fileOperations
: {
        reads
: this.metrics.fileReads,
        writes
: this.metrics.fileWrites,
        errors
: this.metrics.fileErrors
      },

      // 命令执行统计

      commandExecutions
: {
        total
: this.metrics.commandsExecuted,
        failed
: this.metrics.commandsFailed,
        avgDuration
: this.metrics.avgCommandDuration
      },

      // 缓存命中率

      cacheHitRate
: this.cache.getHitRate()
    };
  }
}

十、总结

OpenClaw 的本地操控机制体现了安全性、灵活性和可扩展性的设计原则:

  1. 1. 分层架构:从 AI 推理层到系统接口层,每层职责清晰
  2. 2. 多重安全:输入过滤、权限控制、行为分析、用户确认、审计追溯五层防护
  3. 3. 平台适配:统一的抽象层屏蔽平台差异,同时保留平台特性
  4. 4. 性能优化:缓存、流式处理、进程池等技术确保高效运行
  5. 5. 可观测性:完整的审计日志和实时监控

这种设计使得 OpenClaw 既能充分发挥 AI 的能力,又能确保本地系统的安全和稳定。


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