From 34685ead22301b5e8ebfb11e1dec8cbb9a5f22ef Mon Sep 17 00:00:00 2001 From: dongzhiyong Date: Tue, 23 Dec 2025 14:39:55 +0800 Subject: [PATCH] a --- Scanner.php | 6 ++++-- composer.json | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Scanner.php b/Scanner.php index 5480c37..d86ca0b 100644 --- a/Scanner.php +++ b/Scanner.php @@ -82,8 +82,10 @@ class Scanner extends Component private function load_file(string $path): void { try { - opcache_invalidate($path); - opcache_compile_file($path); + if (function_exists('opcache_invalidate') && function_exists('opcache_compile_file')) { + opcache_invalidate($path); + opcache_compile_file($path); + } require_once "$path"; if (!isset($_SERVER['PWD'])) { diff --git a/composer.json b/composer.json index 29dd6c5..f91c95f 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ "license": "MIT", "require": { "php": ">=8.4", - "psr/container": "^2.0" + "psr/container": "^2.0", + "ext-zend-opcache": "*" }, "version": "v2.17", "autoload": {