Final Class Yiisoft\Yii\Debug\Api\Inspector\Controller\OpcacheController
| Inheritance | Yiisoft\ |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| index() | Yiisoft\ |
Method Details
| public mixed __construct ( \ | ||
| $responseFactory | \ |
|
public function __construct(
private DataResponseFactoryInterface $responseFactory,
) {}
| public \ |
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(),
]);
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.