mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-02-14 15:39:37 -06:00
Apply fixes from StyleCI
[ci skip] [skip ci]
This commit is contained in:
@@ -13,33 +13,33 @@
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
use \ZipArchive;
|
||||
use ZipArchive;
|
||||
|
||||
class BackupEncryption
|
||||
{
|
||||
/**
|
||||
* Default encryption contants
|
||||
* Default encryption contants.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const ENCRYPTION_DEFAULT = ZipArchive::EM_AES_128;
|
||||
|
||||
/**
|
||||
* AES-128 encryption contants
|
||||
* AES-128 encryption contants.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const ENCRYPTION_WINZIP_AES_128 = ZipArchive::EM_AES_128;
|
||||
|
||||
/**
|
||||
* AES-192 encryption contants
|
||||
* AES-192 encryption contants.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const ENCRYPTION_WINZIP_AES_192 = ZipArchive::EM_AES_192;
|
||||
|
||||
/**
|
||||
* AES-256 encryption contants
|
||||
* AES-256 encryption contants.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
namespace App\Helpers;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use \ZipArchive;
|
||||
use ZipArchive;
|
||||
|
||||
class BackupPassword
|
||||
{
|
||||
@@ -33,16 +33,16 @@ class BackupPassword
|
||||
protected $password;
|
||||
|
||||
/**
|
||||
* Read the .zip, apply password and encryption, then rewrite the file
|
||||
* Read the .zip, apply password and encryption, then rewrite the file.
|
||||
*
|
||||
* @param string $path
|
||||
* @param string $path
|
||||
*/
|
||||
public function __construct(string $path)
|
||||
{
|
||||
$this->password = \config('backup.security.password');
|
||||
|
||||
// If no password is set, just return the backup-path
|
||||
if (!$this->password) {
|
||||
if (! $this->password) {
|
||||
return $this->path = $path;
|
||||
}
|
||||
|
||||
@@ -54,15 +54,15 @@ class BackupPassword
|
||||
}
|
||||
|
||||
/**
|
||||
* Use native PHP ZipArchive
|
||||
* Use native PHP ZipArchive.
|
||||
*
|
||||
* @return void
|
||||
* @return void
|
||||
*/
|
||||
protected function makeZip(string $path): void
|
||||
{
|
||||
$encryption = \config('backup.security.encryption');
|
||||
|
||||
$zipArchive = new ZipArchive;
|
||||
$zipArchive = new ZipArchive();
|
||||
|
||||
$zipArchive->open($path, ZipArchive::OVERWRITE);
|
||||
$zipArchive->addFile($path, 'backup.zip');
|
||||
|
||||
@@ -19,12 +19,13 @@ use Spatie\Backup\Events\BackupZipWasCreated;
|
||||
class PasswordProtectBackup
|
||||
{
|
||||
/**
|
||||
* Handle the event.s
|
||||
* Handle the event.s.
|
||||
*
|
||||
* @param \Spatie\Backup\Events\BackupZipWasCreated $event
|
||||
*
|
||||
* @param \Spatie\Backup\Events\BackupZipWasCreated $event
|
||||
* @return string
|
||||
*/
|
||||
public function handle(BackupZipWasCreated $event) : string
|
||||
public function handle(BackupZipWasCreated $event): string
|
||||
{
|
||||
return (new BackupPassword($event->pathToZip))->path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user