1
0
Fork 0

Allow depend command to show results for platform packages, fixes #3836, fixes #4696

pull/4696/merge
Jordi Boggiano 2016-01-09 17:21:01 +00:00
parent fd7267e4ad
commit dbe7f34181
1 changed files with 3 additions and 0 deletions

View File

@ -17,6 +17,7 @@ use Composer\Package\Link;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Repository\ArrayRepository; use Composer\Repository\ArrayRepository;
use Composer\Repository\CompositeRepository; use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
use Composer\Plugin\CommandEvent; use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents; use Composer\Plugin\PluginEvents;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
@ -61,9 +62,11 @@ EOT
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'depends', $input, $output); $commandEvent = new CommandEvent(PluginEvents::COMMAND, 'depends', $input, $output);
$composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent); $composer->getEventDispatcher()->dispatch($commandEvent->getName(), $commandEvent);
$platformOverrides = $composer->getConfig()->get('platform') ?: array();
$repo = new CompositeRepository(array( $repo = new CompositeRepository(array(
new ArrayRepository(array($composer->getPackage())), new ArrayRepository(array($composer->getPackage())),
$composer->getRepositoryManager()->getLocalRepository(), $composer->getRepositoryManager()->getLocalRepository(),
new PlatformRepository(array(), $platformOverrides),
)); ));
$needle = $input->getArgument('package'); $needle = $input->getArgument('package');