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

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

litlife/sitemap
===============

Sitemap create module

0.0.1(4y ago)015PHPPHP ^8.0

Since Feb 21Pushed 4y ago1 watchersCompare

[ Source](https://github.com/litlife/sitemap)[ Packagist](https://packagist.org/packages/litlife/sitemap)[ RSS](/packages/litlife-sitemap/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

litlife/sitemap
===============

[](#litlifesitemap)

This package for create sitemap

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

[](#installation)

Use the package manager [composer](https://getcomposer.org/) to install.

```
composer require litlife/sitemap
```

Usage
-----

[](#usage)

### Generate new sitemap and add new url

[](#generate-new-sitemap-and-add-new-url)

```
use Litlife\Sitemap\Sitemap;

$location = 'https://www.example.com';
$lastmod = '2005-01-01';
$changefreq = 'weekly';
$priority = 0.8;

$sitemap = new Sitemap();
$sitemap->addUrl($location, $lastmod, $changefreq, $priority);
```

### Get an array with locations

[](#get-an-array-with-locations)

```
$sitemap = new Sitemap();
$sitemap->getUrls();
```

### Get xml string

[](#get-xml-string)

```
$sitemap = new Sitemap();
$sitemap->getContent();
```

### Get size of xml in bytes

[](#get-size-of-xml-in-bytes)

```
$sitemap = new Sitemap();
$sitemap->getSize();
```

### Get the number of locations in the current sitemap file

[](#get-the-number-of-locations-in-the-current-sitemap-file)

```
$sitemap = new Sitemap();
$sitemap->getUrlCount();
```

### Get the number of locations in the current sitemap file

[](#get-the-number-of-locations-in-the-current-sitemap-file-1)

```
$sitemap = new Sitemap();
$sitemap->getUrlCount();
```

### Open sitemap file

[](#open-sitemap-file)

```
$sitemap = new Sitemap();
$sitemap->open('/path/to/file.xml');
```

### Open sitemap index file

[](#open-sitemap-index-file)

```
use Litlife\Sitemap\SitemapIndex;

$index = new SitemapIndex();
$index->open('/path/to/sitemap_index.xml');
```

### Add a sitemap

[](#add-a-sitemap)

```
$location = 'https://www.example.com/sitemap_index.xml';
$lastmod = '2005-01-01';

$index = new SitemapIndex();
$index->addSitemap($location, $lastmod);
```

### Get the number of sitemaps

[](#get-the-number-of-sitemaps)

```
$index = new SitemapIndex();
$index->getSitemapsCount();
```

### Get a list of sitemaps

[](#get-a-list-of-sitemaps)

```
$index = new SitemapIndex();
$index->getSitemaps();
```

### Get the xml string of the sitemaps

[](#get-the-xml-string-of-the-sitemaps)

```
$index = new SitemapIndex();
$index->getContent();
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1544d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6352d87faeaa45b2da5e0872605cfd08d9a25851f0a54424399c58b8a4f1a14b?d=identicon)[litlife](/maintainers/litlife)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[intervention/zodiac

Zodiac Sign Calculator

58191.7k](/packages/intervention-zodiac)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[solspace/craft-calendar

The most powerful event management and calendaring plugin!

1830.8k1](/packages/solspace-craft-calendar)

PHPackages © 2026

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