Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
feature symfony#464 Added support for recipes conflict (HeahDude)
This PR was merged into the 1.2-dev branch.

Discussion
----------

Added support for recipes conflict

Allows to ignore incompatible recipes, helpful to avoid breaking apps using FrameworkBundle LTS versions.

![flex_conflict](https://user-images.githubusercontent.com/10107633/50301402-803ba780-0487-11e9-87f5-55a2a37591ee.jpeg)

Unlocks symfony/recipes#506.

We need to update the Symfony bot to allow the `conflict` key in the `manifest.json`, ping @fabpot :).

Commits
-------

7ae43a1 Added support for recipes conflict
  • Loading branch information
fabpot committed Jan 6, 2019
2 parents 48438c2 + 7ae43a1 commit 670df54
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Flex.php
Expand Up @@ -587,6 +587,18 @@ private function fetchRecipes(): array
$name = $package->getNames()[0];
$job = $operation->getJobType();

if (!empty($manifests[$name]['manifest']['conflict']) && !$operation instanceof UninstallOperation) {
$lockedRepository = $this->composer->getLocker()->getLockedRepository();

foreach ($manifests[$name]['manifest']['conflict'] as $conflictingPackage => $constraint) {
if ($lockedRepository->findPackage($conflictingPackage, $constraint)) {
$this->io->writeError(sprintf(' - Skipping recipe for %s: it conflicts with %s %s.', $name, $conflictingPackage, $constraint), true, IOInterface::VERBOSE);

continue 2;
}
}
}

if ($operation instanceof InstallOperation && isset($locks[$name])) {
$ref = $this->lock->get($name)['recipe']['ref'] ?? null;
if ($ref && ($locks[$name]['recipe']['ref'] ?? null) === $ref) {
Expand Down

0 comments on commit 670df54

Please sign in to comment.