mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
added FTP support to storage providers (#58)
* added FTP support to storage providers * build and code style fix
This commit is contained in:
40
app/SSHCommands/Storage/UploadToFTPCommand.php
Normal file
40
app/SSHCommands/Storage/UploadToFTPCommand.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSHCommands\Storage;
|
||||
|
||||
use App\SSHCommands\Command;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
class UploadToFTPCommand 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/upload-to-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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user