function BaseCommand::createComposerInstance
Calls {
Parameters
mixed $config either a configuration array or a filename to read from, if null it will read from: the default filename
Return value
See also
Factory::create()} with the given arguments, taking into account flags and default states for disabling scripts and plugins
4 calls to BaseCommand::createComposerInstance()
- CreateProjectCommand::installProject in vendor/
composer/ composer/ src/ Composer/ Command/ CreateProjectCommand.php - CreateProjectCommand::installRootPackage in vendor/
composer/ composer/ src/ Composer/ Command/ CreateProjectCommand.php - SearchCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ SearchCommand.php - Executes the current command.
- ValidateCommand::execute in vendor/
composer/ composer/ src/ Composer/ Command/ ValidateCommand.php - Executes the current command.
File
-
vendor/
composer/ composer/ src/ Composer/ Command/ BaseCommand.php, line 299
Class
- BaseCommand
- Base class for Composer commands
Namespace
Composer\CommandCode
protected function createComposerInstance(InputInterface $input, IOInterface $io, $config = null, ?bool $disablePlugins = null, ?bool $disableScripts = null) : Composer {
$disablePlugins = $disablePlugins === true || $input->hasParameterOption('--no-plugins');
$disableScripts = $disableScripts === true || $input->hasParameterOption('--no-scripts');
$application = parent::getApplication();
if ($application instanceof Application && $application->getDisablePluginsByDefault()) {
$disablePlugins = true;
}
if ($application instanceof Application && $application->getDisableScriptsByDefault()) {
$disableScripts = true;
}
return Factory::create($io, $config, $disablePlugins, $disableScripts);
}