diff --git a/config/routes.php b/config/routes.php index 95323cf..68cc336 100644 --- a/config/routes.php +++ b/config/routes.php @@ -15,6 +15,7 @@ use Yiisoft\Yii\Debug\Api\Inspector\Controller\ComposerController; use Yiisoft\Yii\Debug\Api\Inspector\Controller\GitController; use Yiisoft\Yii\Debug\Api\Inspector\Controller\InspectController; +use Yiisoft\Yii\Debug\Api\Inspector\Controller\OpcacheController; use Yiisoft\Yii\Middleware\CorsAllowAll; use Yiisoft\Yii\Middleware\IpFilter; @@ -171,5 +172,12 @@ static function (ResponseFactoryInterface $responseFactory, ValidatorInterface $ ->action([CacheController::class, 'clear']) ->name('/clear'), ), + Group::create('/opcache') + ->namePrefix('opcache') + ->routes( + Route::get('[/]') + ->action([OpcacheController::class, 'index']) + ->name('/index'), + ), ), ]; diff --git a/src/Inspector/Controller/OpcacheController.php b/src/Inspector/Controller/OpcacheController.php new file mode 100644 index 0000000..dbfa68a --- /dev/null +++ b/src/Inspector/Controller/OpcacheController.php @@ -0,0 +1,26 @@ +responseFactory->createResponse([ + 'status' => opcache_get_status(true), + 'configuration' => opcache_get_configuration(), + ]); + } +}