public function getCommandsToExec($command, $composerArgs, $projects, $options)
{
$execPath = $options['composer-path'];
// If command was not 'global require', 'global update' or
// 'global remove', then call through to the standard composer
// with all of the original args.
if (empty($command)) {
return array(new CommandToExec($execPath, $composerArgs));
}
// Call requireCommand, updateCommand, or removeCommand, as appropriate.
$methodName = "{$command}Command";
if (method_exists($this, $methodName)) {
return $this->{$methodName}($execPath, $composerArgs, $projects, $options);
} else {
// If there is no specific implementation for the requested command, then call 'generalCommand'.
return $this->generalCommand($command, $execPath, $composerArgs, $projects, $options);
}
}