PHPackages                             pastuhov/php-file-stream - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. pastuhov/php-file-stream

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

pastuhov/php-file-stream
========================

Big file creation helper. May be used for sitemap.xml or YML files creation.

v1.0.2(9y ago)321.1k↓50%11GPL-2.0PHPPHP &gt;=5.4.0

Since Jun 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/pastuhov/php-file-stream)[ Packagist](https://packagist.org/packages/pastuhov/php-file-stream)[ Docs](https://github.com/pastuhov/php-file-stream)[ RSS](/packages/pastuhov-php-file-stream/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (1)

php-file-stream
===============

[](#php-file-stream)

[![Build Status](https://camo.githubusercontent.com/ae8c623ea5d013830cabff7f3fee19b365f75542813625ff7100add9b62bf79f/68747470733a2f2f7472617669732d63692e6f72672f7061737475686f762f7068702d66696c652d73747265616d2e737667)](https://travis-ci.org/pastuhov/php-file-stream)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/631357b38b337879ba1d390af4939078842132ee5cc225e92ee9fbefb3f2f62a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7061737475686f762f7068702d66696c652d73747265616d2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pastuhov/php-file-stream/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/cc4994f0f6340e1c3ea048b49db6aaa6c8d21d0d10e64ff345a26a34ede2abbe/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7061737475686f762f7068702d66696c652d73747265616d2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pastuhov/php-file-stream/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/e45cbeea5bb8cbd3ca746fa4df7468ae9feb75cb3df5d685d919fa99b2d4286f/68747470733a2f2f706f7365722e707567782e6f72672f7061737475686f762f7068702d66696c652d73747265616d2f646f776e6c6f616473)](https://packagist.org/packages/pastuhov/php-file-stream)

A PHP class to generate sitemap files for large web-sites or YML (Yandex Market Language) files

Install
-------

[](#install)

Via Composer

```
$ composer require pastuhov/php-file-stream
```

Features
--------

[](#features)

- transparent file splitting (multiple sitemaps)
- fast and safe file replacement from tmp to public directory
- dependencies: 0

Usage
-----

[](#usage)

### Simple YML export

[](#simple-yml-export)

```
    $stream = new FileStream(
        '/tmp/export.yml'
    );

    $stream->write('');

    ...

    $stream->write('');
```

### Advanced usage (large site sitemap, &gt;10k urls)

[](#advanced-usage-large-site-sitemap-10k-urls)

```
    $stream = new FileStream(
        '/tmp/sitemap{count}.xml',
        '',
        '',
        10000
    );

    foreach ($urls as $url) {
        $stream->write(
            '' . $url . '' . PHP_EOL
        );
    }
```

Testing
-------

[](#testing)

```
$ composer test
```

or

```
$ phpunit
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Kirill Pastukhov](https://github.com/pastuhov)
- [All Contributors](../../contributors)

License
-------

[](#license)

GNU General Public License, version 2. Please see [License File](LICENSE) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

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

Total

3

Last Release

3377d ago

PHP version history (2 changes)v1.0PHP &gt;=5.3.0

v1.0.1PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7937221?v=4)[Pastuhov Kirill](/maintainers/pastuhov)[@pastuhov](https://github.com/pastuhov)

---

Top Contributors

[![pastuhov](https://avatars.githubusercontent.com/u/7937221?v=4)](https://github.com/pastuhov "pastuhov (35 commits)")

---

Tags

filesitemapxmlymlstreamymlSitemapexport.yml

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pastuhov-php-file-stream/health.svg)

```
[![Health](https://phpackages.com/badges/pastuhov-php-file-stream/health.svg)](https://phpackages.com/packages/pastuhov-php-file-stream)
```

###  Alternatives

[mustangostang/spyc

A simple YAML loader/dumper class for PHP

73440.3M172](/packages/mustangostang-spyc)[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[presta/sitemap-bundle

A Symfony bundle that provides tools to build your application sitemap.

3929.4M28](/packages/presta-sitemap-bundle)[rumenx/php-sitemap

Framework-agnostic Sitemap generator for PHP, Laravel, and Symfony.

1.3k15.1k1](/packages/rumenx-php-sitemap)[vipnytt/sitemapparser

XML Sitemap parser class compliant with the Sitemaps.org protocol.

772.2M10](/packages/vipnytt-sitemapparser)[ultrono/laravel-sitemap

Sitemap generator for Laravel 11, 12 and 13

36412.6k6](/packages/ultrono-laravel-sitemap)

PHPackages © 2026

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