{"id":16541371,"url":"https://github.com/aerni/statamic-zipper","last_synced_at":"2025-06-15T18:40:12.416Z","repository":{"id":38314831,"uuid":"304660310","full_name":"aerni/statamic-zipper","owner":"aerni","description":"The easy way to zip your Statamic assets on the fly","archived":false,"fork":false,"pushed_at":"2024-08-13T19:10:46.000Z","size":7541,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-16T08:43:55.311Z","etag":null,"topics":["statamic","statamic-addon"],"latest_commit_sha":null,"homepage":"https://statamic.com/addons/aerni/zipper","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aerni.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-16T15:03:43.000Z","updated_at":"2024-08-13T19:09:27.000Z","dependencies_parsed_at":"2023-01-27T08:00:37.006Z","dependency_job_id":"53347e50-b4aa-4dd9-86e7-f89de64f2ac2","html_url":"https://github.com/aerni/statamic-zipper","commit_stats":{"total_commits":30,"total_committers":2,"mean_commits":15.0,"dds":0.09999999999999998,"last_synced_commit":"6e4ff1b0319001aa352db1c19c4b1df8b1c4594b"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/aerni/statamic-zipper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-zipper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-zipper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-zipper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-zipper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aerni","download_url":"https://codeload.github.com/aerni/statamic-zipper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aerni%2Fstatamic-zipper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260029892,"owners_count":22948250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["statamic","statamic-addon"],"created_at":"2024-10-11T18:54:49.104Z","updated_at":"2025-06-15T18:40:12.394Z","avatar_url":"https://github.com/aerni.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Statamic](https://flat.badgen.net/badge/Statamic/4.0+/FF269E) ![Packagist version](https://flat.badgen.net/packagist/v/aerni/zipper/latest) ![Packagist Total Downloads](https://flat.badgen.net/packagist/dt/aerni/zipper)\n\n# Zipper\nThis addon provides a simple way to zip your Statamic assets on the fly.\n\n## Installation\nInstall the addon using Composer:\n\n```bash\ncomposer require aerni/zipper\n```\n\nPublish the config of the package (optional):\n\n```bash\nphp please vendor:publish --tag=zipper-config\n```\n\n## Basic Usage\n\nTo 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.\n\nSomewhere in your content files:\n\n```yaml\nimages:\n  - sega-genesis.jpg\n  - snes.jpg\n```\n\nSomewhere in your views:\n\n```antlers\n{{ zip:images }}\n```\n\n### Filename\n\nYou 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.\n\n```antlers\n{{ zip:images :filename=\"title\" }}\n```\n\n### Link Expiry\n\nIf 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.\n\n```antlers\n{{ zip:images expiry=\"60\" }}\n```\n\n## Cleanup Old References\n\nZipper 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}`.\n\nWith 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.\n\n### Cleanup Scopes\n\nThere are a couple of cleanup scopes to choose from in the config.:\n\n| Option    | Description                                                                                                                                                                       |\n|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `expired` | Only delete expired references files. This only affects references of zips that used the `expiry` option                                                                          |\n| `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. |\n| `force`   | Delete all reference files, including unexpired files. This will completely wipe all references.                                                                                  |\n\n### Clean Command\n\nYou may also use the `clean` command to delete reference files at your will. The scope defaults to `expired`.\n\n```bash\nphp please zipper:clean\nphp please zipper:clean --scope=all\nphp please zipper:clean --scope=force\n```\n\n## Advanced Usage\n\nYou may also use this addon programmatically, as shown below.\n\n```php\nuse Aerni\\Zipper\\Zip;\n\n// Prepare an array of Statamic assets, paths, or URLs.\n$files = [\n    Statamic\\Assets\\Asset,\n    '/home/ploi/site.com/storage/app/assets/file_1.jpg',\n    'https://site.com/path/to/file_2.jpg',\n];\n\n// Make a zip with the files above.\n$zip = Zip::make($files);\n\n// Set an optional filename. This defaults to the timestamp when the object was created.\n$zip-\u003efilename('obi-wan-kenobi');\n\n// Set an optional expiry time in minutes. This defaults to the expiry set in the config.\n$zip-\u003eexpiry(60);\n\n// Get the URL that handles creating the zip.\n$zip-\u003eurl();\n\n// Create a new zip or download a previously cached zip.\n$zip-\u003eget();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerni%2Fstatamic-zipper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faerni%2Fstatamic-zipper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faerni%2Fstatamic-zipper/lists"}