Skip to content

Commit

Permalink
Simplify Opcache enabled check
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasnetau committed Jun 29, 2023
1 parent 41b7f5b commit 2f36140
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions src/Scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,8 @@ protected function restoreState() : void
*/
public function run() : void
{
if (!$this->isOpcacheEnabled())
{
/** Opcache is disabled if either the extension isn't loaded or opcache_get_status returns false */
if (!(function_exists('opcache_get_status') && opcache_get_status(false) !== false)) {
$this->logger->warning("*** Opcache is not enabled. This will reduce performance and increase memory usage ***");
}

Expand Down Expand Up @@ -1220,20 +1220,6 @@ protected function memoryReclaim() : void {
}
}

/**
* @return bool
*/
protected function isOpcacheEnabled() : bool
{
if (function_exists('opcache_get_status'))
{
$status = opcache_get_status(false);

return (false !== $status);
}
return false;
}

/**
* Enable or disable the experimental management server
* @param bool $enable
Expand Down

0 comments on commit 2f36140

Please sign in to comment.