Comments (2)
It's definitely possible. Might take a bit to get it all wired up properly.
Laravel's illuminate/support
dependency is required, as I use a number of things like Collections and Str helpers. If you install this package tho, illuminate/support
will get installed automatically, as will the base maennchen/zipstream-php
package. I don't think you should need to install anything else manually.
To get it working, you'll want to read through the Service Provider and understand how the components are created, and do it manually. It will probably look something like this (untested):
$archiveOptions = new ZipStream\Option\Archive();
$archiveOptions->setZeroHeader(true);
$fileOptions = new ZipStream\Option\File();
$fileOptions->setMethod(ZipStream\Option\Method::STORE);
$zip = new STS\ZipStream($archiveOptions, $fileOptions);
The main ZipStream class does make use of the Laravel config()
global helper:
laravel-zipstream/src/ZipStream.php
Line 321 in 659e04e
You may need to create your own quick-n-dirty global config()
function that replicates what this package is expecting. Something like (untested):
function config($key) {
$config = [
'zipstream.archive.predict' => true
];
return $config[$key];
}
Obviously that could be improved on, it's just the most basic example of what this package would be expecting.
I think from there it might just work if you're zipping up local files from disk. If you are pulling from S3 though, you'll run into issues with the S3File class which is expecting more config()
values. So make sure to extend your own config function with the needed S3 config parameters for your app.
(On that note though, I have a PR that changes how this works, the next version of this library won't use config
from inside the S3File class.)
Feel free to try it out. I probably won't be able to provide a whole lot of non-Laravel support, but happy to take a look at any error you might hit if you need.
from laravel-zipstream.
Thank you so much for your time and for the quick response! I'll give it a shot and let you know how it goes.
from laravel-zipstream.
Related Issues (20)
- saveTo method has permission denied error on manjaro without webserver HOT 1
- Grant public-read access HOT 1
- Update maennchen/zipstream-php package HOT 2
- Space & Specials Character are being replaced by "%" sign HOT 1
- Compatibility with PHP 8.2 HOT 2
- Always downloading as a html file with incorrect name HOT 4
- Unable to install package. HOT 9
- maennchen/ZipStream-PHP v3 HOT 17
- The name of the file being downloaded is “download” without extension HOT 7
- ZipStream v3 Beta HOT 9
- Unexpected end of Archive HOT 1
- S3File memory leak on calculateFilesize HOT 11
- Cache file size HOT 6
- ErrorException: fopen(): s3:// wrapper is disabled HOT 1
- Filename sanitization HOT 2
- Laravel 10 Support HOT 1
- The package gets http file headers anyway even when filesize prediction is disabled
- Feature request: Check if file exists and/or append $var to filename HOT 3
- Unable to use Zip HOT 1
- Merge zip - source from s3 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-zipstream.