mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-20 10:21:37 +00:00
* Allow editing of backups * pint updates * setup of backup download * allow download for local backup files * delete uploaded files on delete of BackupFile * pint updates * S3 upload & download fixes * Deletion of backup files * support $ARCH selector for s3 installation * delete files when deleting backup * fixed ui issue * adjustment * Use system temp path for downloads --------- Co-authored-by: Saeed Vaziry <mr.saeedvaziry@gmail.com>
44 lines
932 B
PHP
44 lines
932 B
PHP
<?php
|
|
|
|
namespace App\SSH\Storage;
|
|
|
|
use App\SSH\HasScripts;
|
|
|
|
class Local extends AbstractStorage
|
|
{
|
|
use HasScripts;
|
|
|
|
public function upload(string $src, string $dest): array
|
|
{
|
|
$destDir = dirname($dest);
|
|
$this->server->ssh()->exec(
|
|
$this->getScript('local/upload.sh', [
|
|
'src' => $src,
|
|
'dest_dir' => $destDir,
|
|
'dest_file' => $dest,
|
|
]),
|
|
'upload-to-local'
|
|
);
|
|
|
|
return [
|
|
'size' => null,
|
|
];
|
|
}
|
|
|
|
public function download(string $src, string $dest): void
|
|
{
|
|
$this->server->ssh()->exec(
|
|
$this->getScript('local/download.sh', [
|
|
'src' => $src,
|
|
'dest' => $dest,
|
|
]),
|
|
'download-from-local'
|
|
);
|
|
}
|
|
|
|
public function delete(string $src): void
|
|
{
|
|
$this->server->os()->deleteFile($src);
|
|
}
|
|
}
|