Skip to content

Commit 4c7fdee

Browse files
committed
Merge branch 'feature/caching-invalidate-on-different-loaded-extensions' of https://github.com/jrfnl/PHP_CodeSniffer
2 parents c367695 + 3b7ec02 commit 4c7fdee

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/Util/Cache.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,16 +143,18 @@ function ($file, $key, $iterator) {
143143
// Along with the code hash, use various settings that can affect
144144
// the results of a run to create a new hash. This hash will be used
145145
// in the cache file name.
146-
$rulesetHash = md5(var_export($ruleset->ignorePatterns, true).var_export($ruleset->includePatterns, true));
147-
$configData = [
148-
'phpVersion' => PHP_VERSION_ID,
149-
'tabWidth' => $config->tabWidth,
150-
'encoding' => $config->encoding,
151-
'recordErrors' => $config->recordErrors,
152-
'annotations' => $config->annotations,
153-
'configData' => Config::getAllConfigData(),
154-
'codeHash' => $codeHash,
155-
'rulesetHash' => $rulesetHash,
146+
$rulesetHash = md5(var_export($ruleset->ignorePatterns, true).var_export($ruleset->includePatterns, true));
147+
$phpExtensionsHash = md5(var_export(get_loaded_extensions(), true));
148+
$configData = [
149+
'phpVersion' => PHP_VERSION_ID,
150+
'phpExtensions' => $phpExtensionsHash,
151+
'tabWidth' => $config->tabWidth,
152+
'encoding' => $config->encoding,
153+
'recordErrors' => $config->recordErrors,
154+
'annotations' => $config->annotations,
155+
'configData' => Config::getAllConfigData(),
156+
'codeHash' => $codeHash,
157+
'rulesetHash' => $rulesetHash,
156158
];
157159

158160
$configString = var_export($configData, true);

0 commit comments

Comments
 (0)