2017 © Pedro Peláez
 

library sitemap

Create a sitemap for your site creaws any URL and creates a sitemap

image

adamb/sitemap

Create a sitemap for your site creaws any URL and creates a sitemap

  • Tuesday, July 17, 2018
  • by AdamBinnersley
  • Repository
  • 1 Watchers
  • 0 Stars
  • 26 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

PHP XML Sitemap Generator

Generate a XML sitemap for a given URL. This class crawls any given website to create an XML sitemap for the domain., (*1)

Installation

Installation is available via Composer/Packagist, you can add the following line to your composer.json file:, (*2)

"adamb/sitemap": "^1.0"

or, (*3)

composer require adamb/sitemap

Usage

Example of usage can be found below:, (*4)


// Method 1 $sitemap = new Sitemap\Sitemap('http://www.yourwebsite.co.uk'); $sitemap->createSitemap(); // Returns true if sitemap created else will return false // Method 2 $sitemap = new Sitemap\Sitemap(); $sitemap->setDomain('http://www.yourwebsite.co.uk'); $sitemap->createSitemap(); // Returns true if sitemap created else will return false

Change file creation location

By default the sitemap.xml file is created in the document root but this can be altered using the following method., (*5)


$sitemap = new Sitemap\Sitemap('http://www.yourwebsite.co.uk'); // This should be an absolute path $sitemap->setFilePath($_SERVER['DOCUMENT_ROOT'].'sitemaps/'); // or $sitemap->setFilePath('C:\Inetpub\mywebsite.co.uk\httpdocs\sitemaps\\'); $sitemap->createSitemap();

Sitemap creation options

By default the sitemap creates a XSL stylesheet along with the sitemap. You can also change the level of the link to include in the sitemap (e.g. Only include links within 3 clicks of the homepage) and also change the filename of the sitemap on creation., (*6)


// To not include the XSL stylesheet set the first value to false when calling createSitemap(); $sitemap->createSitemap(false); // To only include links within 3 click set the second value to 3 $sitemap->createSitemap(true, 3); // To change the filename set the third value to your filename (excluding extension) $sitemap->createSitemap(true, 5, 'mysitemapfile');

The Versions

17/07 2018

dev-master

9999999-dev

Create a sitemap for your site creaws any URL and creates a sitemap

  Sources   Download

MIT

The Requires

 

The Development Requires

17/07 2018

v1.0.6

1.0.6.0

Create a sitemap for your site creaws any URL and creates a sitemap

  Sources   Download

MIT

The Requires

 

The Development Requires

25/11 2017

v1.0.5

1.0.5.0

Create a sitemap for your site creaws any URL and creates a sitemap

  Sources   Download

MIT

The Requires

 

The Development Requires

25/11 2017

v1.0.4

1.0.4.0

Create a sitemap for your site creaws any URL and creates a sitemap

  Sources   Download

MIT

The Requires

 

The Development Requires

24/06 2017

v1.0.3

1.0.3.0

Create a sitemap for your site creaws any URL and creates a sitemap

  Sources   Download

MIT

The Requires

 

11/05 2017

v1.0.1

1.0.1.0

Create a sitemap for your site creaws any URL and creates a sitemap

  Sources   Download

MIT

The Requires