mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
Built-in File Manager (#458)
This commit is contained in:
@ -94,11 +94,7 @@ public function connect(bool $sftp = false): void
|
||||
*/
|
||||
public function exec(string $command, string $log = '', ?int $siteId = null, ?bool $stream = false, ?callable $streamCallback = null): string
|
||||
{
|
||||
if (! $log) {
|
||||
$log = 'run-command';
|
||||
}
|
||||
|
||||
if (! $this->log) {
|
||||
if (! $this->log && $log) {
|
||||
$this->log = ServerLog::make($this->server, $log);
|
||||
if ($siteId) {
|
||||
$this->log->forSite($siteId);
|
||||
@ -122,7 +118,7 @@ public function exec(string $command, string $log = '', ?int $siteId = null, ?bo
|
||||
$this->connection->setTimeout(0);
|
||||
if ($stream) {
|
||||
$this->connection->exec($command, function ($output) use ($streamCallback) {
|
||||
$this->log->write($output);
|
||||
$this->log?->write($output);
|
||||
|
||||
return $streamCallback($output);
|
||||
});
|
||||
@ -131,7 +127,7 @@ public function exec(string $command, string $log = '', ?int $siteId = null, ?bo
|
||||
} else {
|
||||
$output = '';
|
||||
$this->connection->exec($command, function ($out) use (&$output) {
|
||||
$this->log->write($out);
|
||||
$this->log?->write($out);
|
||||
$output .= $out;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user