https://github.com/pastuhov/php-file-stream
May be used for sitemap.xml or YML files creation.
https://github.com/pastuhov/php-file-stream
file sitemap xml yml
Last synced: about 1 year ago
JSON representation
May be used for sitemap.xml or YML files creation.
- Host: GitHub
- URL: https://github.com/pastuhov/php-file-stream
- Owner: pastuhov
- License: gpl-2.0
- Created: 2015-06-18T05:53:24.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-02-17T14:01:45.000Z (over 9 years ago)
- Last Synced: 2025-03-26T20:49:31.231Z (over 1 year ago)
- Topics: file, sitemap, xml, yml
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-file-stream
[](https://travis-ci.org/pastuhov/php-file-stream)
[](https://scrutinizer-ci.com/g/pastuhov/php-file-stream/?branch=master)
[](https://scrutinizer-ci.com/g/pastuhov/php-file-stream/?branch=master)
[](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
Via Composer
``` bash
$ composer require pastuhov/php-file-stream
```
## Features
* transparent file splitting (multiple sitemaps)
* fast and safe file replacement from tmp to public directory
* dependencies: 0
## Usage
### Simple YML export
```php
$stream = new FileStream(
'/tmp/export.yml'
);
$stream->write('');
...
$stream->write('');
```
### Advanced usage (large site sitemap, >10k urls)
```php
$stream = new FileStream(
'/tmp/sitemap{count}.xml',
'',
'',
10000
);
foreach ($urls as $url) {
$stream->write(
'' . $url . '' . PHP_EOL
);
}
```
## Testing
``` bash
$ composer test
```
or
```bash
$ phpunit
```
## Security
If you discover any security related issues, please email kirill@pastukhov.su instead of using the issue tracker.
## Credits
- [Kirill Pastukhov](https://github.com/pastuhov)
- [All Contributors](../../contributors)
## License
GNU General Public License, version 2. Please see [License File](LICENSE) for more information.