diff --git a/src/Checks/OpCacheCheck.php b/src/Checks/OpCacheCheck.php new file mode 100644 index 0000000..32ef75b --- /dev/null +++ b/src/Checks/OpCacheCheck.php @@ -0,0 +1,31 @@ +opCacheIsRunning()) { + return $result->failed('OpCache is not running.'); + } + + return $result->ok('OpCache is running.'); + } + + protected function opCacheIsRunning(): bool + { + if (! function_exists('opcache_get_status')) { + return false; + } + + $configuration = opcache_get_status(); + + return $configuration['opcache_enabled'] ?? false; + } +}