[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> Sitemapper.php (summary)

Sitemap handling functions

Author: Michael Hamann
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 220 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 2 classes

Sitemapper:: (5 methods):
  generate()
  getXML()
  getFilePath()
  sitemapIsCompressed()
  pingSearchEngines()

SitemapItem:: (3 methods):
  __construct()
  createFromID()
  toXML()


Class: Sitemapper  - X-Ref

A class for building sitemaps and pinging search engines with the sitemap URL.

generate()   X-Ref
Builds a Google Sitemap of all public pages known to the indexer

The map is placed in the cache directory named sitemap.xml.gz - This
file needs to be writable!

author: Michael Hamann
author: Andreas Gohr
link: https://www.google.com/webmasters/sitemaps/docs/en/about.html
link: http://www.sitemaps.org/
return: bool

getXML($items)   X-Ref
Builds the sitemap XML string from the given array auf SitemapItems.

param: $items array The SitemapItems that shall be included in the sitemap.
author: Michael Hamann
return: string The sitemap XML.

getFilePath()   X-Ref
Helper function for getting the path to the sitemap file.

author: Michael Hamann
return: string The path to the sitemap file.

sitemapIsCompressed()   X-Ref
Helper function for checking if the sitemap is compressed

return: bool If the sitemap file is compressed

pingSearchEngines()   X-Ref
Pings search engines with the sitemap url. Plugins can add or remove
urls to ping using the SITEMAP_PING event.

author: Michael Hamann
return: bool

Class: SitemapItem  - X-Ref

An item of a sitemap.

__construct($url, $lastmod, $changefreq = null, $priority = null)   X-Ref
Create a new item.

param: string $url        The url of the item
param: int    $lastmod    Timestamp of the last modification
param: string $changefreq How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
param: $priority float|string The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0.

createFromID($id, $changefreq = null, $priority = null)   X-Ref
Helper function for creating an item for a wikipage id.

param: string       $id         A wikipage id.
param: string       $changefreq How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never.
param: float|string $priority   The priority of the item relative to other URLs on your site. Valid values     range from 0.0 to 1.0.
return: SitemapItem The sitemap item.

toXML()   X-Ref
Get the XML representation of the sitemap item.

return: string The XML representation.