jstewmc/chunker
Multi-byte safe chunked reading for huge files or strings in PHP. Avoids breaking UTF-8 characters by adjusting chunk boundaries so each chunk is valid text, reducing memory use while processing streams sequentially.
file_get_contents() or fread() for large files (e.g., in Illuminate\Filesystem\Filesystem).Symfony\Component\HttpFoundation\StreamedResponse).Illuminate\Bus\Queueable).Illuminate\Validation\Rule for custom rules).ext-mbstring required, already enabled in Laravel).Storage::get() or file() for large files with Jstewmc\Chunker\File.Jstewmc\Chunker\Text for multi-byte-safe string splitting (e.g., in Illuminate\Support\Str extensions).StreamedResponse for chunked downloads/uploads.AppServiceProvider.Chunk facade for consistency with Laravel’s patterns.ChunkProcessed) for observability.? in UTF-8) is a high-risk mitigation for Laravel apps processing non-ASCII data (e.g., logs, user-generated content).mb_internal_encoding() could fail if the app’s encoding is misconfigured (mitigate by enforcing explicit encoding in Laravel config).Artisan commands, Http\Requests, Mail\Attachments).UTF-8) for chunkers, or rely on mb_internal_encoding()?fgetss() or mb_string functions for specific use cases?ChunkException or integrate with Laravel’s Illuminate\Support\Exceptions?file_get_contents() in Illuminate\Filesystem\FilesystemAdapter for large files.Symfony\Component\HttpFoundation\StreamedResponse for chunked responses.Illuminate\Queue\Jobs\Job for processing large payloads.Illuminate\Validation\Rule for multi-byte-safe string validation.chunkRead() with Jstewmc\Chunker for large CSV/Excel files.jstewmc/chunker to composer.json and publish a facade (e.g., Chunk::file($path)).file_get_contents() with Chunk::file()->current() in critical paths (e.g., Artisan commands, Events).StreamedResponse to accept chunkers for native chunked streaming.Filesystem::get() to use chunkers for files > X bytes.ChunkRule for multi-byte-safe string validation.ShouldQueue jobs to process large payloads in chunks.ChunkStarted, ChunkProcessed) for logging/monitoring.file_get_contents()) as deprecated in Laravel’s docs if chunkers are preferred.ext-mbstring is required but already enabled in Laravel.Chunk::file($path)->whenLarge()).Filesystem) to use chunkers by default.CHUNKER_FALLBACK) to revert to file_get_contents() if chunking fails.jstewmc/chunker for updates (e.g., PHP 8.2 compatibility).composer.json until stability is proven (e.g., ^0.2).? if encoding is misconfigured (document mb_internal_encoding()).file_get_contents()).How can I help you explore Laravel packages today?