PHPackages                             leo37rus/sitemap - 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. leo37rus/sitemap

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

leo37rus/sitemap
================

Sitemap gen file. File format supports: csv,JSON,xml

01PHP

Since Feb 9Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Библиотека генерации карты сайта
================================

[](#библиотека-генерации-карты-сайта)

Генерация файла карты сайта на php. Доступные форматы: xml, json, csv.

Установка
---------

[](#установка)

Усановка библиотеки через Composer

```
composer require leo37rus/sitemap:dev-main
```

Требования
----------

[](#требования)

Минимальные требование для данной библиотеки, требуется Веб сервер с поддержкой `PHP 8.1.`

Как работает
------------

[](#как-работает)

Для генерации файла необходимо инициализировать класс `SitemapGenerator` передав в него необходимые параметры и вызвать метод `generate()`.

Пример
------

[](#пример)

```
use App\Sitemap\SitemapGenerator;

$data = [];

$example = [
	[
		'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',

	],
	[
		'loc' => 'https://site.ru/products',
		'lastmod' => '2020-12-12',
		'priority' => 0.5,
		'changefreq' => 'daily',

	],
	[
		'loc' => 'https://site.ru/products/ps5',
		'lastmod' => '2020-12-11',
		'priority' => 0.1,
		'changefreq' => 'weekly',

	],
	[
		'loc' => 'https://site.ru/products/xbox',
		'lastmod' => '2020-12-12',
		'priority' => 0.1,
		'changefreq' => 'weekly',

	],
	[
		'loc' => 'https://site.ru/products/wii',
		'lastmod' => '2020-12-15',
		'priority' => 0.3,
		'changefreq' => 'weekly',

	]
];

foreach($example as $item) {
    $data[] = SitemapDto::createInstanceFromArray($item);
}

try {
    $generator = (new SitemapGenerator($data, 'xml', 'path\\to\\file'));
    $generator->generate();
} catch (Exception $e) {
	  echo 'Ошибка генерации' . $e->getMessage();
}
```

[![MIT License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](https://choosealicense.com/licenses/mit/)

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

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/339d743743b1475203b2abfb6e35aca575939a22467ba8b08e5cc0dbc3ca4774?d=identicon)[leo37rus](/maintainers/leo37rus)

---

Top Contributors

[![leo37rus](https://avatars.githubusercontent.com/u/113828858?v=4)](https://github.com/leo37rus "leo37rus (10 commits)")

### Embed Badge

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

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

PHPackages © 2026

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