Submit
Path:
~
/
/
opt
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
wp-cli
/
vendor
/
composer
/
composer
/
src
/
Composer
/
Command
/
File Content:
SuggestsCommand.php
<?php /* * This file is part of Composer. * * (c) Nils Adermann <naderman@naderman.de> * Jordi Boggiano <j.boggiano@seld.be> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Composer\Command; use Composer\Repository\PlatformRepository; use Composer\Repository\RootPackageRepository; use Composer\Repository\InstalledRepository; use Composer\Installer\SuggestedPackagesReporter; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class SuggestsCommand extends BaseCommand { /** * @return void */ protected function configure() { $this ->setName('suggests') ->setDescription('Shows package suggestions.') ->setDefinition(array( new InputOption('by-package', null, InputOption::VALUE_NONE, 'Groups output by suggesting package (default)'), new InputOption('by-suggestion', null, InputOption::VALUE_NONE, 'Groups output by suggested package'), new InputOption('all', 'a', InputOption::VALUE_NONE, 'Show suggestions from all dependencies, including transitive ones'), new InputOption('list', null, InputOption::VALUE_NONE, 'Show only list of suggested package names'), new InputOption('no-dev', null, InputOption::VALUE_NONE, 'Exclude suggestions from require-dev packages'), new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Packages that you want to list suggestions from.'), )) ->setHelp( <<<EOT The <info>%command.name%</info> command shows a sorted list of suggested packages. Read more at https://getcomposer.org/doc/03-cli.md#suggests EOT ) ; } /** * @inheritDoc */ protected function execute(InputInterface $input, OutputInterface $output) { $composer = $this->getComposer(); $installedRepos = array( new RootPackageRepository(clone $composer->getPackage()), ); $locker = $composer->getLocker(); if ($locker->isLocked()) { $installedRepos[] = new PlatformRepository(array(), $locker->getPlatformOverrides()); $installedRepos[] = $locker->getLockedRepository(!$input->getOption('no-dev')); } else { $installedRepos[] = new PlatformRepository(array(), $composer->getConfig()->get('platform') ?: array()); $installedRepos[] = $composer->getRepositoryManager()->getLocalRepository(); } $installedRepo = new InstalledRepository($installedRepos); $reporter = new SuggestedPackagesReporter($this->getIO()); $filter = $input->getArgument('packages'); $packages = $installedRepo->getPackages(); $packages[] = $composer->getPackage(); foreach ($packages as $package) { if (!empty($filter) && !in_array($package->getName(), $filter)) { continue; } $reporter->addSuggestionsFromPackage($package); } // Determine output mode, default is by-package $mode = SuggestedPackagesReporter::MODE_BY_PACKAGE; // if by-suggestion is given we override the default if ($input->getOption('by-suggestion')) { $mode = SuggestedPackagesReporter::MODE_BY_SUGGESTION; } // unless by-package is also present then we enable both if ($input->getOption('by-package')) { $mode |= SuggestedPackagesReporter::MODE_BY_PACKAGE; } // list is exclusive and overrides everything else if ($input->getOption('list')) { $mode = SuggestedPackagesReporter::MODE_LIST; } $reporter->output($mode, $installedRepo, empty($filter) && !$input->getOption('all') ? $composer->getPackage() : null); return 0; } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
AboutCommand.php
1308 bytes
0644
ArchiveCommand.php
7815 bytes
0644
BaseCommand.php
10355 bytes
0644
BaseDependencyCommand.php
9100 bytes
0644
CheckPlatformReqsCommand.php
8009 bytes
0644
ClearCacheCommand.php
2296 bytes
0644
ConfigCommand.php
35185 bytes
0644
CreateProjectCommand.php
24747 bytes
0644
DependsCommand.php
1820 bytes
0644
DiagnoseCommand.php
28887 bytes
0644
DumpAutoloadCommand.php
5285 bytes
0644
ExecCommand.php
3539 bytes
0644
FundCommand.php
5412 bytes
0644
GlobalCommand.php
4007 bytes
0644
HomeCommand.php
5652 bytes
0644
InitCommand.php
45986 bytes
0644
InstallCommand.php
7733 bytes
0644
LicensesCommand.php
7415 bytes
0644
OutdatedCommand.php
5084 bytes
0644
ProhibitsCommand.php
2006 bytes
0644
ReinstallCommand.php
8552 bytes
0644
RemoveCommand.php
14381 bytes
0644
RequireCommand.php
22863 bytes
0644
RunScriptCommand.php
5223 bytes
0644
ScriptAliasCommand.php
2199 bytes
0644
SearchCommand.php
4799 bytes
0644
SelfUpdateCommand.php
26293 bytes
0644
ShowCommand.php
55499 bytes
0644
StatusCommand.php
8495 bytes
0644
SuggestsCommand.php
4081 bytes
0644
UpdateCommand.php
16773 bytes
0644
ValidateCommand.php
11564 bytes
0644
N4ST4R_ID | Naxtarrr