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

File Laravel Package

hoa/file

Hoa\File is a PHP library for robust filesystem access, offering object-oriented abstractions for files, directories, links, sockets, and streams. It supports reading, writing, locking, permissions, iterators, and exceptions, making file operations safer and more consistent.

View on GitHub
Deep Wiki
Context7

Hoa\File is a PHP library that provides an object-oriented layer for working with files, directories, links, and streams. Built on Hoa\Stream, it offers consistent APIs for reading, writing, appending, and path handling, with clear exceptions and error management for reliable file I/O.

  • Stream-based architecture for files, directories, and links
  • Read, write, and append abstractions with buffering support
  • File locking and safe concurrent access
  • Stream filters and wrappers integration
  • Consistent exceptions for robust error handling
Frequently asked questions about File
Can I use hoa/file in a Laravel application?
Technically yes, but it is not recommended. hoa/file has no Laravel service provider, facade, or configuration surface, so you would need to write a thin adapter yourself. It also introduces a second file-access layer with its own exception and event systems that Laravel does not know about. For most Laravel projects the Storage facade, Flysystem, and symfony/filesystem cover the same capabilities.
How do I install hoa/file with Composer?
Run composer require hoa/file. Composer will also pull hoa/stream, hoa/consistency, hoa/exception, hoa/event, hoa/protocol, and hoa/zformat. All of these packages are archived and frozen at their 2017 releases. A successful install does not mean the stack is compatible with your PHP runtime, so test thoroughly before relying on it.
Is hoa/file still maintained?
No. The hoa/file repository is archived and the last release was in July 2017. There is no security patch path and no upstream community to answer questions about modern PHP versions. Any bug or CVE becomes your fork's responsibility.
Does hoa/file work with PHP 8 and Laravel 10 or 11?
Composer may install it because the constraints only declare a PHP floor with no ceiling, but runtime compatibility is not guaranteed. The stack was written for PHP 5.6 and 7.0 idioms, and hoa/consistency's error-handler and shutdown shims predate PHP 8's tightened signatures. Dynamic property deprecations in PHP 8.2 and later are also likely to affect its value objects. Verify empirically on your target PHP version before committing.
What replaces hoa/file in Laravel?
Laravel's Storage facade and Flysystem handle reading, writing, appending, and disk abstraction. symfony/filesystem and symfony/finder cover directory creation, iteration, deletion, and symlinks. Native flock() or Laravel cache locks replace hoa/file's locking helpers, and PHP stream filters replace its filter chain. In practice nearly every hoa/file capability has a first-party Laravel or Symfony equivalent.
Does hoa/file support S3, GCS, or SFTP?
No. hoa/file is a local-stream abstraction with no Flysystem-grade adapter ecosystem. If your application needs remote disks, hoa/file is disqualified outright. Use Laravel's Storage facade with the appropriate Flysystem adapter instead.
Is hoa/file safe to use with Laravel Octane or queue workers?
It is risky. hoa/file registers stream wrappers and installs a custom error handler, which assumes process-global state and can collide with Laravel's bootstrapping. In long-lived workers such as Octane and queue consumers, that global state persists across requests and jobs. For most teams this is a strong reason to avoid the package.
Can hoa/file and Laravel's Storage facade be used together?
They can coexist in the same process, but they are mutually unaware layers with separate exception hierarchies and separate abstractions. Mixing them makes error handling and testing harder and creates two sources of truth for filesystem behavior. If you must keep hoa/file for legacy code, isolate it behind a domain-owned interface rather than scattering calls through your application.
How do I migrate legacy code away from hoa/file?
Do not delete and rewrite in one step. Introduce a domain-owned interface that wraps the file operations your code actually needs, then implement it first with hoa/file and later with Storage or symfony/filesystem. That lets you swap the implementation incrementally and test the behavior in isolation.
What are the best alternatives to hoa/file for Laravel?
For disk abstraction and remote storage, use Laravel's Storage facade backed by league/flysystem. For local filesystem operations, use symfony/filesystem and symfony/finder, which Laravel already depends on. For temporary files use tempnam() or Storage::disk('local'), and for locking use flock() or Laravel's cache locks. These are maintained, PSR-4 compliant, and supported by the Laravel community.
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