Final Class Yiisoft\Yii\Debug\Api\Inspector\Controller\OpcacheController
| Inheritance | Yiisoft\Yii\Debug\Api\Inspector\Controller\OpcacheController |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Yii\Debug\Api\Inspector\Controller\OpcacheController | |
| index() | Yiisoft\Yii\Debug\Api\Inspector\Controller\OpcacheController |
Method Details
| public mixed __construct ( \Yiisoft\DataResponse\DataResponseFactoryInterface $responseFactory ) | ||
| $responseFactory | \Yiisoft\DataResponse\DataResponseFactoryInterface | |
public function __construct(
private DataResponseFactoryInterface $responseFactory,
) {
}
| 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(),
]);
}
Signup or Login in order to comment.