jResponseAtom10
extends jResponseXMLFeed
in package
Atom 1.0 response
Known limitations : only text in the title, and only name in categories
Tags
Table of Contents
- $charset : string
- charset used in the channel
- $forcedHttpVersion : mixed
- $httpVersion : mixed
- $infos : jXMLFeedInfo
- informations about the channel
- $itemList : array<string|int, jXMLFeedItem>
- array of channel item
- $lang : string
- Language used in the channel
- $_httpHeaders : array<string|int, mixed>
- $_httpHeadersSent : bool
- $_httpStatusCode : string
- $_httpStatusMsg : string
- $_mainTpl : string
- template name
- $_outputOnlyHeaders : bool
- $_template : jtpl
- Template engine used for output
- $_type : mixed
- $_xsl : mixed
- Array containing the XSL stylesheets links
- __construct() : void
- Class constructor
- addHttpHeader() : mixed
- add an http header to the response.
- addItem() : mixed
- register an item in the channel
- addOptionals() : mixed
- addXSLStyleSheet() : mixed
- cleanCacheHeaders() : mixed
- Clean the differents caches headers
- clearHttpHeaders() : mixed
- delete all http headers
- createItem() : jXMLFeedItem
- create a new item
- getFormatType() : string
- return the format type name (eg the family type name)
- getType() : string
- return the response type name
- isValidCache() : bool
- Use the HTPP headers Last-Modified to see if the ressource in client cache is fresh
- output() : bool
- Generate the content and send it Errors are managed
- outputErrors() : mixed
- Send a response with a generic error message.
- setExpires() : mixed
- Set an expires header to the page/ressource.
- setHttpStatus() : mixed
- set the http status code for the http header
- setLifetime() : mixed
- Set a life time for the page/ressource.
- _checkRequestType() : mixed
- check if the request is of type GET or HEAD
- _normalizeDate() : string
- Normalize a date into GMT format
- _outputOptionals() : mixed
- _outputXmlHeader() : mixed
- sendHttpHeaders() : mixed
- send http headers
Properties
$charset
charset used in the channel
public
string
$charset
$forcedHttpVersion
public
mixed
$forcedHttpVersion
= alse
$httpVersion
public
mixed
$httpVersion
= '1.1'
$infos
informations about the channel
public
jXMLFeedInfo
$infos
=
ull
$itemList
array of channel item
public
array<string|int, jXMLFeedItem>
$itemList
= array()
$lang
Language used in the channel
public
string
$lang
$_httpHeaders
protected
array<string|int, mixed>
$_httpHeaders
= array()
list of http headers that will be send to the client
$_httpHeadersSent
protected
bool
$_httpHeadersSent
= alse
indicates if http headers have already been sent to the client
$_httpStatusCode
protected
string
$_httpStatusCode
= '200'
the http status code to send
$_httpStatusMsg
protected
string
$_httpStatusMsg
= 'OK'
the http status message to send
$_mainTpl
template name
protected
string
$_mainTpl
= ''
$_outputOnlyHeaders
protected
bool
$_outputOnlyHeaders
= alse
Should we output only the headers or the entire response
$_template
Template engine used for output
protected
jtpl
$_template
=
ull
$_type
protected
mixed
$_type
= 'atom1.0'
$_xsl
Array containing the XSL stylesheets links
protected
mixed
$_xsl
= array()
Methods
__construct()
Class constructor
public
__construct() : void
Return values
void —addHttpHeader()
add an http header to the response.
public
addHttpHeader(string $htype, string $hcontent[, int $overwrite = true ]) : mixed
will be send during the output of the response
Parameters
- $htype : string
-
the header type ("Content-Type", "Date-modified"...)
- $hcontent : string
-
value of the header type
- $overwrite : int = true
-
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
Return values
mixed —addItem()
register an item in the channel
public
addItem(jXMLFeedItem $item) : mixed
Parameters
- $item : jXMLFeedItem
Return values
mixed —addOptionals()
public
addOptionals(mixed $content) : mixed
Parameters
- $content : mixed
Return values
mixed —addXSLStyleSheet()
public
addXSLStyleSheet(mixed $src[, mixed $params = array() ]) : mixed
Parameters
- $src : mixed
- $params : mixed = array()
Return values
mixed —cleanCacheHeaders()
Clean the differents caches headers
public
cleanCacheHeaders() : mixed
Return values
mixed —clearHttpHeaders()
delete all http headers
public
clearHttpHeaders() : mixed
Return values
mixed —createItem()
create a new item
public
createItem(string $title, string $link, string $date) : jXMLFeedItem
Parameters
- $title : string
-
the item title
- $link : string
-
the link
- $date : string
-
the date of the item
Return values
jXMLFeedItem —getFormatType()
return the format type name (eg the family type name)
public
getFormatType() : string
Return values
string —the name
getType()
return the response type name
public
final getType() : string
Return values
string —the name
isValidCache()
Use the HTPP headers Last-Modified to see if the ressource in client cache is fresh
public
isValidCache([mixed $dateLastModified = null ][, mixed $etag = null ][, bool $cleanCacheHeader = true ]) : bool
Parameters
- $dateLastModified : mixed = null
-
Can be a jDateTime object, a DateTime object or a string understandable by strtotime
- $etag : mixed = null
- $cleanCacheHeader : bool = true
-
True for clean/delete other cache headers. Default : true.
Return values
bool —True if the client ressource version is fresh, false otherwise
output()
Generate the content and send it Errors are managed
public
final output() : bool
Return values
bool —true if generation is ok, else false
outputErrors()
Send a response with a generic error message.
public
outputErrors() : mixed
Return values
mixed —setExpires()
Set an expires header to the page/ressource.
public
setExpires(mixed $date[, mixed $cleanCacheHeader = true ]) : mixed
Parameters
- $date : mixed
- $cleanCacheHeader : mixed = true
Tags
Return values
mixed —setHttpStatus()
set the http status code for the http header
public
setHttpStatus(string $code, string $msg) : mixed
Parameters
- $code : string
-
the status code (200, 404...)
- $msg : string
-
the message following the status code ("OK", "Not Found"..)
Return values
mixed —setLifetime()
Set a life time for the page/ressource.
public
setLifetime(int $time[, bool $sharedCache = false ][, mixed $cleanCacheHeader = true ]) : mixed
Parameters
- $time : int
-
Time during which the page will be cached. Express in seconds.
- $sharedCache : bool = false
-
True if the lifetime concern a public/shared cache. Default : false.
- $cleanCacheHeader : mixed = true
Return values
mixed —_checkRequestType()
check if the request is of type GET or HEAD
protected
_checkRequestType() : mixed
Return values
mixed —_normalizeDate()
Normalize a date into GMT format
protected
_normalizeDate(mixed $date) : string
Parameters
- $date : mixed
-
Can be a jDateTime object, a DateTime object or a string understandable by strtotime
Return values
string —a date in GMT format
_outputOptionals()
protected
_outputOptionals() : mixed
Return values
mixed —_outputXmlHeader()
protected
_outputXmlHeader() : mixed
Return values
mixed —sendHttpHeaders()
send http headers
protected
sendHttpHeaders() : mixed