olssonm / laravel-backup-shield

🔒Password protection (and encryption) for your laravel backups.
MIT License
32 stars 5 forks source link

Laravel 6.0 Support #10

Closed Ekion-1 closed 5 years ago

Ekion-1 commented 5 years ago

Are there plans to update this to Laravel 6.0? It doesn't look like there are any breaking changes, so a simple update to the composer.json should suffice.

Ekion-1 commented 5 years ago

Created PR https://github.com/olssonm/laravel-backup-shield/pull/11

olssonm commented 5 years ago

Hi! Thanks!

Of course it'll get updated – just haven't had the time just yet =) Your PR should work as you say, will just run an additional test. Will have a new release up tomorrow (European time) – will notify you then.

olssonm commented 5 years ago

Hey again @AlexGodbehere. Published a new release, v3.0.

Feel free to test it out; composer require olssonm/laravel-backup-shield "~3.0". After that feel free to close the issue =)

Ekion-1 commented 5 years ago

I'm getting an out of memory error and I'm not convinced that it's picking up the config file. I'll keep investigating.

olssonm commented 5 years ago

That seems odd =/ Have you read about the memory limitations under "Important information regarding encryption" in the docs?

What encryption method are your trying to use? And I'm guessing Laravel 6 on PHP7.2?

Ekion-1 commented 5 years ago

Yes, running Laravel 6 on PHP7.2.22. I'm running ENCRYPTION_WINZIP_AES_256 encryption, but this issue started happening when I realised that I accidentally deleted my config file. I've modified the package locally to print out the encryption type being used because when I last had this issue here the config file wasn't being committed. I've just tried to increase the RAM to 2GB but I'm still getting the error, so I'm not sure what's going on here. I'm pretty sure it isn't to do with the package though. Error message below:

[deploy@206.189.246.10 -p 1992]: Created zip containing 3158 files. Size is 100.52 MB
[deploy@206.189.246.10 -p 1992]: Applying password and encryption to zip...
[deploy@206.189.246.10 -p 1992]: mmap() failed: [12] Cannot allocate memory
[deploy@206.189.246.10 -p 1992]: mmap() failed: [12] Cannot allocate memory
[deploy@206.189.246.10 -p 1992]: mmap() failed: [12] Cannot allocate memory
[deploy@206.189.246.10 -p 1992]: PHP Fatal error:  Out of memory (allocated 2281476096) (tried to allocate 4294967304 bytes) in 

Despite not likely being to do with the update, I'd appreciate any insight. Could you modify the code to print out the type of encryption being applied before the actual encryption starts?

Ignore this, it's to do with my deploy config. I'm trying to back up the version without a config file, so it's failing. Fixed.

olssonm commented 5 years ago

Ah, gotcha.

Yeah, I will still look into improving the code though to minimize the memory usage. On pre PHP 7.2 systems this was very difficult. But since Laravel 6.0 requires PHP 7.2 I might just as well use the bundled methods in PHP. Will look into it and try to release a more efficient version soon.

olssonm commented 5 years ago

The latest release (3.1) now supports the native ZipArchive functions and will use them automatically if the system supports them (i.e. PHP 7.2 and a newer version of the zip-module.

Might help with the memory usage.

Closing this issue.