mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 18:01:37 +00:00
27 lines
655 B
PHP
27 lines
655 B
PHP
<?php
|
|
|
|
namespace App\SSHCommands\Database;
|
|
|
|
use App\SSHCommands\Command;
|
|
use Illuminate\Support\Facades\File;
|
|
|
|
class RestoreDatabaseCommand extends Command
|
|
{
|
|
public function __construct(protected string $provider, protected string $database, protected string $fileName)
|
|
{
|
|
}
|
|
|
|
public function file(): string
|
|
{
|
|
return File::get(resource_path(sprintf("commands/database/%s/restore.sh", $this->provider)));
|
|
}
|
|
|
|
public function content(): string
|
|
{
|
|
return str($this->file())
|
|
->replace('__database__', $this->database)
|
|
->replace('__file__', $this->fileName)
|
|
->toString();
|
|
}
|
|
}
|