Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Archivestream Php

Archivestream Php Laravel Package

barracudanetworks/archivestream-php

View on GitHub
Deep Wiki
Context7

A library for dynamically streaming dynamic tar or zip files without the need to have the complete file stored on the server.

Frequently asked questions about Archivestream Php
How do I install barracudanetworks/archivestream-php in a Laravel application?
Install it with Composer using composer require barracudanetworks/archivestream-php. It is a plain library, so there is nothing to publish and no artisan install step. Before committing, run composer why-not to confirm its PSR-7 constraint resolves against the rest of your Laravel stack. Because it is a 2020-era package, expect to verify dependency resolution against your target PHP minor first.
Does this package ship a Laravel service provider or facade?
No. It is a pure-PHP archive streaming primitive with no service provider, config file, or facade. The recommended approach is to define your own ArchiveWriter and ArchiveReader contracts and bind a thin adapter in a small Laravel service provider. That way controllers and queued jobs never import vendor classes directly, and swapping implementations later is a container binding change rather than a code change.
How do I stream a ZIP download from a Laravel controller with ArchiveStream?
You write entries directly to a PHP stream handle, so you can build the archive inside a StreamedResponse callback without ever materializing the file on disk. Point the writer at php://output or a PSR-7 stream and feed it contents read from Storage, database cursors, or an API. Keep in mind that browser-facing streaming of large bundles is CPU-bound inside PHP-FPM. For anything beyond a few hundred megabytes, prefer a queued job that writes to object storage and returns a signed URL.
Can I stream archives directly to an S3 or Flysystem disk in Laravel?
Yes, this is one of the package's strongest fits for Laravel. Because it writes byte-by-byte to a stream handle, it composes with Storage::writeStream() and Flysystem-backed disks, including S3-compatible object storage. PSR-7 stream interoperability also means it works alongside guzzlehttp/psr7. This eliminates temp file cleanup obligations and the disk-headroom class of production incidents.
Does barracudanetworks/archivestream-php support ZIP64?
There is no ZIP64 support, so expect hard ceilings around 4 GiB archive size and 65,535 entries. That is a real constraint for large bulk exports or bundles with many small objects. Verify the boundary empirically against a representative maximum export before you commit to the library. If your payloads can exceed those limits, you need a different writer.
Which archive formats and compression methods are supported?
The library handles ZIP and TAR, reading and writing entries on the fly. Compression is limited to Store and Deflate only, with no AES encryption and no bzip2 or zstd support. If your requirements are ZIP-only, an actively maintained alternative such as maennchen/zipstream-php may be the better choice. Confirm what formats and compression you actually need before adopting it.
Is ArchiveStream safe to use with untrusted user-uploaded archives?
Not out of the box. The library surfaces raw entry names, so zip-slip and path traversal protection are your responsibility, as are zip-bomb ceilings on entry count and uncompressed size. You must also sanitize names before writing extracted files anywhere on disk. Add explicit tests for path traversal, entry-count limits, and oversized entries before exposing the read path to user uploads.
Which Laravel and PHP versions does this package work with?
It is framework-agnostic, so it does not constrain Laravel 10, 11, or 12 directly. The practical issue is dependency resolution: a 2020-era release may pin psr/http-message ^1.0, which can conflict with modern stacks pulling PSR-7 v2. PHP 8.2 and 8.3 will likely run it but may emit deprecations such as implicit nullable parameters and dynamic properties, so budget a pass with E_ALL enabled.
How do I test archive streaming code in a Laravel test suite?
Write to an in-memory or temporary stream and assert on the resulting bytes, then read the archive back through the reader to verify entry names and contents. Use Storage::fake() to confirm your adapter writes correctly to a Flysystem disk. Cover the edge cases explicitly: zip-slip payloads, the ZIP64 boundary, empty archives, and very large entry counts. Profile memory at each step so a regression in streaming behavior fails a test rather than a production job.
Is barracudanetworks/archivestream-php still maintained, and what should I use instead?
Treat it as dormant. The last release was May 2020, the repository has roughly 77 stars, and it comes from a single vendor, so assume no upstream fixes and plan to vendor or fork it from day one. The package metadata also reports a NOASSERTION license, which is not a recognized SPDX identifier and must be cleared by legal before any code is written. For ZIP-only workloads, maennchen/zipstream-php is the actively maintained alternative; otherwise keep ext-zip as a fallback implementation behind the same contract.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console