\Fuman_Util_Sitemap

Renders an XML Sitemap for Google and other Search Engines

Summary

Methods
Properties
Constants
__construct()
getLastModDate()
addUri()
sortXML()
sort()
getXML()
No public properties found
CFREQ_ALWAYS
CFREQ_HOURLY
CFREQ_DAILY
CFREQ_WEEKLY
CFREQ_MONTHLY
CFREQ_YEARLY
CFREQ_NEVER
No protected methods found
No protected properties found
N/A
preXML()
innerXML()
postXML()
render()
$_uriContainer
$_xml
$_charset
N/A

Constants

CFREQ_ALWAYS

CFREQ_ALWAYS

CFREQ_HOURLY

CFREQ_HOURLY

CFREQ_DAILY

CFREQ_DAILY

CFREQ_WEEKLY

CFREQ_WEEKLY

CFREQ_MONTHLY

CFREQ_MONTHLY

CFREQ_YEARLY

CFREQ_YEARLY

CFREQ_NEVER

CFREQ_NEVER

Properties

$_uriContainer

$_uriContainer : array

Holds all the Uris

Type

array

$_xml

$_xml : string

The rendered XML

Type

string

$_charset

$_charset : string

Charset for XML and Content-Type Header

Type

string

Methods

__construct()

__construct(string  $charset = 'utf-8') : \Fuman_Util_Sitemap

Constructor

Parameters

string $charset

Returns

\Fuman_Util_Sitemap

getLastModDate()

getLastModDate(integer  $timestamp) : string

Gets last modification date

Parameters

integer $timestamp

Returns

string

addUri()

addUri(string  $loc, float  $priority = 0.5, integer|null  $changefreq = null, integer|null  $lastMod = null, boolean  $image = false, array  $languages = null) : void

Adds an Uri to the XML

Parameters

string $loc
float $priority

Priority From 0 to 1

integer|null $changefreq
integer|null $lastMod
boolean $image
array $languages

| lang => uri

sortXML()

sortXML() : \void;

Sorts the XML by Priority

Returns

\void;

sort()

sort(object  $a, object  $b) : integer

Custom Function for uasort

Parameters

object $a
object $b

Returns

integer

getXML()

getXML(boolean  $return = true, string  $contentType = 'text/xml') : string|void

Returns the xml or flushes it, depends on $return

Parameters

boolean $return

Wheater the XML should be returnes as String or flushes

string $contentType

Content- Type fpr Header

Returns

string|void —

Depends on $return

preXML()

preXML() : void

Sets XML Data Header

innerXML()

innerXML() : void

Renders all items in uriContainer to xml

postXML()

postXML() : void

Sets End of XML

render()

render() : void

Renders the xml