Skip to content

Commit

Permalink
Merge pull request #42 from jijoel/bug-conflict
Browse files Browse the repository at this point in the history
Fix issue with non-components using "component" flag in json
  • Loading branch information
RobLoach committed Aug 28, 2013
2 parents df50822 + 89b0cb5 commit eb76ddb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ComponentInstaller/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,24 @@ public function init()
}

// Get the available packages.
$allPackages = array();
$locker = $this->composer->getLocker();
if (isset($locker)) {
$lockData = $locker->getLockData();
$this->packages = isset($lockData['packages']) ? $lockData['packages'] : array();
$allPackages = isset($lockData['packages']) ? $lockData['packages'] : array();

// Also merge in any of the development packages.
$dev = isset($lockData['packages-dev']) ? $lockData['packages-dev'] : array();
foreach ($dev as $package) {
$allPackages[] = $package;
}
}

// Only add those packages that we can reasonably
// assume are components into our packages list
foreach ($allPackages as $package) {
$extra = isset($package['extra']) ? $package['extra'] : array();
if (isset($extra['component']) && is_array($extra['component'])) {
$this->packages[] = $package;
}
}
Expand Down

0 comments on commit eb76ddb

Please sign in to comment.