Download the PHP package cyberomulus/sitemap-generator without Composer
On this page you can find all versions of the php package cyberomulus/sitemap-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cyberomulus/sitemap-generator
More information about cyberomulus/sitemap-generator
Files in cyberomulus/sitemap-generator
Package sitemap-generator
Short Description SiteMapGenerator is a PHP library that makes it easy to generate a SiteMap and SiteMapIndex (including Google specific tags).
License MIT
Homepage https://github.com/cyberomulus/SiteMapGenerator
Informations about the package sitemap-generator
SiteMapGenerator
What is SiteMapGenerator ?
SiteMapGenerator is a PHP library that makes it easy to generate a SiteMap and SiteMapIndex (including Google specific tags).
How to install SiteMapGenerator
There are 2 ways to install SiteMapGenerator.
If you use Composer, SiteMapGenerator is available by Packagist.
Just add the dependencies to your composer.json:
{
"require": {
"cyberomulus/sitemap-generator": "~2.0"
}
}
Else, got to the page github of SiteMapGenerator and choose the release of your choice.
You can download the source code with the link 'Download ZIP'.
Place the directory in the ZIP in a lib folder (for example) of your project.
What I need to use SiteMapGenerator
It takes minimum PHP version 5.2.0 with XMLWriter extension enabled (it is enabled by default).
How to generate a SiteMapIndex
- Create one or more
SiteMapEntry
- Create one
SiteMapIndex
- Add all
SiteMapEntry
inSiteMapIndex
- Create a Formatter (example :
XMLFormatter
) - Use
Formatter::formatSiteMapIndex()
How to generate a SiteMap
- Create one or more
URLEntry
- Create one
SiteMap
- Add all
URLEntry
inSiteMap
- Create a Formatter (example :
XMLFormatter
) - Use
Formatter::formatSiteMap()
How to add Image for Google's extra
- Create one or more
GoogleImageEntry
- Add all
GoogleImageEntry
inURLEntry
How to not actived Google's extra
Juste set Parameter at false in constructor of SiteMap
.
All GoogleImageEntry are not displayed
How to create a formatter
Create a class extends Formatter
.
Example for generate a SiteMap with Google's extra
<urlset xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.test.com/ok.php</loc>
<lastmod>2015-05-17T15:04:38+02:00</lastmod>
<changefreq>daily</changefreq>
<priority>0.5</priority>
<image:image>
<image:loc>http://www.test.com/image/img1.jpg</image:loc>
<image:title>a title for image</image:title>
<image:caption>a caption for image</image:caption>
<image:geo_location>Brussels, Belgium</image:geo_location>
<image:license>http://www.test.com/image/license.txt</image:license>
</image:image>
<image:image>
<image:loc>http://www.test.com/image/img1.jpg</image:loc>
<image:title>a another title for image</image:title>
<image:caption>a another caption for image</image:caption>
<image:license>http://www.test.com/image/license.txt</image:license>
</image:image>
</url>
<url>
<loc>http://www.test.com/nice.php</loc>
<lastmod>2015-05-17T15:04:38+02:00</lastmod>
<changefreq>never</changefreq>
</url>
<url>
<loc>http://www.test.com/nice.php?test=ok&amp;restet=super</loc>
<lastmod>2015-05-17T15:04:38+02:00</lastmod>
<changefreq>never</changefreq>
</url>
</urlset>
Example for generate a SiteMapIndex
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>http://www.test.com/sitemap1.xml</loc>
<lastmod>2015-05-17T15:07:40+02:00</lastmod>
</sitemap>
<sitemap>
<loc>http://www.test.com/sitemap1.xml</loc>
<lastmod>2015-05-17T15:07:40+02:00</lastmod>
</sitemap>
<sitemap>
<loc>http://www.test.com/sitemap.php?code=3&amp;restet=super</loc>
<lastmod>2015-05-17T15:07:40+02:00</lastmod>
</sitemap>
</sitemapindex>
What license is SiteMapGenerator
SiteMapGenerator is under MIT license (license free).
You will find the license text in the file LICENSE.