function ProcessExecutor::doExecute
Parameters
string|non-empty-list<string> $command:
mixed $output:
2 calls to ProcessExecutor::doExecute()
- ProcessExecutor::execute in vendor/
composer/ composer/ src/ Composer/ Util/ ProcessExecutor.php - runs a process on the commandline
- ProcessExecutor::executeTty in vendor/
composer/ composer/ src/ Composer/ Util/ ProcessExecutor.php - runs a process on the commandline in TTY mode
File
-
vendor/
composer/ composer/ src/ Composer/ Util/ ProcessExecutor.php, line 190
Class
- ProcessExecutor
- @author Robert Schönthal <seroscho@googlemail.com> @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\UtilCode
private function doExecute($command, ?string $cwd, bool $tty, &$output = null) : int {
$this->outputCommandRun($command, $cwd, false);
$this->captureOutput = func_num_args() > 3;
$this->errorOutput = '';
$env = null;
$requiresGitDirEnv = $this->requiresGitDirEnv($command);
if ($cwd !== null && $requiresGitDirEnv) {
$isBareRepository = !is_dir(sprintf('%s/.git', rtrim($cwd, '/')));
if ($isBareRepository) {
$configValue = '';
$this->runProcess([
'git',
'config',
'safe.bareRepository',
], $cwd, [
'GIT_DIR' => $cwd,
], $tty, $configValue);
$configValue = trim($configValue);
if ($configValue === 'explicit') {
$env = [
'GIT_DIR' => $cwd,
];
}
}
}
return $this->runProcess($command, $cwd, $env, $tty, $output);
}