jResponseSitemap

Extends \jResponse

Sitemap 0.9 response

package

jelix

subpackage

core_response

link

http://www.sitemaps.org/

since 1.2

Methods

constructor

__construct() 
inherited

check if the request is of type GET or HEAD

_checkRequestType() 
inherited

Normalize a date into GMT format

_normalizeDate(mixed $date) : string
inherited

Arguments

$date

mixed

Can be a jDateTime object, a DateTime object or a string understandable by strtotime

Response

string

a date in GMT format

Parse urls.xml and return pathinfo URLs

_parseUrlsXml() : array

Response

array

add an http header to the response.

addHttpHeader(string $htype, string $hcontent, integer $overwrite = true) 
inherited

will be send during the output of the response

Arguments

$htype

string

the header type ("Content-Type", "Date-modified"...)

$hcontent

string

value of the header type

$overwrite

integer

false or 0 if the value should be set only if it doesn't still exist -1 to add the header with the existing values true or 1 to replace the existing header

add a URL in a sitemap file

addSitemap(string $loc, string $lastmod = null) : boolean

Arguments

$loc

string

URL of sitemap file

$lastmod

string

The date of last modification of the sitemap file

Response

boolean

true if addition is ok, else false

add a URL in a sitemap file

addUrl(string $loc, string $lastmod = null, string $changefreq = null, string $priority = null) : boolean

Arguments

$loc

string

URL of the page

$lastmod

string

The date of last modification of the file

$changefreq

string

How frequently the page is likely to change

$priority

string

The priority of this URL relative to other URLs

Response

boolean

true if addition is ok, else false

Clean the differents caches headers

cleanCacheHeaders() 
inherited

delete all http headers

clearHttpHeaders() 
inherited

return the format type name (eg the family type name)

getFormatType() : string
inherited

Response

string

the name

return the response type name

getType() : string
inherited final

Response

string

the name

Return pathinfo URLs automatically from urls.xml

getUrlsFromUrlsXml() : array

Response

array

Add URLs automatically from urls.xml

importFromUrlsXml() : void

Use the HTPP headers Last-Modified to see if the ressource in client cache is fresh

isValidCache(mixed $dateLastModified = null,  $etag = null, boolean $cleanCacheHeader = true) : boolean
inherited

Arguments

$dateLastModified

mixed

Can be a jDateTime object, a DateTime object or a string understandable by strtotime

$etag

$cleanCacheHeader

boolean

True for clean/delete other cache headers. Default : true.

Response

boolean

True if the client ressource version is fresh, false otherwise

Generate the content and send it Errors are managed

output() : boolean
final

Response

boolean

true if generation is ok, else false

Send a response with a generic error message.

outputErrors() 
inherited

Submitting a sitemap by sending an HTTP request

ping( $uri) : boolean

Arguments

$uri

Response

boolean

send http headers

sendHttpHeaders() 
inherited

Set an expires header to the page/ressource.

setExpires( $date,  $cleanCacheHeader = true) 
inherited
see \_normalizeDate

Arguments

$date

$cleanCacheHeader

set the http status code for the http header

setHttpStatus(string $code, string $msg) 
inherited

Arguments

$code

string

the status code (200, 404...)

$msg

string

the message following the status code ("OK", "Not Found"..)

Set a life time for the page/ressource.

setLifetime(integer $time, boolean $sharedCache = false,  $cleanCacheHeader = true) 
inherited

Arguments

$time

integer

Time during which the page will be cached. Express in seconds.

$sharedCache

boolean

True if the lifetime concern a public/shared cache. Default : false.

$cleanCacheHeader

Properties

ident of the response type

_type : string
inherited
var

ident of the response type

Type(s)

string

Frequency change url

allowedChangefreq : array
var

Type(s)

array

Maximum number of URLs for a sitemap index file

maxSitemap : integer
var

Type(s)

integer

Maximum number of URLs for a sitemap file

maxUrl : integer
var

Type(s)

integer

List of URLs for a sitemap index file

urlSitemap : \array()
var

Type(s)

\array()

List of URLs for a sitemap file

urlList : \array()
var

Type(s)

\array()

The template container

content : \jTpl
var

Type(s)

\jTpl

Selector of the template file

contentTpl : string
var

Type(s)

string

list of http headers that will be send to the client

_httpHeaders : array
inherited
var

list of http headers that will be send to the client

Type(s)

array

indicates if http headers have already been sent to the client

_httpHeadersSent : boolean
inherited
var

indicates if http headers have already been sent to the client

Type(s)

boolean

the http status code to send

_httpStatusCode : string
inherited
var

the http status code to send

Type(s)

string

the http status message to send

_httpStatusMsg : string
inherited
var

the http status message to send

Type(s)

string

Should we output only the headers or the entire response

_outputOnlyHeaders : boolean
inherited
var

Should we output only the headers or the entire response

Type(s)

boolean

httpVersion

httpVersion : 
inherited

Type(s)

forcedHttpVersion

forcedHttpVersion : 
inherited

Type(s)