Weave Code
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

Psl Laravel Package

azjezz/psl

PSL is a modern, well-typed standard library for PHP 8.4+, inspired by HHVM’s HSL. It offers safer, predictable APIs for async, collections, networking, I/O, crypto, terminal UI, and robust data validation—replacing brittle built-ins with consistent alternatives.

View on GitHub
Deep Wiki
Context7

[# Compression

The Compression component provides streaming compression and decompression abstractions for IO handles. It defines compressor and decompressor interfaces, and four handle decorators that transparently compress or decompress data as it flows through.

This component is an abstraction layer -- it does not include any compression algorithms. Concrete implementations (e.g. deflate, gzip, brotli, zstd) are provided by separate packages that implement CompressorInterface and DecompressorInterface.

Interfaces

Two interfaces define the compression contract:

  • CompressorInterface -- push(string $data): string to incrementally compress, finish(): string to finalize and reset
  • DecompressorInterface -- push(string $data): string to incrementally decompress, finish(): string to finalize and reset

After finish(), the instance resets to initial state and can be reused for a new stream. Compression and decompression are inherently stateful -- a single instance must not be used concurrently across multiple fibers or streams.

Readers

CompressingReadHandle and DecompressingReadHandle wrap a readable handle and transform data on read. Both implement ReadHandleInterface. Wrap with IO\Reader for buffered methods like readLine() and readUntil().

Both accept an optional $chunkSize parameter (default 8192) controlling how many bytes are read from the inner handle per iteration. Increase it for large file compression, decrease it to reduce memory usage per stream.

@example('io/compression-reader.php')

Writers

CompressingWriteHandle and DecompressingWriteHandle wrap a writable handle and transform data on write. Both implement BufferedWriteHandleInterface. Call flush() to finalize the handle and write any remaining buffered data.

@example('io/compression-writer.php')

flush() accepts an optional CancellationTokenInterface parameter, so you can set a timeout on the finalization when writing to network handles.

See src/Psl/Compression/ for the full API.

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4