mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-21 19:01:37 +00:00
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\SSHCommands\Storage;
|
|
|
|
use App\SSHCommands\Command;
|
|
use Illuminate\Support\Facades\File;
|
|
|
|
class DownloadFromFTPCommand extends Command
|
|
{
|
|
public function __construct(
|
|
protected string $src,
|
|
protected string $dest,
|
|
protected string $host,
|
|
protected string $port,
|
|
protected string $username,
|
|
protected string $password,
|
|
protected bool $ssl,
|
|
protected bool $passive,
|
|
) {
|
|
}
|
|
|
|
public function file(): string
|
|
{
|
|
return File::get(resource_path('commands/storage/download-from-ftp.sh'));
|
|
}
|
|
|
|
public function content(): string
|
|
{
|
|
return str($this->file())
|
|
->replace('__src__', $this->src)
|
|
->replace('__dest__', $this->dest)
|
|
->replace('__host__', $this->host)
|
|
->replace('__port__', $this->port)
|
|
->replace('__username__', $this->username)
|
|
->replace('__password__', $this->password)
|
|
->replace('__ssl__', $this->ssl ? 's' : '')
|
|
->replace('__passive__', $this->passive ? '--ftp-pasv' : '')
|
|
->toString();
|
|
}
|
|
}
|