Skip to content

Commit

Permalink
Result cache - invalidate after running composer install
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Feb 6, 2021
1 parent 30ba6b0 commit f11c0f0
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/Analyser/ResultCache/ResultCacheManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class ResultCacheManager
{

private const CACHE_VERSION = 'v5-exportedNodes';
private const CACHE_VERSION = 'v6-installed';

private ExportedNodeFetcher $exportedNodeFetcher;

Expand Down Expand Up @@ -552,6 +552,7 @@ private function getMeta(?array $projectConfigArray): array
'projectConfig' => $projectConfigArray,
'analysedPaths' => $this->analysedPaths,
'composerLocks' => $this->getComposerLocks(),
'composerInstalled' => $this->getComposerInstalled(),
'cliAutoloadFile' => $this->cliAutoloadFile,
'phpExtensions' => $extensions,
'stubFiles' => $this->getStubFiles(),
Expand Down Expand Up @@ -604,6 +605,24 @@ private function getComposerLocks(): array
return $locks;
}

/**
* @return array<string, string>
*/
private function getComposerInstalled(): array
{
$hashes = [];
foreach ($this->composerAutoloaderProjectPaths as $autoloadPath) {
$filePath = $autoloadPath . '/vendor/composer/installed.php';
if (!is_file($filePath)) {
continue;
}

$hashes[$filePath] = $this->getFileHash($filePath);
}

return $hashes;
}

/**
* @return array<string, string>
*/
Expand Down

0 comments on commit f11c0f0

Please sign in to comment.