mingalevme / opcache-status-info
PHP OPcache status information object
1.0.1
2021-07-12 12:09 UTC
Requires
- php: >=7.4
Requires (Dev)
- phpstan/phpstan: ^0.12.92
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
- vimeo/psalm: ^4.8
This package is auto-updated.
Last update: 2024-11-29 06:22:56 UTC
README
The PHP opcache_get_status
-function result wrapper.
Installation
composer require mingalevme/opcache-status-info
Usage
# some bootstrap file use Mingalevme\OpcacheStatusInfo\Fetcher as OpcacheStatusInfoFetcher; use Mingalevme\OpcacheStatusInfo\Fetcher\OpcacheGetStatusFetcher; $fetcher = new OpcacheGetStatusFetcher(); $someDIContainer->bind(OpcacheStatusInfoFetcher::class, function() use ($fetcher): OpcacheStatusInfoFetcher { return $fetcher; });
# some app file use Mingalevme\OpcacheStatusInfo\Fetcher; use Mingalevme\OpcacheStatusInfo\OpcacheStatusScriptInfo; /** @var Fetcher $fetcher */ $fetcher = $someDIContainer->get(Fetcher::class); $opcacheStatusInfo = $fetcher->fetch(); echo $opcacheStatusInfo->isEnabled(); /** @var OpcacheStatusScriptInfo $opcacheStatusScriptInfo */ foreach ($opcacheStatusInfo->getScripts() as $opcacheStatusScriptInfo) { echo $opcacheStatusScriptInfo->getFullPath(); }