PHPackages                             habanero/io - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. habanero/io

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

habanero/io
===========

Common wrappers and IO utils for PHP

4131PHP

Since Jan 26Pushed 10y ago1 watchersCompare

[ Source](https://github.com/hbnro/phpio)[ Packagist](https://packagist.org/packages/habanero/io)[ RSS](/packages/habanero-io/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Talkin' bout I/O
================

[](#talkin-bout-io)

A collection of helper classes to do many simple tasks through filesystem.

The installation is done using the [Composer](http://getcomposer.org/)/[Packagist](https://packagist.org/).

Quick reference
---------------

[](#quick-reference)

Retrieve the mime-type value from a given file

```
IO\Helpers::mimetype($filename)

```

Return the formatted byte-length value

```
IO\Helpers::fmtsize($bytes[, $unit = NULL[, $format = '%01.2f %s']])

```

Assemble and resolve paths from its arguments

```
IO\Helpers::join($arg1[, $arg2[, $argN]])

```

Retrieve files in the given directory

```
IO\Dir::entries($path[, $filter = '*'[, $recursive = FALSE]])

```

Copy files between directories

```
IO\Dir::cpfiles($from, $to[, $filter = '*'[, $recursive = FALSE]])

```

Find files through given directory

```
IO\Dir::findfile($path[, $filter = '*'[, $recursive = FALSE[, $index = 0]]])

```

Remove files from given directory

```
IO\Dir::unfile($path[, $filter = '*'[, $recursive = FALSE]])

```

Retrieve the size in bytes from given directory

```
IO\Dir::size($path[, $recursive = FALSE])

```

Execute the *lambda* function for each file within the given directory using `opendir()` and pass the value from `readdir()` to the *lambda* block. Then use `closedir()` after the whole iteration.

```
IO\Dir::open($path, $lambda)

```

Execute the *lambda* for each file within the given directory and pass the file path to the *lambda* block recursively. This method use `entries()` to build its tree.

```
IO\Dir::each($path, $filter, $lambda)

```

Get the filename extension

```
IO\File::ext($name[, $dot = FALSE])

```

Get the whole filepath without extension

```
IO\File::extn($name[, $base = FALSE])

```

Read a single file or URL

```
IO\File::read($path)

```

Writes a single file

```
IO\File::write($file, $content, $append)

```

Use `fopen()` and pass the *\#resource* to execute the *lambda* block, then close the file using `fclose()` automatically.

```
IO\File::open($file, $access, $lambda)

```

Execute the *lambda* for each line from the given file.

```
IO\File::each($path, $lambda)

```

Contribute
----------

[](#contribute)

The library performs just basic things, if you want add more features or fix something, you're welcome.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/206371?v=4)[Alvaro Cabrera Durán](/maintainers/pateketrueke)[@pateketrueke](https://github.com/pateketrueke)

---

Top Contributors

[![pateketrueke](https://avatars.githubusercontent.com/u/206371?v=4)](https://github.com/pateketrueke "pateketrueke (11 commits)")

### Embed Badge

![Health badge](/badges/habanero-io/health.svg)

```
[![Health](https://phpackages.com/badges/habanero-io/health.svg)](https://phpackages.com/packages/habanero-io)
```

###  Alternatives

[liberu-genealogy/php-dna

DNA analysis toolkit for PHP 8.3+

344.8k1](/packages/liberu-genealogy-php-dna)[sas/shortcode

Use Wordpress like Shortcodes within the Text Editor of Shopware

156.4k](/packages/sas-shortcode)

PHPackages © 2026

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