Change the content hash to be only based on values that affect dependency resolution
parent
50b560fe4c
commit
3e0219c438
|
@ -496,7 +496,26 @@ class Factory
|
||||||
private function getContentHash($composerFilePath)
|
private function getContentHash($composerFilePath)
|
||||||
{
|
{
|
||||||
$content = json_decode(file_get_contents($composerFilePath), true);
|
$content = json_decode(file_get_contents($composerFilePath), true);
|
||||||
ksort($content);
|
|
||||||
return md5(json_encode($content));
|
$relevantKeys = array(
|
||||||
|
'require',
|
||||||
|
'require-dev',
|
||||||
|
'conflict',
|
||||||
|
'replace',
|
||||||
|
'provide',
|
||||||
|
'suggest',
|
||||||
|
'minimum-stability',
|
||||||
|
'prefer-stable',
|
||||||
|
'repositories',
|
||||||
|
);
|
||||||
|
|
||||||
|
$relevantContent = array();
|
||||||
|
|
||||||
|
foreach (array_intersect($relevantKeys, array_keys($content)) as $key) {
|
||||||
|
$relevantContent[$key] = $content[$key];
|
||||||
|
}
|
||||||
|
|
||||||
|
ksort($relevantContent);
|
||||||
|
return md5(json_encode($relevantContent));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue