mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
test
This commit is contained in:
@ -34,7 +34,7 @@ public function connect(bool $sftp = false): void
|
||||
}
|
||||
}
|
||||
|
||||
public function exec(string|array $commands, string $log = '', ?int $siteId = null, ?bool $stream = false): string
|
||||
public function exec(string $command, string $log = '', ?int $siteId = null, ?bool $stream = false): string
|
||||
{
|
||||
if ($log) {
|
||||
$this->setLog($log, $siteId);
|
||||
@ -42,21 +42,19 @@ public function exec(string|array $commands, string $log = '', ?int $siteId = nu
|
||||
$this->log = null;
|
||||
}
|
||||
|
||||
if (! is_array($commands)) {
|
||||
$commands = [$commands];
|
||||
}
|
||||
|
||||
foreach ($commands as $command) {
|
||||
if (is_string($command)) {
|
||||
$this->commands[] = $command;
|
||||
} else {
|
||||
$this->commands[] = get_class($command);
|
||||
}
|
||||
}
|
||||
$this->commands[] = $command;
|
||||
|
||||
$output = $this->output ?? 'fake output';
|
||||
$this->log?->write($output);
|
||||
|
||||
if ($stream) {
|
||||
echo $output;
|
||||
ob_flush();
|
||||
flush();
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user