|
MediaWiki
master
|
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. More... | |
| checkLastModified ($timestamp) | |
| checkLastModified tells the client to use the client-cached response if possible. More... | |
| disable () | |
| Disable output. More... | |
| loadFromMemcached ($mckey, $touched) | |
| printText () | |
| Output text. More... | |
| sendHeaders () | |
| Construct the header and output it. More... | |
| setCacheDuration ($duration) | |
| Set the number of seconds to get the response cached by a proxy. More... | |
| setContentType ($type) | |
| Set the HTTP header Content-Type. More... | |
| setResponseCode ($code) | |
| Set the HTTP response code. More... | |
| setVary ($vary) | |
| Set the HTTP Vary header. More... | |
| storeInMemcached ($mckey, $expiry=86400) | |
Private Attributes | |
| $mCacheDuration | |
| Number of seconds to get the response cached by a proxy. More... | |
| Config | $mConfig |
| $mContentType | |
| HTTP header Content-Type. More... | |
| $mDisabled | |
| Disables output. More... | |
| $mLastModified | |
| Date for the HTTP header Last-modified. More... | |
| $mResponseCode | |
| HTTP response code. More... | |
| $mText | |
| Content of our HTTP response. More... | |
| $mVary | |
| HTTP Vary header. More... | |
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 82 of file AjaxResponse.php.
References addText(), and ConfigFactory\getDefaultInstance().
| AjaxResponse::addText | ( | $text | ) |
Add content to the response.
| string | $text |
Definition at line 141 of file AjaxResponse.php.
Referenced by __construct().
| 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 221 of file AjaxResponse.php.
References $fname, $timestamp, $wgCacheEpoch, $wgCachePages, $wgUser, disable(), global, setResponseCode(), TS_MW, TS_RFC2822, wfDebug(), and wfTimestamp().
| AjaxResponse::disable | ( | ) |
| AjaxResponse::loadFromMemcached | ( | $mckey, | |
| $touched | |||
| ) |
| string | $mckey | |
| int | $touched |
Definition at line 278 of file AjaxResponse.php.
References ObjectCache\getMainWANInstance(), and wfDebug().
| AjaxResponse::printText | ( | ) |
| AjaxResponse::sendHeaders | ( | ) |
Construct the header and output it.
Definition at line 159 of file AjaxResponse.php.
References HttpStatus\header().
| AjaxResponse::setCacheDuration | ( | $duration | ) |
Set the number of seconds to get the response cached by a proxy.
| int | $duration |
Definition at line 102 of file AjaxResponse.php.
| AjaxResponse::setContentType | ( | $type | ) |
Set the HTTP header Content-Type.
| string | $type |
Definition at line 126 of file AjaxResponse.php.
References $type.
| AjaxResponse::setResponseCode | ( | $code | ) |
Set the HTTP response code.
| string | $code |
Definition at line 118 of file AjaxResponse.php.
References $code.
Referenced by checkLastModified().
| AjaxResponse::setVary | ( | $vary | ) |
| AjaxResponse::storeInMemcached | ( | $mckey, | |
$expiry = 86400 |
|||
| ) |
| string | $mckey | |
| int | $expiry |
Definition at line 304 of file AjaxResponse.php.
References ObjectCache\getMainWANInstance(), and wfTimestampNow().
|
private |
Number of seconds to get the response cached by a proxy.
Definition at line 35 of file AjaxResponse.php.
|
private |
Definition at line 76 of file AjaxResponse.php.
|
private |
HTTP header Content-Type.
Definition at line 41 of file AjaxResponse.php.
|
private |
Disables output.
Can be set by calling $AjaxResponse->disable()
Definition at line 47 of file AjaxResponse.php.
|
private |
Date for the HTTP header Last-modified.
Definition at line 53 of file AjaxResponse.php.
|
private |
HTTP response code.
Definition at line 59 of file AjaxResponse.php.
|
private |
Content of our HTTP response.
Definition at line 71 of file AjaxResponse.php.
Referenced by printText().
|
private |
HTTP Vary header.
Definition at line 65 of file AjaxResponse.php.