PHP Class Elgg\Application\CacheHandler

Datei anzeigen Open project: elgg/elgg

Public Properties

Property Type Description
$extensions
$utf8_content_types

Public Methods

Method Description
__construct ( Application $app, Config $config, array $server_vars ) Constructor
handleRequest ( array $path ) : void Handle a request for a cached view
parsePath ( string $path ) : array Parse a request

Protected Methods

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

Private Methods

Method Description
getViewFileType ( string $view ) : string Returns the type of output expected from the view.

Method Details

__construct() public method

Constructor
public __construct ( Application $app, Config $config, array $server_vars )
$app Elgg\Application Elgg Application
$config Elgg\Config Elgg configuration
$server_vars array Server vars

getContentType() protected method

Get the content type
protected getContentType ( string $view ) : string | null
$view string The view name
return string | null

getProcessedView() protected method

Get the contents of a view for caching
See also: CacheHandler::renderView()
protected getProcessedView ( string $view, string $viewtype ) : string
$view string The view name
$viewtype string The viewtype
return string

handle304() protected method

Send a 304 and exit() if the ETag matches the request
protected handle304 ( string $etag ) : void
$etag string ETag value
return void

handleRequest() public method

Handle a request for a cached view
public handleRequest ( array $path ) : void
$path array URL path
return void

isCacheableView() protected method

Is the view cacheable. Language views are handled specially.
protected isCacheableView ( string $view ) : boolean
$view string View name
return boolean

parsePath() public method

Parse a request
public parsePath ( string $path ) : array
$path string Request URL path
return array Cache parameters (empty array if failure)

renderView() protected method

Render a view for caching. Language views are handled specially.
protected renderView ( string $view, string $viewtype ) : string
$view string The view name
$viewtype string The viewtype
return string

send403() protected method

Send an error message to requestor
protected send403 ( string $msg = 'Cache error: bad request' ) : void
$msg string Optional message text
return void

sendCacheHeaders() protected method

Send cache headers
protected sendCacheHeaders ( string $etag ) : void
$etag string ETag value
return void

sendRevalidateHeaders() protected method

Send revalidate cache headers
protected sendRevalidateHeaders ( string $etag ) : void
$etag string ETag value
return void

setupSimplecache() protected method

Do a minimal engine load
protected setupSimplecache ( ) : void
return void

Property Details

$extensions public_oe static_oe property

public static $extensions

$utf8_content_types public_oe static_oe property

public static $utf8_content_types