aleksandr-ignatov/sitemap-generator

There is no license information available for the latest version (dev-master) of this package.

A library for generating sitemap in different formats.

dev-master 2024-05-21 12:24 UTC

This package is auto-updated.

Last update: 2025-04-21 14:17:14 UTC


README

Library generate sitemap in different formats: xml, csv, json.

To use library properly, define:

new SitemapGenerator($pages, $fileType, $dir);

where:

  • $pages - array:
$pages = [[
    string $loc,
    string $lastmod, 
    float $priority,
    string $changefreq], ...]
  • $fileType - is one of supported file types:
    • FileType::CSV
    • FileType::XML
    • FileType::JSON
  • $dir - location, where your sitemap will be saved

##test:

vendor/bin/phpunit tests/SitemapGeneratorTest.php