Download the PHP package aerni/zipper without Composer
On this page you can find all versions of the php package aerni/zipper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package zipper
Short Description Zip your Statamic assets on the fly
License MIT
Homepage https://github.com/aerni/statamic-zipper
Informations about the package zipper
Zipper
This addon provides a simple way to zip your Statamic assets on the fly.
Installation
Install the addon using Composer:
Publish the config of the package (optional):
Basic Usage
To create a zip of your assets, you must call the zip
tag followed by the variable
containing your assets. The tag returns the URL to the route that handles creating the zip. The zip will be streamed without being saved to disk, but you may opt-in to save the file to disk for later use.
Somewhere in your content files:
Somewhere in your views:
Filename
You may optionally pass a filename using the filename
parameter. The filename defaults to the current timestamp when the Zip object is created. The example below binds the zip name to the page title.
Link Expiry
If you want to expire your links after a certain time, you can either set the expiry globally in the config or use the expiry
parameter on the tag. The expiry is to be set in minutes. Note that the expiry on the tag will override the expiry in the config.
Cleanup Old References
Zipper saves an encrypted instance of the Zip class every time it returns a URL. This class is later retrieved and decrypted when a user downloads a zip. These reference files are stored in storage/zipper/{id}
.
With time, the number of saved reference files will grow. To control this, Zipper provides a scheduled command that will delete old reference files daily. Just make sure that your Scheduler is running.
Cleanup Scopes
There are a couple of cleanup scopes to choose from in the config.:
Option | Description |
---|---|
expired |
Only delete expired references files. This only affects references of zips that used the expiry option |
all |
Delete all reference files, excluding unexpired files. This will delete references of expired zips and zips that didn't use the expiry option. It will not delete unexpired zips. |
force |
Delete all reference files, including unexpired files. This will completely wipe all references. |
Clean Command
You may also use the clean
command to delete reference files at your will. The scope defaults to expired
.
Advanced Usage
You may also use this addon programmatically, as shown below.
All versions of zipper with dependencies
laravel/framework Version ^10.0 || ^11.0
statamic/cms Version ^5.0
stechstudio/laravel-zipstream Version ^5.0