0 follower

Final Class Yiisoft\Yii\Debug\Api\Inspector\Controller\OpcacheController

InheritanceYiisoft\Yii\Debug\Api\Inspector\Controller\OpcacheController

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( \Yiisoft\DataResponse\DataResponseFactoryInterface $responseFactory )
$responseFactory \Yiisoft\DataResponse\DataResponseFactoryInterface

                public function __construct(
    private DataResponseFactoryInterface $responseFactory,
) {
}

            
index() public method

public \Psr\Http\Message\ResponseInterface index ( )

                public function index(): ResponseInterface
{
    if (!\function_exists('opcache_get_status') || ($status = \opcache_get_status(true)) === false) {
        return $this->responseFactory->createResponse([
            'message' => 'OPcache is not installed or configured',
        ], Status::UNPROCESSABLE_ENTITY);
    }
    return $this->responseFactory->createResponse([
        'status' => $status,
        'configuration' => \opcache_get_configuration(),
    ]);
}