1
0
Fork 0

make dependencies not released be able to cache

pull/624/head
Xiaohui Lam 2018-03-18 00:16:22 +08:00 committed by GitHub
parent 49f1e8f04a
commit 8977c95db6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -151,8 +151,13 @@ class Indexer
// Check if package name matches and version is absolute
// Dynamic constraints are not cached, because they can change every time
$packageVersion = ltrim($package->version, 'v');
if ($package->name === $packageName && strpos($packageVersion, 'dev') === false) {
if ($package->name === $packageName) {
$packageKey = $packageName . ':' . $packageVersion;
if (strpos($packageVersion, 'dev') !== false) {
$packageKey = $packageName . ':' . (isset($package->source) && isset($package->source->reference) ?
$package->source->reference : (isset($package->dist) && isset($package->dist->reference) ?
$package->source->reference : $packageVersion));
}
$cacheKey = self::CACHE_VERSION . ':' . $packageKey;
// Check cache
$index = yield $this->cache->get($cacheKey);