MediaWiki  REL1_19
AjaxResponse Class Reference

Handle responses for Ajax requests (send headers, print content, that sort of thing) More...

List of all members.

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.

Detailed Description

Handle responses for Ajax requests (send headers, print content, that sort of thing)

Definition at line 15 of file AjaxResponse.php.


Constructor & Destructor Documentation

AjaxResponse::__construct ( text = null)

Definition at line 37 of file AjaxResponse.php.

References addText().

Here is the call graph for this function:


Member Function Documentation

AjaxResponse::addText ( text)

Add content to the response.

Definition at line 73 of file AjaxResponse.php.

Referenced by __construct().

Here is the caller graph for this function:

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().

Here is the call graph for this function:

Definition at line 68 of file AjaxResponse.php.

Referenced by checkLastModified().

Here is the caller graph for this function:

AjaxResponse::loadFromMemcached ( mckey,
touched 
)
Parameters:
$mckey
$touched
Returns:
bool

Definition at line 201 of file AjaxResponse.php.

References $wgMemc, and wfDebug().

Here is the call graph for this function:

Output text.

Definition at line 80 of file AjaxResponse.php.

References print.

Construct the header and output it.

Definition at line 87 of file AjaxResponse.php.

References $n, $wgUseESI, and $wgUseSquid.

Definition at line 52 of file AjaxResponse.php.

Definition at line 64 of file AjaxResponse.php.

Definition at line 60 of file AjaxResponse.php.

Referenced by checkLastModified().

Here is the caller graph for this function:

AjaxResponse::setVary ( vary)

Definition at line 56 of file AjaxResponse.php.

AjaxResponse::storeInMemcached ( mckey,
expiry = 86400 
)
Parameters:
$mckey
$expiryint
Returns:
bool

Definition at line 229 of file AjaxResponse.php.

References $wgMemc, and wfTimestampNow().

Here is the call graph for this function:


Member Data Documentation

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.


The documentation for this class was generated from the following file: