Skip to content

Commit

Permalink
Update Unpacker.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemorroj authored and fabpot committed Jul 15, 2020
1 parent 5fedaf8 commit 8019d06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Unpacker.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ public function updateLock(Result $result, IOInterface $io): void
}
}
}
$jsonContent = file_get_contents($json->getPath());
$lockData['packages'] = array_values($lockData['packages']);
$lockData['packages-dev'] = array_values($lockData['packages-dev']);
$lockData['content-hash'] = $locker->getContentHash(file_get_contents($json->getPath()));
$lockData['content-hash'] = $locker->getContentHash($jsonContent);
$lockFile = new JsonFile(substr($json->getPath(), 0, -4).'lock', null, $io);

if (!$this->dryRun) {
Expand All @@ -144,9 +145,9 @@ public function updateLock(Result $result, IOInterface $io): void

// force removal of files under vendor/
if (version_compare('2.0.0', PluginInterface::PLUGIN_API_VERSION, '>')) {
$locker = new Locker($io, $lockFile, $this->composer->getRepositoryManager(), $this->composer->getInstallationManager(), file_get_contents($json->getPath()));
$locker = new Locker($io, $lockFile, $this->composer->getRepositoryManager(), $this->composer->getInstallationManager(), $jsonContent);
} else {
$locker = new Locker($io, $lockFile, $this->composer->getInstallationManager(), file_get_contents($json->getPath()));
$locker = new Locker($io, $lockFile, $this->composer->getInstallationManager(), $jsonContent);
}
$this->composer->setLocker($locker);
}
Expand Down

0 comments on commit 8019d06

Please sign in to comment.