{"id":21056022,"url":"https://github.com/xp-framework/io-collections","last_synced_at":"2025-10-29T02:15:46.366Z","repository":{"id":57084828,"uuid":"43259986","full_name":"xp-framework/io-collections","owner":"xp-framework","description":"I/O Collections for the XP Framework","archived":false,"fork":false,"pushed_at":"2024-03-24T11:35:58.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-26T01:20:16.948Z","etag":null,"topics":["filesystem","iteration","php","xp-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-framework.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-27T18:53:18.000Z","updated_at":"2021-10-21T18:06:24.000Z","dependencies_parsed_at":"2024-03-24T12:30:39.921Z","dependency_job_id":"8bc233d6-6b51-4798-a8c3-859fd1815099","html_url":"https://github.com/xp-framework/io-collections","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fio-collections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fio-collections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fio-collections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fio-collections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-framework","download_url":"https://codeload.github.com/xp-framework/io-collections/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243500787,"owners_count":20300775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["filesystem","iteration","php","xp-framework"],"created_at":"2024-11-19T16:48:21.102Z","updated_at":"2025-09-25T11:14:41.358Z","avatar_url":"https://github.com/xp-framework.png","language":"PHP","readme":"I/O Collections\n===============\n\n[![Build status on GitHub](https://github.com/xp-framework/io-collections/workflows/Tests/badge.svg)](https://github.com/xp-framework/io-collections/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-framework/io-collections/version.png)](https://packagist.org/packages/xp-framework/io-collections)\n\nAPI\n---\nThe entry point for accessing I/O collections are the `io.collections.IOCollection` implementations:\n\n* `io.collections.FileCollection` - files in a given filesystem path\n* `io.collections.ArchiveCollection` - files inside a XAR archive\n\nTo access the files from more than one collection, use the `io.collections.CollectionComposite` class.\n\nIteration\n---------\nThe subpackage `io.collections.iterate` allows iterating I/O collections.\n\n* `io.collections.iterate.IOCollectionIterator` - iterate a given I/O collection, optionally recursive\n* `io.collections.iterate.FilteredIOCollectionIterator` - as above, but with an optional filter\n\n### Filters\nThe following filters are available:\n\nDate-based:\n\n* `io.collections.iterate.AccessedAfterFilter(util.Date $date)`\n* `io.collections.iterate.AccessedBeforeFilter(util.Date $date)`\n* `io.collections.iterate.CreatedAfterFilter(util.Date $date)`\n* `io.collections.iterate.CreatedBeforeFilter(util.Date $date)`\n* `io.collections.iterate.ModifiedAfterFilter(util.Date $date)`\n* `io.collections.iterate.ModifiedBeforeFilter(util.Date $date)`\n\nSize-based:\n\n* `io.collections.iterate.SizeEqualsFilter(int $compare)`\n* `io.collections.iterate.SizeBiggerThanFilter(int $limit)`\n* `io.collections.iterate.SizeSmallerThanFilter(int $limit)`\n\nName-based:\n\n* `io.collections.iterate.ExtensionEqualsFilter(string $compare)`\n* `io.collections.iterate.NameEqualsFilter(string $compare)`\n* `io.collections.iterate.NameMatchesFilter(string $pattern)`\n* `io.collections.iterate.UriMatchesFilter(string $pattern)`\n\nType-based:\n\n* `io.collections.iterate.CollectionFilter()`\n\nTo combine filters, use the `util.Filters` class.\n\nExample\n-------\nThis finds all JPEG files inside the directory `/home/thekid/multimedia`:\n\n```php\nuse io\\collections\\FileCollection;\nuse io\\collections\\iterate\\{FilteredIOCollectionIterator, ExtensionEqualsFiler};\nuse util\\cmd\\Console;\nuse util\\Filters;\n\n$iterator= new FilteredIOCollectionIterator(\n  new FileCollection('/home/thekid/multimedia'),\n  Filters::allOf([new ExtensionEqualsFilter('.jpg'), new ExtensionEqualsFilter('.JPG')]), \n  true\n);\n\nforeach ($iterator as $file) {\n  Console::writeLine($file);\n}\n```\n\nSee also\n--------\n* [RFC #0196: I/O Collections random access](https://github.com/xp-framework/rfc/issues/196)\n* [RFC #0174: io.collections interface additions / io.streams integration](https://github.com/xp-framework/rfc/issues/174)\n* [RFC #0077: I/O Collections Extensions](https://github.com/xp-framework/rfc/issues/77)\n* [RFC #0075: I/O Collections](https://github.com/xp-framework/rfc/issues/75)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fio-collections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-framework%2Fio-collections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fio-collections/lists"}