mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
init
This commit is contained in:
43
app/SSHCommands/CreateCustomSSLCommand.php
Executable file
43
app/SSHCommands/CreateCustomSSLCommand.php
Executable file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\SSHCommands;
|
||||
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
class CreateCustomSSLCommand extends Command
|
||||
{
|
||||
protected $path;
|
||||
|
||||
protected $certificate;
|
||||
|
||||
protected $pk;
|
||||
|
||||
protected $certificatePath;
|
||||
|
||||
protected $pkPath;
|
||||
|
||||
public function __construct($path, $certificate, $pk, $certificatePath, $pkPath)
|
||||
{
|
||||
$this->path = $path;
|
||||
$this->certificate = $certificate;
|
||||
$this->pk = $pk;
|
||||
$this->certificatePath = $certificatePath;
|
||||
$this->pkPath = $pkPath;
|
||||
}
|
||||
|
||||
public function file(string $os): string
|
||||
{
|
||||
return File::get(base_path('system/commands/common/create-custom-ssl.sh'));
|
||||
}
|
||||
|
||||
public function content(string $os): string
|
||||
{
|
||||
$content = $this->file($os);
|
||||
$content = str_replace('__path__', $this->path, $content);
|
||||
$content = str_replace('__certificate__', $this->certificate, $content);
|
||||
$content = str_replace('__pk__', $this->pk, $content);
|
||||
$content = str_replace('__certificate_path__', $this->certificatePath, $content);
|
||||
|
||||
return str_replace('__pk_path__', $this->pkPath, $content);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user