PHPackages                             xp-framework/io-collections - 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. xp-framework/io-collections

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

xp-framework/io-collections
===========================

I/O Collections for the XP Framework

v10.1.0(2y ago)072.1k↓13.4%5BSD-3-ClausePHPPHP &gt;=7.0.0

Since Sep 27Pushed 2y ago1 watchersCompare

[ Source](https://github.com/xp-framework/io-collections)[ Packagist](https://packagist.org/packages/xp-framework/io-collections)[ Docs](http://xp-framework.net/)[ RSS](/packages/xp-framework-io-collections/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (2)Versions (12)Used By (5)

I/O Collections
===============

[](#io-collections)

[![Build status on GitHub](https://github.com/xp-framework/io-collections/workflows/Tests/badge.svg)](https://github.com/xp-framework/io-collections/actions)[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)[![Latest Stable Version](https://camo.githubusercontent.com/b4e1dc1bd6be3f4257c50fd7281f422eda4eb74052182b41b1a89128554184c9/68747470733a2f2f706f7365722e707567782e6f72672f78702d6672616d65776f726b2f696f2d636f6c6c656374696f6e732f76657273696f6e2e706e67)](https://packagist.org/packages/xp-framework/io-collections)

API
---

[](#api)

The entry point for accessing I/O collections are the `io.collections.IOCollection` implementations:

- `io.collections.FileCollection` - files in a given filesystem path
- `io.collections.ArchiveCollection` - files inside a XAR archive

To access the files from more than one collection, use the `io.collections.CollectionComposite` class.

Iteration
---------

[](#iteration)

The subpackage `io.collections.iterate` allows iterating I/O collections.

- `io.collections.iterate.IOCollectionIterator` - iterate a given I/O collection, optionally recursive
- `io.collections.iterate.FilteredIOCollectionIterator` - as above, but with an optional filter

### Filters

[](#filters)

The following filters are available:

Date-based:

- `io.collections.iterate.AccessedAfterFilter(util.Date $date)`
- `io.collections.iterate.AccessedBeforeFilter(util.Date $date)`
- `io.collections.iterate.CreatedAfterFilter(util.Date $date)`
- `io.collections.iterate.CreatedBeforeFilter(util.Date $date)`
- `io.collections.iterate.ModifiedAfterFilter(util.Date $date)`
- `io.collections.iterate.ModifiedBeforeFilter(util.Date $date)`

Size-based:

- `io.collections.iterate.SizeEqualsFilter(int $compare)`
- `io.collections.iterate.SizeBiggerThanFilter(int $limit)`
- `io.collections.iterate.SizeSmallerThanFilter(int $limit)`

Name-based:

- `io.collections.iterate.ExtensionEqualsFilter(string $compare)`
- `io.collections.iterate.NameEqualsFilter(string $compare)`
- `io.collections.iterate.NameMatchesFilter(string $pattern)`
- `io.collections.iterate.UriMatchesFilter(string $pattern)`

Type-based:

- `io.collections.iterate.CollectionFilter()`

To combine filters, use the `util.Filters` class.

Example
-------

[](#example)

This finds all JPEG files inside the directory `/home/thekid/multimedia`:

```
use io\collections\FileCollection;
use io\collections\iterate\{FilteredIOCollectionIterator, ExtensionEqualsFiler};
use util\cmd\Console;
use util\Filters;

$iterator= new FilteredIOCollectionIterator(
  new FileCollection('/home/thekid/multimedia'),
  Filters::allOf([new ExtensionEqualsFilter('.jpg'), new ExtensionEqualsFilter('.JPG')]),
  true
);

foreach ($iterator as $file) {
  Console::writeLine($file);
}
```

See also
--------

[](#see-also)

- [RFC #0196: I/O Collections random access](https://github.com/xp-framework/rfc/issues/196)
- [RFC #0174: io.collections interface additions / io.streams integration](https://github.com/xp-framework/rfc/issues/174)
- [RFC #0077: I/O Collections Extensions](https://github.com/xp-framework/rfc/issues/77)
- [RFC #0075: I/O Collections](https://github.com/xp-framework/rfc/issues/75)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 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 ~310 days

Recently: every ~361 days

Total

11

Last Release

831d ago

Major Versions

v6.5.0 → v7.0.02016-02-21

v7.1.0 → v8.0.02017-05-28

v8.0.2 → v9.0.02020-04-10

v9.0.0 → v10.0.02020-12-29

PHP version history (3 changes)v6.5.0PHP &gt;=5.5.0

v8.0.0PHP &gt;=5.6.0

v9.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/07d18d882c8b4aaf3466432f64018214f2771eda333202175431ee7233795376?d=identicon)[thekid](/maintainers/thekid)

---

Top Contributors

[![thekid](https://avatars.githubusercontent.com/u/696742?v=4)](https://github.com/thekid "thekid (49 commits)")

---

Tags

filesystemiterationphpxp-frameworkmodulexp

### Embed Badge

![Health badge](/badges/xp-framework-io-collections/health.svg)

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

###  Alternatives

[xp-framework/compiler

XP Compiler

1926.8k10](/packages/xp-framework-compiler)

PHPackages © 2026

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