Public Member Functions | |
__construct ($text=NULL) | |
setCacheDuration ($duration) | |
setVary ($vary) | |
setResponseCode ($code) | |
setContentType ($type) | |
disable () | |
addText ($text) | |
Add content to the response. | |
printText () | |
Output text. | |
sendHeaders () | |
Construct the header and output it. | |
checkLastModified ($timestamp) | |
checkLastModified tells the client to use the client-cached response if possible. | |
loadFromMemcached ($mckey, $touched) | |
storeInMemcached ($mckey, $expiry=86400) | |
Private Attributes | |
$mCacheDuration | |
Number of seconds to get the response cached by a proxy. | |
$mContentType | |
HTTP header Content-Type. | |
$mDisabled | |
Disables output. | |
$mLastModified | |
Date for the HTTP header Last-modified. | |
$mResponseCode | |
HTTP response code. | |
$mVary | |
HTTP Vary header. | |
$mText | |
Content of our HTTP response. |
Definition at line 17 of file AjaxResponse.php.
AjaxResponse::__construct | ( | $ | text = NULL |
) |
AjaxResponse::addText | ( | $ | text | ) |
Add content to the response.
Definition at line 76 of file AjaxResponse.php.
References $text.
Referenced by __construct().
AjaxResponse::checkLastModified | ( | $ | timestamp | ) |
checkLastModified tells the client to use the client-cached response if possible.
If sucessful, the AjaxResponse is disabled so that any future call to AjaxResponse::printText() have no effect. The method returns true iff the response code was set to 304 Not Modified.
Definition at line 151 of file AjaxResponse.php.
References $_SERVER, $fname, $wgCacheEpoch, $wgCachePages, $wgUser, disable(), setResponseCode(), wfDebug(), and wfTimestamp().
AjaxResponse::disable | ( | ) |
AjaxResponse::loadFromMemcached | ( | $ | mckey, | |
$ | touched | |||
) |
AjaxResponse::printText | ( | ) |
AjaxResponse::sendHeaders | ( | ) |
Construct the header and output it.
Definition at line 90 of file AjaxResponse.php.
References $n, $wgUseESI, and $wgUseSquid.
AjaxResponse::setCacheDuration | ( | $ | duration | ) |
Definition at line 55 of file AjaxResponse.php.
AjaxResponse::setContentType | ( | $ | type | ) |
AjaxResponse::setResponseCode | ( | $ | code | ) |
Definition at line 63 of file AjaxResponse.php.
References $code.
Referenced by checkLastModified().
AjaxResponse::setVary | ( | $ | vary | ) |
Definition at line 59 of file AjaxResponse.php.
AjaxResponse::storeInMemcached | ( | $ | mckey, | |
$ | expiry = 86400 | |||
) |
AjaxResponse::$mCacheDuration [private] |
Number of seconds to get the response cached by a proxy.
Definition at line 20 of file AjaxResponse.php.
AjaxResponse::$mContentType [private] |
AjaxResponse::$mDisabled [private] |
Disables output.
Can be set by calling $AjaxResponse->disable()
Definition at line 26 of file AjaxResponse.php.
AjaxResponse::$mLastModified [private] |
AjaxResponse::$mResponseCode [private] |
AjaxResponse::$mText [private] |
AjaxResponse::$mVary [private] |