diff --git a/composer.json b/composer.json index dd7c7ba..4dd1347 100644 --- a/composer.json +++ b/composer.json @@ -35,7 +35,8 @@ "moonlandsoft/yii2-phpexcel": "2.*", "ext-bcmath": "*", "ext-openssl": "*", - "ext-redis": "*" + "ext-redis": "*", + "ext-zend-opcache": "*" }, "require-dev": { "yiisoft/yii2-debug": "~2.1.0", diff --git a/web/index.php b/web/index.php index 2e9eba3..5f25aa1 100644 --- a/web/index.php +++ b/web/index.php @@ -18,5 +18,8 @@ $config = yii\helpers\ArrayHelper::merge( if ($_GET['test']?? '' === 'liqi') { print_r(get_device_type());die; +} elseif($_GET['test']?? '' === 'restartOp') { + $result = opcache_reset(); + echo $result ? 'OPcache 已重置' : 'OPcache 重置失败'; } (new \common\core\WebApplication($config))->run();