|
MediaWiki
REL1_19
|
Handle responses for Ajax requests (send headers, print content, that sort of thing) More...
Public Member Functions | |
| __construct ($text=null) | |
| addText ($text) | |
| Add content to the response. | |
| checkLastModified ($timestamp) | |
| checkLastModified tells the client to use the client-cached response if possible. | |
| disable () | |
| loadFromMemcached ($mckey, $touched) | |
| printText () | |
| Output text. | |
| sendHeaders () | |
| Construct the header and output it. | |
| setCacheDuration ($duration) | |
| setContentType ($type) | |
| setResponseCode ($code) | |
| setVary ($vary) | |
| 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. | |
| $mText | |
| Content of our HTTP response. | |
| $mVary | |
| HTTP Vary header. | |
Handle responses for Ajax requests (send headers, print content, that sort of thing)
Definition at line 15 of file AjaxResponse.php.
| AjaxResponse::__construct | ( | $ | text = null | ) |
Definition at line 37 of file AjaxResponse.php.
References addText().

| AjaxResponse::addText | ( | $ | text | ) |
Add content to the response.
Definition at line 73 of file AjaxResponse.php.
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 145 of file AjaxResponse.php.
References $fname, $wgCacheEpoch, $wgCachePages, $wgUser, disable(), setResponseCode(), wfDebug(), and wfTimestamp().

Definition at line 68 of file AjaxResponse.php.
Referenced by checkLastModified().

| AjaxResponse::loadFromMemcached | ( | $ | mckey, |
| $ | touched | ||
| ) |
| $mckey | |
| $touched |
Definition at line 201 of file AjaxResponse.php.
References $wgMemc, and wfDebug().

Construct the header and output it.
Definition at line 87 of file AjaxResponse.php.
References $n, $wgUseESI, and $wgUseSquid.
| AjaxResponse::setCacheDuration | ( | $ | duration | ) |
Definition at line 52 of file AjaxResponse.php.
| AjaxResponse::setContentType | ( | $ | type | ) |
Definition at line 64 of file AjaxResponse.php.
| AjaxResponse::setResponseCode | ( | $ | code | ) |
Definition at line 60 of file AjaxResponse.php.
Referenced by checkLastModified().

| AjaxResponse::setVary | ( | $ | vary | ) |
Definition at line 56 of file AjaxResponse.php.
| AjaxResponse::storeInMemcached | ( | $ | mckey, |
| $ | expiry = 86400 |
||
| ) |
| $mckey | |
| $expiry | int |
Definition at line 229 of file AjaxResponse.php.
References $wgMemc, and wfTimestampNow().

AjaxResponse::$mCacheDuration [private] |
Number of seconds to get the response cached by a proxy.
Definition at line 17 of file AjaxResponse.php.
AjaxResponse::$mContentType [private] |
HTTP header Content-Type.
Definition at line 20 of file AjaxResponse.php.
AjaxResponse::$mDisabled [private] |
Disables output.
Can be set by calling $AjaxResponse->disable()
Definition at line 23 of file AjaxResponse.php.
AjaxResponse::$mLastModified [private] |
Date for the HTTP header Last-modified.
Definition at line 26 of file AjaxResponse.php.
AjaxResponse::$mResponseCode [private] |
HTTP response code.
Definition at line 29 of file AjaxResponse.php.
AjaxResponse::$mText [private] |
Content of our HTTP response.
Definition at line 35 of file AjaxResponse.php.
AjaxResponse::$mVary [private] |
HTTP Vary header.
Definition at line 32 of file AjaxResponse.php.