PHPackages                             guiguiboy/simple-file-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. guiguiboy/simple-file-handler

ActiveLibrary[File &amp; Storage](/categories/file-storage)

guiguiboy/simple-file-handler
=============================

Simple file handler. Uses generators.

0.1.1(9y ago)115MITPHPPHP 7.\*

Since Apr 6Pushed 9y ago1 watchersCompare

[ Source](https://github.com/guiguiboy/file-handler)[ Packagist](https://packagist.org/packages/guiguiboy/simple-file-handler)[ RSS](/packages/guiguiboy-simple-file-handler/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Simple file handler
===================

[](#simple-file-handler)

This is a simple library which uses PHP generators to read a file. Think of it as a replacement for the built-in file() function which creates a copy of the file in the memory, thus making it unsuitable for large files.

Getting Started
---------------

[](#getting-started)

As long as the FileHandler class is autoloaded, simply:

```
$streamHandler = new StreamHandler(__DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR . 'file.txt');

foreach ($streamHandler->getLines() as $line) {
    //Do what you want
}

```

A check is made in the constructor to ensure provided file path exists. If not, an \\InvaliDArgumentException would be thrown.

### Prerequisites

[](#prerequisites)

- Composer

### Installing

[](#installing)

- Add package to your deps with composer

```
composer require guiguiboy/simple-file-handler

```

- Enjoy

Running the tests
-----------------

[](#running-the-tests)

- Tests

```
vendor/bin/phpunit tests/

```

### And coding style tests

[](#and-coding-style-tests)

- PSR-2 compatibility

```
vendor/bin/phpcs --standard=psr2 --ignore=vendor .

```

Contributing
------------

[](#contributing)

Please, make PR. I'll be happy to review.

Versioning
----------

[](#versioning)

Authors
-------

[](#authors)

- **Guillaume BRETOU**

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

Acknowledgments
---------------

[](#acknowledgments)

- README built with

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3324d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e27b37f0320fde841e2933df78f3845d853f4c7a70f8c39bc739be629298e90?d=identicon)[guiguiboy](/maintainers/guiguiboy)

---

Top Contributors

[![guiguiboy](https://avatars.githubusercontent.com/u/1903154?v=4)](https://github.com/guiguiboy "guiguiboy (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/guiguiboy-simple-file-handler/health.svg)

```
[![Health](https://phpackages.com/badges/guiguiboy-simple-file-handler/health.svg)](https://phpackages.com/packages/guiguiboy-simple-file-handler)
```

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
