BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
AjaxResponse Class Reference

Public Member Functions

 __construct ($text=null, Config $config=null)
 
 setCacheDuration ($duration)
 
 setVary ($vary)
 
 setResponseCode ($code)
 
 setContentType ($type)
 
 disable ()
 
 addText ($text)
 
 printText ()
 
 sendHeaders ()
 
 checkLastModified ($timestamp)
 
 loadFromMemcached ($mckey, $touched)
 
 storeInMemcached ($mckey, $expiry=86400)
 

Detailed Description

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

Constructor & Destructor Documentation

AjaxResponse::__construct (   $text = null,
Config  $config = null 
)
Parameters
string | null$text
Config | null$config

Member Function Documentation

AjaxResponse::addText (   $text)

Add content to the response

Parameters
string$text
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.

Parameters
string$timestamp
Returns
bool Returns true if the response code was set to 304 Not Modified.
AjaxResponse::disable ( )

Disable output.

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

Output text

AjaxResponse::sendHeaders ( )

Construct the header and output it

AjaxResponse::setCacheDuration (   $duration)

Set the number of seconds to get the response cached by a proxy

Parameters
int$duration
AjaxResponse::setContentType (   $type)

Set the HTTP header Content-Type

Parameters
string$type
AjaxResponse::setResponseCode (   $code)

Set the HTTP response code

Parameters
string$code
AjaxResponse::setVary (   $vary)

Set the HTTP Vary header

Parameters
string$vary
AjaxResponse::storeInMemcached (   $mckey,
  $expiry = 86400 
)
Parameters
string$mckey
int$expiry
Returns
bool

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