A PHP class to generate sitemap files for large web-sites or YML (Yandex Market Language) files
Via Composer
$ composer require pastuhov/php-file-stream
- transparent file splitting (multiple sitemaps)
- fast and safe file replacement from tmp to public directory
- dependencies: 0
$stream = new FileStream(
'/tmp/export.yml'
);
$stream->write('<yml_catalog date="2010-04-01 17:00">');
...
$stream->write('</yml_catalog>');
$stream = new FileStream(
'/tmp/sitemap{count}.xml',
'<urlset>',
'</urlset>',
10000
);
foreach ($urls as $url) {
$stream->write(
'<url><loc>' . $url . '</loc></url>' . PHP_EOL
);
}
$ composer test
or
$ phpunit
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
GNU General Public License, version 2. Please see License File for more information.