Download the PHP package creativefactoryrv/cartographer without Composer
On this page you can find all versions of the php package creativefactoryrv/cartographer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download creativefactoryrv/cartographer
More information about creativefactoryrv/cartographer
Files in creativefactoryrv/cartographer
Package cartographer
Short Description A PHP sitemap generation tool.
License MIT
Informations about the package cartographer
Cartographer
A sitemap generation tool for PHP following the Sitemap Protocol v0.9, based on the work of Dan Horrigan (tackk/cartographer).
This fork was originally created to address vulnerabilities arising from outdated dependencies and along the way became compatible with PHP 8, bringing the original features into the current context.
Cartographer can handle Sitemaps of any size. When generating sitemaps with more than 50,000 entries, the sitemap becomes a "map of maps" (i.e. nested sitemaps).
Supported PHP/HHVM Versions
- PHP: >= 8.0.2
Installation
Composer CLI
composer.json
Basic Sitemap
If you have a sitemap that is under 50,000 items, you can just use the Sitemap class, and avoid the Sitemap Generator.
Output
Basic Sitemap Index
If you want to build a Sitemap Index, separate from the Sitemap Generator, you can!
Output
Sitemap Factory
The Sitemap Factory create Sitemaps and Sitemap Indexes and writes them to the Filesystem. It can be used to generate full Sitemaps with more than 50,000 URLs.
If more than one sitemap is generated, it will create a Sitemap Index automatically.
Instantiating
The factory uses Flysystem to write the sitemaps. This means you can write the sitemaps to Local Disk, S3, Dropbox, wherever you want.
Base URL
The Base URL is used when generating the Sitemap Indexes, and for the returned entry point URL.
You can set the Base URL:
You can get the current base URL using getBaseUrl()
.
Creating a Sitemap
To create a sitemap you use the createSitemap
method. This method requires an Iterator
as
its only parameter.
Return Value
The two creation methods (createSitemap
and createSitemapIndex
) will return the URL
of the root sitemap file. If there is only 1 sitemap created, it will return just that URL.
If multiple sitemaps are created, then a Sitemap Index is generated and the URL to that is returned.
List of Created Files
You can get a list (array) of files the Factory has created by using the getFilesCreated
method.
Running Tests
This assumes you ran composer update
.
From the repository root, run: