mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
Plugins base (#613)
* wip * wip * cleanup * notification channels * phpstan * services * remove server types * refactoring * refactoring
This commit is contained in:
@ -4,7 +4,10 @@
|
||||
|
||||
use App\Actions\Database\ManageBackupFile;
|
||||
use App\Enums\BackupFileStatus;
|
||||
use App\Enums\StorageProvider as StorageProviderAlias;
|
||||
use App\StorageProviders\Dropbox;
|
||||
use App\StorageProviders\FTP;
|
||||
use App\StorageProviders\Local;
|
||||
use App\StorageProviders\S3;
|
||||
use Carbon\Carbon;
|
||||
use Database\Factories\BackupFileFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@ -81,7 +84,7 @@ public function isAvailable(): bool
|
||||
|
||||
public function isLocal(): bool
|
||||
{
|
||||
return $this->backup->storage->provider === StorageProviderAlias::LOCAL;
|
||||
return $this->backup->storage->provider === Local::id();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,8 +106,8 @@ public function path(): string
|
||||
$databaseName = $this->backup->database->name;
|
||||
|
||||
return match ($storage->provider) {
|
||||
StorageProviderAlias::DROPBOX => '/'.$databaseName.'/'.$this->name.'.zip',
|
||||
StorageProviderAlias::S3, StorageProviderAlias::FTP, StorageProviderAlias::LOCAL => implode('/', [
|
||||
Dropbox::id() => '/'.$databaseName.'/'.$this->name.'.zip',
|
||||
S3::id(), FTP::id(), Local::id() => implode('/', [
|
||||
rtrim((string) $storage->credentials['path'], '/'),
|
||||
$databaseName,
|
||||
$this->name.'.zip',
|
||||
|
Reference in New Issue
Block a user