Conneg Class Reference
The class that manage the content negotiation between any web service. More...
Public Member Functions | |
| __construct ($accept="", $accept_charset="", $accept_encoding="", $accept_language="", $supported_serializations) | |
| Constructor. | |
| __destruct () | |
| respond () | |
| Send an answer to the requester. | |
| getAccept () | |
| Get the mime type of the query. | |
| getAcceptCharset () | |
| Get the charset of the query. | |
| getAcceptEncoding () | |
| Get the encoding of the query. | |
| getAcceptLanguage () | |
| Get the language of the query. | |
| setStatus ($status) | |
| Set the status of the query. | |
| setStatusMsg ($statusMsg) | |
| Set the message of the status of the query. | |
| setStatusMsgExt ($statusMsgExt) | |
| Set the extended message of the status of the query. | |
| setError ($id, $webservice, $name, $description, $debugInfo, $level) | |
| Set the error message to embed in the body of the HTTP message. | |
| getStatus () | |
| Get the status of the query. | |
| getStatusMsg () | |
| Get the message of the status of the query. | |
| getStatusMsgExt () | |
| Get the extended message of the status of the query. | |
| getMime () | |
| Get the mime of the query . | |
| accept ($header) | |
| Check if a query mime is accepted and set the status of the query accordingly. | |
| accept_charset ($header) | |
| Check if a query charset is accepted and set the status of the query accordingly. | |
| accept_encoding ($header) | |
| Check if a query encoding is accepted and set the status of the query accordingly. | |
| accept_language ($header) | |
| Check if a query language is accepted and set the status of the query accordingly. | |
Data Fields | |
| $error | |
| Error structure that handle error reporting to users. | |
Private Attributes | |
| $mime = "text/plain" | |
| Mime type of the query. | |
| $charset = "utf-8" | |
| Charset of the query. | |
| $encoding = "identity" | |
| Encoding of the query. | |
| $lang = "en" | |
| Language of the query. | |
| $status = 200 | |
| Status of the query. | |
| $statusMsg = "OK" | |
| Status message of the query. | |
| $statusMsgExt = "" | |
| Extended message of the status of the query. | |
| $supported_serializations = "" | |
| Supported serializations by the service hanlding this query. | |
Detailed Description
The class that manage the content negotiation between any web service.
Definition at line 25 of file Conneg.php.
Constructor & Destructor Documentation
| __construct | ( | $ | accept = "", |
|
| $ | accept_charset = "", |
|||
| $ | accept_encoding = "", |
|||
| $ | accept_language = "", |
|||
| $ | supported_serializations | |||
| ) |
Constructor.
- Parameters:
-
[in] $accept Accepted mime type(s) for the query [in] $accept_charset Accepted charset for the query [in] $accept_encoding Accepted encoding for the query [in] $accept_language Accepted language for the query [in] $supported_serializations Supported serializations by the target service
- Returns:
- returns NULL
Definition at line 70 of file Conneg.php.
References $supported_serializations, accept(), accept_charset(), accept_encoding(), and accept_language().

| __destruct | ( | ) |
Definition at line 93 of file Conneg.php.
Referenced by respond().
Member Function Documentation
| accept | ( | $ | header | ) |
Check if a query mime is accepted and set the status of the query accordingly.
- Parameters:
-
[in] $header HTTP header of the query
Definition at line 318 of file Conneg.php.
References $mime.
Referenced by __construct().
| accept_charset | ( | $ | header | ) |
Check if a query charset is accepted and set the status of the query accordingly.
- Parameters:
-
[in] $header HTTP header of the query
Definition at line 623 of file Conneg.php.
References $charset.
Referenced by __construct().
| accept_encoding | ( | $ | header | ) |
Check if a query encoding is accepted and set the status of the query accordingly.
- Parameters:
-
[in] $header HTTP header of the query
- Bug:
- With a Post query using HTTPService of Flex, apparently the Encoding header create a 406 here.
Definition at line 711 of file Conneg.php.
References $encoding.
Referenced by __construct().
| accept_language | ( | $ | header | ) |
Check if a query language is accepted and set the status of the query accordingly.
- Parameters:
-
[in] $header HTTP header of the query
- Bug:
- With a Post query using HTTPService of Flex, apparently the Language header create a 406 here.
Definition at line 800 of file Conneg.php.
Referenced by __construct().
| getAccept | ( | ) |
Get the mime type of the query.
- Returns:
- returns accepted mime type
Definition at line 135 of file Conneg.php.
| getAcceptCharset | ( | ) |
Get the charset of the query.
- Returns:
- returns the accepted charset of the query
Definition at line 147 of file Conneg.php.
| getAcceptEncoding | ( | ) |
Get the encoding of the query.
- Returns:
- returns the accepted encoding of the query
Definition at line 159 of file Conneg.php.
| getAcceptLanguage | ( | ) |
Get the language of the query.
- Returns:
- returns the language charset of the query
Definition at line 171 of file Conneg.php.
| getMime | ( | ) |
Get the mime of the query
.
- Returns:
- returns the mime of the query
Definition at line 306 of file Conneg.php.
| getStatus | ( | ) |
Get the status of the query.
- Returns:
- returns the status of the query
Definition at line 271 of file Conneg.php.
| getStatusMsg | ( | ) |
Get the message of the status of the query.
- Returns:
- returns the message of the status of the query
Definition at line 283 of file Conneg.php.
| getStatusMsgExt | ( | ) |
Get the extended message of the status of the query.
- Returns:
- returns the extended message of the status of the query
Definition at line 295 of file Conneg.php.
| respond | ( | ) |
Send an answer to the requester.
Definition at line 103 of file Conneg.php.
References __destruct().

| setError | ( | $ | id, | |
| $ | webservice, | |||
| $ | name, | |||
| $ | description, | |||
| $ | debugInfo, | |||
| $ | level | |||
| ) |
Set the error message to embed in the body of the HTTP message.
- Parameters:
-
[in] $id ID of the error [in] $webservice URI of the web service that caused this error [in] $name Name of the error [in] $description Description of the error [in] $debugInfo Debug information for this error [in] $level Error level of the error (warning, error, fatal)
- Returns:
- returns NULL
Definition at line 226 of file Conneg.php.
References $description, and $mime.
| setStatus | ( | $ | status | ) |
Set the status of the query.
- Returns:
- returns the status that has been setted.
Definition at line 183 of file Conneg.php.
References $status.
| setStatusMsg | ( | $ | statusMsg | ) |
Set the message of the status of the query.
- Returns:
- returns the message of the status that has been setted.
Definition at line 195 of file Conneg.php.
References $statusMsg.
| setStatusMsgExt | ( | $ | statusMsgExt | ) |
Set the extended message of the status of the query.
- Returns:
- returns the extended message of the status that has been setted.
Definition at line 207 of file Conneg.php.
References $statusMsgExt.
Field Documentation
$charset = "utf-8" [private] |
$encoding = "identity" [private] |
| $error |
Error structure that handle error reporting to users.
Definition at line 52 of file Conneg.php.
$lang = "en" [private] |
Language of the query.
Definition at line 37 of file Conneg.php.
$mime = "text/plain" [private] |
Mime type of the query.
Definition at line 28 of file Conneg.php.
Referenced by accept(), and setError().
$status = 200 [private] |
$statusMsg = "OK" [private] |
Status message of the query.
Definition at line 43 of file Conneg.php.
Referenced by setStatusMsg().
$statusMsgExt = "" [private] |
Extended message of the status of the query.
Definition at line 46 of file Conneg.php.
Referenced by setStatusMsgExt().
$supported_serializations = "" [private] |
Supported serializations by the service hanlding this query.
Definition at line 49 of file Conneg.php.
Referenced by __construct().
The documentation for this class was generated from the following file:
