Elgg  Version 2.3
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
Elgg\Application\CacheHandler Class Reference

Public Member Functions

 __construct (Application $app, Config $config, $server_vars)
 Constructor. More...
 
 handleRequest ($path)
 Handle a request for a cached view. More...
 
 parsePath ($path)
 Parse a request. More...
 

Static Public Attributes

static $extensions
 
static static $utf8_content_types
 

Protected Member Functions

 isCacheableView ($view)
 Is the view cacheable. More...
 
 setupSimplecache ()
 Do a minimal engine load. More...
 
 sendCacheHeaders ($etag)
 Send cache headers. More...
 
 sendRevalidateHeaders ($etag)
 Send revalidate cache headers. More...
 
 handle304 ($etag)
 Send a 304 and exit() if the ETag matches the request. More...
 
 getContentType ($view)
 Get the content type. More...
 
 getProcessedView ($view, $viewtype)
 Get the contents of a view for caching. More...
 
 renderView ($view, $viewtype)
 Render a view for caching. More...
 
 send403 ($msg= 'Cache error:bad request')
 Send an error message to requestor. More...
 

Detailed Description

Definition at line 15 of file CacheHandler.php.

Constructor & Destructor Documentation

Elgg\Application\CacheHandler::__construct ( Application  $app,
Config  $config,
  $server_vars 
)

Constructor.

Parameters
Application$appElgg Application
Config$configElgg configuration
array$server_varsServer vars

Definition at line 63 of file CacheHandler.php.

Member Function Documentation

Elgg\Application\CacheHandler::getContentType (   $view)
protected

Get the content type.

Parameters
string$viewThe view name
Returns
string|null

Definition at line 309 of file CacheHandler.php.

Elgg\Application\CacheHandler::getProcessedView (   $view,
  $viewtype 
)
protected

Get the contents of a view for caching.

Parameters
string$viewThe view name
string$viewtypeThe viewtype
Returns
string
See also
CacheHandler::renderView()

Definition at line 353 of file CacheHandler.php.

Elgg\Application\CacheHandler::handle304 (   $etag)
protected

Send a 304 and exit() if the ETag matches the request.

Parameters
string$etagETag value
Returns
void

Definition at line 289 of file CacheHandler.php.

Elgg\Application\CacheHandler::handleRequest (   $path)

Handle a request for a cached view.

Parameters
array$pathURL path
Returns
void

Definition at line 75 of file CacheHandler.php.

Elgg\Application\CacheHandler::isCacheableView (   $view)
protected

Is the view cacheable.

Language views are handled specially.

Parameters
string$viewView name
Returns
bool

Definition at line 202 of file CacheHandler.php.

Elgg\Application\CacheHandler::parsePath (   $path)

Parse a request.

Parameters
string$pathRequest URL path
Returns
array Cache parameters (empty array if failure)

Definition at line 171 of file CacheHandler.php.

Elgg\Application\CacheHandler::renderView (   $view,
  $viewtype 
)
protected

Render a view for caching.

Language views are handled specially.

Parameters
string$viewThe view name
string$viewtypeThe viewtype
Returns
string

Definition at line 372 of file CacheHandler.php.

Elgg\Application\CacheHandler::send403 (   $msg = 'Cache error: bad request')
protected

Send an error message to requestor.

Parameters
string$msgOptional message text
Returns
void

Definition at line 406 of file CacheHandler.php.

Elgg\Application\CacheHandler::sendCacheHeaders (   $etag)
protected

Send cache headers.

Parameters
string$etagETag value
Returns
void

Definition at line 263 of file CacheHandler.php.

Elgg\Application\CacheHandler::sendRevalidateHeaders (   $etag)
protected

Send revalidate cache headers.

Parameters
string$etagETag value
Returns
void

Definition at line 276 of file CacheHandler.php.

Elgg\Application\CacheHandler::setupSimplecache ( )
protected

Do a minimal engine load.

Returns
void

Definition at line 214 of file CacheHandler.php.

Member Data Documentation

Elgg\Application\CacheHandler::$extensions
static
Initial value:
= [
'bmp' => "image/bmp"

Definition at line 17 of file CacheHandler.php.

static Elgg\Application\CacheHandler::$utf8_content_types
static
Initial value:
= [
"text/css",
"text/html",
"application/javascript",
"image/svg+xml",
"text/xml",
]

Definition at line 39 of file CacheHandler.php.


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