function BaseCommand::tryComposer
Retrieves the default Composer\Composer instance or null
Use this instead of getComposer(false)
Parameters
bool|null $disablePlugins If null, reads --no-plugins as default:
bool|null $disableScripts If null, reads --no-scripts as default:
11 calls to BaseCommand::tryComposer()
- ArchiveCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ ArchiveCommand.php - Executes the current command.
- ArchiveCommand::selectPackage in vendor/
composer/ composer/ src/ Composer/ Command/ ArchiveCommand.php - BaseCommand::getComposer in vendor/
composer/ composer/ src/ Composer/ Command/ BaseCommand.php - BaseCommand::initialize in vendor/
composer/ composer/ src/ Composer/ Command/ BaseCommand.php - @inheritDoc
- ClearCacheCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ ClearCacheCommand.php - Executes the current command.
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ BaseCommand.php, line 122
Class
- BaseCommand
- Base class for Composer commands
Namespace
Composer\CommandCode
public function tryComposer(?bool $disablePlugins = null, ?bool $disableScripts = null) : ?Composer {
if (null === $this->composer) {
$application = parent::getApplication();
if ($application instanceof Application) {
$this->composer = $application->getComposer(false, $disablePlugins, $disableScripts);
}
}
return $this->composer;
}