Skip to content

Commit

Permalink
Merge pull request #11222 from vimeo/tweak_default_opcache_opts
Browse files Browse the repository at this point in the history
Improve default opcache options
  • Loading branch information
danog authored Jan 30, 2025
2 parents 9e4c72b + 468e3ff commit b68145b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/Psalm/Internal/Fork/PsalmRestarter.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ final class PsalmRestarter extends XdebugHandler
{
public const MIN_PHP_VERSION_WINDOWS_JIT = 8_04_03;
private const REQUIRED_OPCACHE_SETTINGS = [
'enable' => 1,
'enable_cli' => 1,
'jit' => 1205,
'validate_timestamps' => 0,
Expand All @@ -51,6 +52,7 @@ final class PsalmRestarter extends XdebugHandler
'optimization_level' => '0x7FFEBFFF',
'preload' => '',
'log_verbosity_level' => 0,
'save_comments' => 1,
];

private bool $required = false;
Expand Down Expand Up @@ -103,11 +105,6 @@ protected function requiresRestart($default): bool
}
}

// opcache.save_comments is required for json mapper (used in language server) to work
if ($opcache_loaded && in_array(ini_get('opcache.save_comments'), ['0', 'false', 0, false])) {
return true;
}

return $default || $this->required;
}

Expand Down Expand Up @@ -174,10 +171,6 @@ protected function restart($command): void
}
}

if ($opcache_loaded) {
$additional_options[] = '-dopcache.save_comments=1';
}

array_splice(
$command,
1,
Expand Down

0 comments on commit b68145b

Please sign in to comment.