AjaxResponse Class Reference
[Ajax]

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

List of all members.

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.


Detailed Description

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

Definition at line 17 of file AjaxResponse.php.


Constructor & Destructor Documentation

AjaxResponse::__construct ( text = NULL  ) 

Definition at line 40 of file AjaxResponse.php.

References $text, and addText().


Member Function Documentation

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

Definition at line 71 of file AjaxResponse.php.

Referenced by checkLastModified().

AjaxResponse::loadFromMemcached ( mckey,
touched 
)

Definition at line 199 of file AjaxResponse.php.

References $mckey, $wgMemc, and wfDebug().

AjaxResponse::printText (  ) 

Output text.

Definition at line 83 of file AjaxResponse.php.

References print.

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  ) 

Definition at line 67 of file AjaxResponse.php.

References $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 
)

Definition at line 218 of file AjaxResponse.php.

References $mckey, $wgMemc, and wfTimestampNow().


Member Data Documentation

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]

HTTP header Content-Type.

Definition at line 23 of file AjaxResponse.php.

AjaxResponse::$mDisabled [private]

Disables output.

Can be set by calling $AjaxResponse->disable()

Definition at line 26 of file AjaxResponse.php.

AjaxResponse::$mLastModified [private]

Date for the HTTP header Last-modified.

Definition at line 29 of file AjaxResponse.php.

AjaxResponse::$mResponseCode [private]

HTTP response code.

Definition at line 32 of file AjaxResponse.php.

AjaxResponse::$mText [private]

Content of our HTTP response.

Definition at line 38 of file AjaxResponse.php.

AjaxResponse::$mVary [private]

HTTP Vary header.

Definition at line 35 of file AjaxResponse.php.


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

Generated on Sat Sep 5 02:08:29 2009 for MediaWiki by  doxygen 1.5.9