diff --git a/gh_api.php b/gh_api.php index e84e71f..0b46677 100644 --- a/gh_api.php +++ b/gh_api.php @@ -19,6 +19,13 @@ if (!defined('GH_TICKET_PREFIX')) { define('GH_TICKET_PREFIX', '[工单#'); // 后接 id + "] " } +// ★ 15m44v: 库文件自失效 —— 每次被 require 时 invalidate 自身 OPcache 副本。 +// 部署 gh_api.php 后,只要任一入口(ticket.php/gh_oauth.php)再 require 一次, +// 就强制重读磁盘新版,避免旧版常驻 OPcache 导致新逻辑(占位符替换/ghLog 路径/ +// Cache-Control 头)不生效。入口顶部已有 opcache_invalidate(__FILE__),但库文件 +// 需自失效自身路径,双保险。 +if (function_exists('opcache_invalidate')) { @opcache_invalidate(__FILE__, true); } + /** 取 img.json 的 GitHub 配置(懒重载) */ function ghGetCfg() { return loadImgJson();