Fix forcing of the source-ref from lock file
parent
4233a4823d
commit
c95b4d05fd
|
@ -236,9 +236,11 @@ EOT
|
|||
$package = $operation->getPackage();
|
||||
}
|
||||
if ($package && $package->isDev()) {
|
||||
foreach ($composer->getLocker()->getLockedPackages() as $lockedPackage) {
|
||||
$lockData = $composer->getLocker()->getLockData();
|
||||
foreach ($lockData['packages'] as $lockedPackage) {
|
||||
if (!empty($lockedPackage['source-reference']) && strtolower($lockedPackage['package']) === $package->getName()) {
|
||||
$package->setSourceReference($lockedPackage['source-reference']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,11 +69,7 @@ class Locker
|
|||
*/
|
||||
public function getLockedPackages()
|
||||
{
|
||||
if (!$this->isLocked()) {
|
||||
throw new \LogicException('No lockfile found. Unable to read locked packages');
|
||||
}
|
||||
|
||||
$lockList = $this->lockFile->read();
|
||||
$lockList = $this->getLockData();
|
||||
$packages = array();
|
||||
foreach ($lockList['packages'] as $info) {
|
||||
$package = $this->repositoryManager->getLocalRepository()->findPackage($info['package'], $info['version']);
|
||||
|
@ -95,6 +91,15 @@ class Locker
|
|||
return $packages;
|
||||
}
|
||||
|
||||
public function getLockData()
|
||||
{
|
||||
if (!$this->isLocked()) {
|
||||
throw new \LogicException('No lockfile found. Unable to read locked packages');
|
||||
}
|
||||
|
||||
return $this->lockFile->read();
|
||||
}
|
||||
|
||||
/**
|
||||
* Locks provided packages into lockfile.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue