当前位置:首页>python>我用python重构了openclaw

我用python重构了openclaw

  • 2026-04-02 05:46:29
我用python重构了openclaw
最近一只很火的大龙虾席卷了全球,为什么他能这么火,我自己使用下来无非就是"人味",那我是如何用python复刻这个经典项目的呢
首先我得创建一个入口,我们都知道python中main是一个程序的入口,并且设计的时候尽量保持只有接口在main上.
所以main里面要放什么,首先考虑的就是配置,模型必须要有key的配置,否则咋调用模型呢,第二点就是要有飞书类似的社交媒体的接口,否则就只能在黑乎乎的terminal里用我们的privateclaw了,也可以看到有非常多的地方要用到大模型,我们聊天要用大模型吧,在状态机中我们需要大模型吧,在总结的我们的私人记忆的时候需要大模型把,这时候都要去配置好
def load_personalization() -> dict:    defaults = {        "api_key_env""DASHSCOPE_API_KEY",        "base_url""https://dashscope.aliyuncs.com/compatible-mode/v1",        "models": {            "chat""qwen-max",            "router""qwen-max",            "fsm""qwen-max",            "plan""qwen-max",            "summary""qwen-max",        },    }    try:        withopen("personalization.yaml""r", encoding="utf-8"as f:            raw = yaml.safe_load(f) or {}            defaults["api_key_env"] = raw.get("api_key_env", defaults["api_key_env"])            defaults["base_url"] = raw.get("base_url", defaults["base_url"])            models = raw.get("models", {})            for key in defaults["models"]:                defaults["models"][key] = models.get(key, defaults["models"][key])    except Exception:        pass    return defaults
接下来main里还需要什么呢,为什么openclaw能这么智能,就是它能够调用skill,什么是skill呢,简单来说就是给你的模型加上能执行的工具
def load_tool_config() -> list:    def _read_yaml(file_path: str):        try:            with open(file_path, "r", encoding="utf-8"as f:                return yaml.safe_load(f) or []        except Exception:            return []    core_tools = _read_yaml("tool_config.yaml")    dynamic_tools = _read_yaml("dynamic_config.yaml")    if isinstance(dynamic_tools, dict):        dynamic_tools = [dynamic_tools]    if not isinstance(dynamic_tools, list):        dynamic_tools = []    return core_tools + dynamic_tools
之后便是加上记忆这些杂七杂八的配置了,接下来我从三点讲为什么我重构的privateclaw能复刻openclaw的重点,我从三点说
第一点他能够调用工具,并且能更具基座大模型的智能,他调用工具的能力更好,那大模型是怎么调用工具的呢,他的数据在python里面流动,但是他无法看到工具长什么样子,那我们可以创建一个固定的格式在他运行之前告诉他,
typefunction  function:    name: get_system_time    description: Get the current real-time clock of the system.    parameters:      type: object      properties: {}      required: []typefunction  function:    name: web_search    description: 当你需要“快速获取少量最新事实/链接”时使用;适合先做信息探测与候选来源收集,再决定是否进入 deep_search。    parameters:      type: object      properties:        query:          type: string          description: 要在搜索引擎中输入的搜索关键词,一次搜索不到没有关系,可以拆解关键词找到答案。      required:        - querytypefunction  function:    name: deep_search    description: 当问题复杂、需要多轮检索+页面阅读+反思总结时使用;它比 web_search 更慢但更全面,适合最终结论前的深挖。    parameters:      type: object      properties:        query:          type: string          description: 需要深度搜索的问题或主题。      required:        - querytypefunction  function:    name: execute_python_code    description: 当需要计算、数据处理、格式转换、脚本验证时使用;用于可重复的程序化推导,不用于高风险系统操作。    parameters:      type: object      properties:        code_string:          type: string          description: The valid Python code string to be executed.      required:        - code_stringtypefunction  function:    name: create_new_skills    description: 当你需要长期拥有一个新能力时,调用此工具编写并保存永久的新技能。你需要提供完整的Python实现代码和匹配的YAML配置。    parameters:      type: object      properties:        skill_name:          type: string          description: 新技能的纯英文函数名,例如 calculate_tax。        python_code:          type: string          description: 完整的Python函数代码。        yaml_config:          type: string          description: |            严格遵守OpenAI工具格式的YAML文本。绝对禁止使用扁平结构!name和description必须嵌套在function内部!必须完全复制并填空以下模板,绝不能遗漏外层的横杠:            - typefunction              function:                name: function_name_here                description: description_here                parameters:                  type: object                  properties: {}      required:        - skill_name        - python_code        - yaml_configtypefunction  function:    name: exec_cli_command    description: |      受控命令执行工具。用于读取环境信息、运行诊断命令、执行安全脚本。      本工具内部会拒绝危险命令(如 rm、shutdown、mkfs 等);若出现权限/allowlist/审批类报错,不应盲目重试。    parameters:      type: object      properties:        command:          type: string          description: 需要执行的命令字符串。      required:        - commandtypefunction  function:    name: schedule_cli_command    description: |      定时执行命令工具。适用于用户明确提出“几秒后/几分钟后执行某命令”的需求。      危险命令会被自动拒绝;若命令依赖前台节点或权限,请先确认条件满足再调度。    parameters:      type: object      properties:        delay_seconds:          typeinteger          description: 距离执行时间的秒数,必须大于 0。        command:          type: string          description: 到点后要执行的命令。      required:        - delay_seconds        - command
如这里所示,他能调用多种工具,执行自己写的python代码,并且如果自己写错还能返回报错减少了智能体执行任务时产生幻觉的可能性,执行cli代码能让你在千里之外能够知道你机器的状态,深度搜索能给予你机器的账号登陆状态看到你的机器里面专属社群的消息,cron功能能让你执行定时的任务,等等 这些功能你可以自己创建,把你的工作流程定义成一条固定的格式,能让机器自动执行,这就是智能的一个点 在讲第二点前我得说明下我的整个数据是如何一个流动的过程
飞书和cli终端 飞书通过layer层 终端和飞书交汇于agentruntime 之后再发给agentloop 最后再返回agentruntime  这是我给gemini的提示词,也可以看出,飞书或者是微信这个社交媒体的出口上,首先经过layer的清洗数据变得于cli统一,这时候再进入agentruntime,相当于是进入agentloop的管道,负责数据的进入和出来.
这时候我们又讲到激动人心的时刻了,agentloop工程化的又一典范,首先我先show一下mycode
import jsonfrom dataclasses import dataclassfrom datetime import datetimeimport timefrom uuid import uuid4from typing import Optionalfrom channel_layer import RuntimeMessage@dataclassclass LoopDecision:    kind: str  # "answer" | "tool_calls" | "need_approval"    answer: str = ""    tool_calls: Optional[list] = None    approval_request: Optional[dict] = Noneclass AgentLoop:    """Plan / Execute / Observe:planner 只决策,executor 只执行。"""    RUN_TIMEOUT_SECONDS = 60    MAX_STALL_STEPS = 8    MAX_SAME_TOOL_FAILURES = 3    NON_RETRIABLE_ERROR_SIGNATURES = (        "approval required",        "allowlist miss",        "permission denied",        "权限缺失",        "权限不足",        "forbidden",        "not authorized",        "节点不在前台",        "not in foreground",    )    def __init__(self, client, memory_manager, tool_config, available_tools, personalization: dict):        self.client = client        self.memory_manager = memory_manager        self.tool_config = tool_config        self.available_tools = available_tools        self.personalization = personalization        self.session_histories = {}        self.session_conversations = {}    @staticmethod    def _debug(stage: str, detail: str = ""):        now = datetime.now().strftime("%H:%M:%S")        suffix = f" | {detail}" if detail else ""        print(f"[DEBUG] {now}{stage}{suffix}")    @staticmethod    def _new_conversation_id() -> str:        return f"conv-{uuid4().hex[:10]}"    def _resolve_conversation_id(self, session_id: str, requested_conversation_id: str = "") -> str:        conversation_id = (requested_conversation_id or "").strip()        if conversation_id:            self.session_conversations[session_id] = conversation_id            return conversation_id        if session_id not in self.session_conversations:            self.session_conversations[session_id] = self._new_conversation_id()        return self.session_conversations[session_id]    def _reset_conversation(self, session_id: str) -> str:        new_id = self._new_conversation_id()        self.session_conversations[session_id] = new_id        self.session_histories[new_id] = []        return new_id    def _get_or_create_history(self, conversation_id: str):        if conversation_id not in self.session_histories:            self.session_histories[conversation_id] = []        return self.session_histories[conversation_id]    @staticmethod    def _build_tool_error_message(tool_call_id: str, name: str, reason: str) -> dict:        return {            "role""tool",            "content"f"tool call not completed: {reason}",            "tool_call_id": tool_call_id,            "name": name,        }    def _repair_history(self, history: list[dict]) -> list[dict]:        """修复悬空 tool_calls,保证给模型和持久化前的历史结构合法。"""        repaired = []        i = 0        while i < len(history):            item = history[i]            repaired.append(item)            tool_calls = item.get("tool_calls"if isinstance(item, dictelse None            if item.get("role") == "assistant" and tool_calls:                required_ids = [tc.get("id"for tc in tool_calls if tc.get("id")]                j = i + 1                matched_ids = set()                buffered_following = []                while j < len(history):                    nxt = history[j]                    if isinstance(nxt, dictand nxt.get("role") == "tool":                        buffered_following.append(nxt)                        tool_call_id = nxt.get("tool_call_id")                        if tool_call_id in required_ids:                            matched_ids.add(tool_call_id)                        j += 1                        continue                    break                repaired.extend(buffered_following)                missing_ids = [tid for tid in required_ids if tid not in matched_ids]                if missing_ids:                    for tc in tool_calls:                        tc_id = tc.get("id")                        if tc_id in missing_ids:                            name = ((tc.get("function"or {}).get("name"if isinstance(tc, dictelse ""or "unknown"                            repaired.append(self._build_tool_error_message(tc_id, name, "missing tool response patched"))                i = j                continue            i += 1        return repaired    def _plan(self, user_scope_id: str, history: list[dict]) -> LoopDecision:        history[:] = self._repair_history(history)        self._debug("plan_start")        response = self.client.chat.completions.create(            model=self.personalization["models"]["fsm"],            messages=[                {                    "role""system",                    "content""你是 Planner。优先直接回答;需要工具时发起 tool_calls;当问题需要多轮检索和网页阅读时优先调用 deep_search;危险工具先请求审批。",                },                {"role""system""content"self.memory_manager.build_system_context(user_scope_id=user_scope_id)},                *history,            ],            tools=self.tool_config,            stream=False,        )        message = response.choices[0].message        msg_dict = message.model_dump(exclude_none=True)        if msg_dict.get("content"is None:            msg_dict["content"] = ""        history.append(msg_dict)        if message.tool_calls:            tool_calls = [                {                    "id": t.id,                    "name": t.function.name,                    "arguments": t.function.arguments,                }                for t in message.tool_calls            ]            if self._needs_approval(tool_calls):                return LoopDecision(                    kind="need_approval",                    approval_request={"reason""sensitive_tool""tool_calls": tool_calls},                )            return LoopDecision(kind="tool_calls", tool_calls=tool_calls)        self._debug("plan_end""answer")        return LoopDecision(kind="answer", answer=(message.content or "").strip())    @staticmethod    def _needs_approval(tool_calls: list[dict]) -> bool:        sensitive_keywords = ("delete""remove""exec""shell""write""drop")        for call in tool_calls:            name = (call.get("name"or "").lower()            if any(word in name for word in sensitive_keywords):                return True        return False    @staticmethod    def _request_approval(_msg: RuntimeMessage, approval_request: dict) -> str:        tool_names = [c.get("name"""for c in (approval_request or {}).get("tool_calls", [])]        return f"审批结果:自动批准。tools={','.join(tool_names)}"    @staticmethod    def _tool_failure_signature(tool_name: str, args: str) -> str:        return f"{tool_name}::{args}"    @staticmethod    def _is_tool_failure(text: str) -> bool:        low = (text or "").lower()        markers = (            "error",            "failed",            "failure",            "exception",            "命令执行失败",            "命令执行异常",            "json decode error",            "not found",        )        return any(m in low for m in markers)    def _match_non_retriable_signature(self, text: str) -> str:        low = (text or "").lower()        for sig in self.NON_RETRIABLE_ERROR_SIGNATURES:            if sig in low:                return sig        return ""    def _execute(self, tool_calls: list[dict], failure_counts: dict[strint]) -> tuple[list[dict], str]:        self._debug("execute_start"f"count={len(tool_calls)}")        tool_results = []        hard_stop_reason = ""        for idx, tool_call in enumerate(tool_calls, start=1):            func_name = tool_call.get("name""")            func_args_str = tool_call.get("arguments""{}")            call_id = tool_call.get("id"f"tool-{idx}")            sig = self._tool_failure_signature(func_name, func_args_str)            result = f"error: tool '{func_name}' not found."            if func_name in self.available_tools:                func = self.available_tools.get(func_name)                try:                    json_args = json.loads(func_args_str)                    result = func(**json_args)                except json.JSONDecodeError as e:                    result = f"Tool arguments JSON decode error: {str(e)}"                except Exception as e:                    result = f"Error executing tool '{func_name}': {str(e)}"            result_text = str(result)            non_retry_sig = self._match_non_retriable_signature(result_text)            if non_retry_sig:                hard_stop_reason = (                    f"检测到不可重试错误签名: `{non_retry_sig}`。"                    f"工具 `{func_name}` 返回:{result_text}"                )            if self._is_tool_failure(result_text):                failure_counts[sig] = failure_counts.get(sig, 0) + 1                if failure_counts[sig] >= self.MAX_SAME_TOOL_FAILURES and not hard_stop_reason:                    hard_stop_reason = (                        f"同一工具与参数连续失败已达 {self.MAX_SAME_TOOL_FAILURES} 次,"                        f"停止重试。工具=`{func_name}` 参数=`{func_args_str}` 最近报错:{result_text}"                    )            else:                failure_counts[sig] = 0            tool_results.append(                {                    "role""tool",                    "content": result_text,                    "tool_call_id": call_id,                    "name": func_name,                }            )            if hard_stop_reason:                break        self._debug("execute_end")        return tool_results, hard_stop_reason    def run(self, msg: RuntimeMessage) -> dict:        run_id = f"run-{uuid4().hex[:8]}"        session_id = msg.session_id        user_input = (msg.text or "").strip()        user_scope_id = (msg.user_scope_id or session_id).strip() or session_id        conversation_id = self._resolve_conversation_id(session_id, msg.conversation_id)        queue_wait_ms = max(0int(time.time() * 1000) - int(getattr(msg, "enqueue_ts_ms"0or 0))        llm_ms_total = 0        tool_ms_total = 0        memory_ms_total = 0        if not user_input:            self._debug(                "run_metrics",                f"run_id={run_id} session_id={session_id} conversation_id={conversation_id} "                f"queue_wait_ms={queue_wait_ms} llm_ms={llm_ms_total} tool_ms={tool_ms_total} "                f"memory_ms={memory_ms_total} dedup_key={getattr(msg, 'dedup_key''')}",            )            return {                "session_id": session_id,                "conversation_id": conversation_id,                "user_scope_id": user_scope_id,                "text""Empty input.",            }        if user_input == "/reset":            new_conversation_id = self._reset_conversation(session_id)            self._debug(                "run_metrics",                f"run_id={run_id} session_id={session_id} conversation_id={new_conversation_id} "                f"queue_wait_ms={queue_wait_ms} llm_ms={llm_ms_total} tool_ms={tool_ms_total} "                f"memory_ms={memory_ms_total} dedup_key={getattr(msg, 'dedup_key''')}",            )            return {                "session_id": session_id,                "conversation_id": new_conversation_id,                "user_scope_id": user_scope_id,                "text"f"会话已重置,新短期会话ID: {new_conversation_id}",            }        history = self._get_or_create_history(conversation_id)        history.append({"role""user""content": user_input})        state = "PLANNING"        pending_tool_calls = []        final_answer = ""        loop_start = time.perf_counter()        failure_counts: dict[strint] = {}        last_snapshot = ""        stall_steps = 0        for _ in range(64):            if (time.perf_counter() - loop_start) > self.RUN_TIMEOUT_SECONDS:                final_answer = "本轮处理超过 60 秒已强制结束,请你根据当前报错继续排障,我已把控制权交还给你。"                break            snapshot = f"{state}|{len(history)}|{len(pending_tool_calls)}|{final_answer}"            if snapshot == last_snapshot:                stall_steps += 1            else:                stall_steps = 0                last_snapshot = snapshot            if stall_steps >= self.MAX_STALL_STEPS:                final_answer = "连续 8 步无状态变化,已终止本轮处理。请提供更具体输入或调整权限/参数后重试。"                break            if state == "PLANNING":                t_llm_start = time.perf_counter()                decision = self._plan(user_scope_id=user_scope_id, history=history)                llm_ms_total += int((time.perf_counter() - t_llm_start) * 1000)                if decision.kind == "answer":                    final_answer = decision.answer or ""                    break                if decision.kind == "tool_calls":                    pending_tool_calls = decision.tool_calls or []                    state = "EXECUTING"                    continue                if decision.kind == "need_approval":                    approval_result = self._request_approval(msg, decision.approval_request or {})                    self._debug("approval", approval_result)                    pending_tool_calls = (decision.approval_request or {}).get("tool_calls", [])                    state = "EXECUTING"                    continue            if state == "EXECUTING":                t_tool_start = time.perf_counter()                tool_results, hard_stop_reason = self._execute(pending_tool_calls, failure_counts=failure_counts)                tool_ms_total += int((time.perf_counter() - t_tool_start) * 1000)                history.extend(tool_results)                if hard_stop_reason:                    final_answer = (                        "工具执行已停止,原因如下:\n"                        f"{hard_stop_reason}\n\n"                        "这类错误通常不应继续自动重试,请你确认权限、allowlist、审批状态或前台节点状态后再继续。"                    )                    break                state = "OBSERVING"                continue            if state == "OBSERVING":                state = "PLANNING"                continue        else:            final_answer = "处理超出最大轮次,请简化问题后重试。"        if final_answer:            history.append({"role""assistant""content": final_answer})        history[:] = self._repair_history(history)        t_memory_start = time.perf_counter()        self.memory_manager.update_memory(user_input, final_answer, user_scope_id=user_scope_id)        self.memory_manager.maybe_update_soul(user_scope_id=user_scope_id)        compacted_history = self.memory_manager.compact_history_if_needed(            history,            max_chars=256000,            user_scope_id=user_scope_id,        )        memory_ms_total += int((time.perf_counter() - t_memory_start) * 1000)        if compacted_history is not history:            new_conversation_id = self._new_conversation_id()            self.session_conversations[session_id] = new_conversation_id            self.session_histories[new_conversation_id] = compacted_history            self.session_histories.pop(conversation_id, None)            conversation_id = new_conversation_id        else:            self.session_histories[conversation_id] = compacted_history        self._debug(            "run_metrics",            f"run_id={run_id} session_id={session_id} conversation_id={conversation_id} "            f"queue_wait_ms={queue_wait_ms} llm_ms={llm_ms_total} tool_ms={tool_ms_total} "            f"memory_ms={memory_ms_total} dedup_key={getattr(msg, 'dedup_key''')}",        )        return {            "session_id": session_id,            "conversation_id": conversation_id,            "user_scope_id": user_scope_id,            "text": final_answer,        }
总而言之这段代码是在干嘛的,我先可以把它抽象为四个流程,其实如果有其他层可以加入,你可以加入你想要的状态
计划 → 执行 → 观察 → 再计划 这就是agent执行的流程 被强制从工程层面执行思考执行的过程,这被称为状态机,fsm,通过这样子的措施,能让ai执行更长时间的任务,更高的正确率,其中也有很多鲁棒性的加入,比如设置最大错误次数,防止ai陷入思考的死路径,例如这种优化可以大大优化用户的体验
第三点就是最后一点 记忆功能
这里就不多赘述了,你可以理解成首先我的对话是短期记忆,他能记录你目前还有什么任务没有完成,长期记忆,当你命令他要记住重要的内容,他就可以把这些重要的信息写入自己的文档里.其中的设计包括上下文过长自动压缩,这些可以留到以后再讲

https://github.com/dsadsasdaddas/privateclaw

这是我的仓库,大家可以借鉴学习,如果有交流可以在评论区里交流

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-04-02 17:05:06 HTTP/2.0 GET : https://f.mffb.com.cn/a/483940.html
  2. 运行时间 : 0.103928s [ 吞吐率:9.62req/s ] 内存消耗:4,974.62kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=159084c314fd6e5342ea73a08ad478b4
  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.000467s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000648s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000304s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000252s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000478s ]
  6. SELECT * FROM `set` [ RunTime:0.000196s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000522s ]
  8. SELECT * FROM `article` WHERE `id` = 483940 LIMIT 1 [ RunTime:0.000919s ]
  9. UPDATE `article` SET `lasttime` = 1775120706 WHERE `id` = 483940 [ RunTime:0.011425s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.000246s ]
  11. SELECT * FROM `article` WHERE `id` < 483940 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000403s ]
  12. SELECT * FROM `article` WHERE `id` > 483940 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000662s ]
  13. SELECT * FROM `article` WHERE `id` < 483940 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.001490s ]
  14. SELECT * FROM `article` WHERE `id` < 483940 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.003249s ]
  15. SELECT * FROM `article` WHERE `id` < 483940 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.014087s ]
0.106407s