PHPackages                             vinex56/sitemap-generator - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vinex56/sitemap-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vinex56/sitemap-generator
=========================

Library for generating website sitemaps in XML, CSV, and JSON formats.

06PHP

Since Aug 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Vinex56/sitemap-generator)[ Packagist](https://packagist.org/packages/vinex56/sitemap-generator)[ RSS](/packages/vinex56-sitemap-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sitemap Generator
=================

[](#sitemap-generator)

Sitemap Generator is a PHP library for generating sitemaps in XML, CSV, and JSON formats. This library allows you to easily create sitemaps for your website and save them in the desired format.

Installation
------------

[](#installation)

You can install the library via Composer. Run the following command in your project directory:

```
composer require vinex56/sitemap-generator:dev-master
```

Usage
=====

[](#usage)

Here is an example of how to use the Sitemap Generator:

```
require 'vendor/autoload.php';
use Vinex56\SitemapGenerator\SitemapGenerator;
$pages = [
    [
        'loc' => 'https://site.ru/',
        'lastmod' => '2020-12-14',
        'priority' => '1',
        'changefreq' => 'hourly'
    ],
    [
        'loc' => 'https://site.ru/news',
        'lastmod' => '2020-12-10',
        'priority' => '0.5',
        'changefreq' => 'daily'
    ],
    [
        'loc' => 'https://site.ru/about',
        'lastmod' => '2020-12-07',
        'priority' => '0.1',
        'changefreq' => 'weekly'
    ]
];
try {
    $sitemap = new SitemapGenerator($pages, 'json', __DIR__ . '/upload/sitemap.json');
    $sitemap->generate();
    echo "Sitemap generated successfully.\n";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
```

Features
========

[](#features)

Supports generating sitemaps in XML, CSV, and JSON formats. Automatically creates the directory for the sitemap file if it doesn't exist. Validates input data to ensure proper sitemap generation. Throws custom exceptions for various errors (e.g., invalid data, file write errors).

Requirements
============

[](#requirements)

- PHP 7.4 or higher
- Composer

License
=======

[](#license)

This library is licensed under the MIT License. See the LICENSE file for more details.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e467aebe5e8a3eb0fb3bb81fff213d4d88855c7ff551423b95ba80d869bcf695?d=identicon)[Vinex56](/maintainers/Vinex56)

---

Top Contributors

[![Vinex56](https://avatars.githubusercontent.com/u/47274446?v=4)](https://github.com/Vinex56 "Vinex56 (7 commits)")

### Embed Badge

![Health badge](/badges/vinex56-sitemap-generator/health.svg)

```
[![Health](https://phpackages.com/badges/vinex56-sitemap-generator/health.svg)](https://phpackages.com/packages/vinex56-sitemap-generator)
```

###  Alternatives

[trentrichardson/cakephp-shrink

Compiles, combines, and minifies javascript, coffee, less, scss, and css

1619.3k](/packages/trentrichardson-cakephp-shrink)

PHPackages © 2026

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