MediaWiki
REL1_24
|
Handle responses for Ajax requests (send headers, print content, that sort of thing) More...
Public Member Functions | |
__construct ($text=null, Config $config=null) | |
addText ($text) | |
Add content to the response. | |
checkLastModified ($timestamp) | |
checkLastModified tells the client to use the client-cached response if possible. | |
disable () | |
Disable output. | |
loadFromMemcached ($mckey, $touched) | |
printText () | |
Output text. | |
sendHeaders () | |
Construct the header and output it. | |
setCacheDuration ($duration) | |
Set the number of seconds to get the response cached by a proxy. | |
setContentType ($type) | |
Set the HTTP header Content-Type. | |
setResponseCode ($code) | |
Set the HTTP response code. | |
setVary ($vary) | |
Set the HTTP Vary header. | |
storeInMemcached ($mckey, $expiry=86400) | |
Private Attributes | |
int | $mCacheDuration |
Number of seconds to get the response cached by a proxy $mCacheDuration. | |
Config | $mConfig |
string | $mContentType |
HTTP header Content-Type $mContentType. | |
bool | $mDisabled |
Disables output. | |
string bool | $mLastModified |
Date for the HTTP header Last-modified $mLastModified. | |
string | $mResponseCode |
HTTP response code $mResponseCode. | |
string | $mText |
Content of our HTTP response $mText. | |
string | $mVary |
HTTP Vary header $mVary. |
Handle responses for Ajax requests (send headers, print content, that sort of thing)
Definition at line 30 of file AjaxResponse.php.
AjaxResponse::__construct | ( | $ | text = null , |
Config $ | config = null |
||
) |
string | null | $text | |
Config | null | $config |
Definition at line 74 of file AjaxResponse.php.
AjaxResponse::addText | ( | $ | text | ) |
Add content to the response.
string | $text |
Definition at line 133 of file AjaxResponse.php.
AjaxResponse::checkLastModified | ( | $ | timestamp | ) |
checkLastModified tells the client to use the client-cached response if possible.
If successful, the AjaxResponse is disabled so that any future call to AjaxResponse::printText() have no effect.
string | $timestamp |
Definition at line 209 of file AjaxResponse.php.
Disable output.
Definition at line 125 of file AjaxResponse.php.
AjaxResponse::loadFromMemcached | ( | $ | mckey, |
$ | touched | ||
) |
Output text.
Definition at line 142 of file AjaxResponse.php.
Construct the header and output it.
Definition at line 151 of file AjaxResponse.php.
References print.
AjaxResponse::setCacheDuration | ( | $ | duration | ) |
Set the number of seconds to get the response cached by a proxy.
int | $duration |
Definition at line 94 of file AjaxResponse.php.
AjaxResponse::setContentType | ( | $ | type | ) |
Set the HTTP header Content-Type.
string | $type |
Definition at line 118 of file AjaxResponse.php.
AjaxResponse::setResponseCode | ( | $ | code | ) |
Set the HTTP response code.
string | $code |
Definition at line 110 of file AjaxResponse.php.
AjaxResponse::setVary | ( | $ | vary | ) |
AjaxResponse::storeInMemcached | ( | $ | mckey, |
$ | expiry = 86400 |
||
) |
int AjaxResponse::$mCacheDuration [private] |
Number of seconds to get the response cached by a proxy $mCacheDuration.
Definition at line 34 of file AjaxResponse.php.
Config AjaxResponse::$mConfig [private] |
Definition at line 68 of file AjaxResponse.php.
string AjaxResponse::$mContentType [private] |
HTTP header Content-Type $mContentType.
Definition at line 39 of file AjaxResponse.php.
bool AjaxResponse::$mDisabled [private] |
Disables output.
Can be set by calling $AjaxResponse->disable() $mDisabled
Definition at line 44 of file AjaxResponse.php.
string bool AjaxResponse::$mLastModified [private] |
Date for the HTTP header Last-modified $mLastModified.
Definition at line 49 of file AjaxResponse.php.
string AjaxResponse::$mResponseCode [private] |
HTTP response code $mResponseCode.
Definition at line 54 of file AjaxResponse.php.
string AjaxResponse::$mText [private] |
Content of our HTTP response $mText.
Definition at line 64 of file AjaxResponse.php.
string AjaxResponse::$mVary [private] |
HTTP Vary header $mVary.
Definition at line 59 of file AjaxResponse.php.