Documentation

AbstractSurrogate
in package
implements SurrogateInterface

AbstractYes

Abstract class implementing Surrogate capabilities to Request and Response instances.

Tags
author

Fabien Potencier fabien@symfony.com

author

Robin Chalas robin.chalas@gmail.com

Table of Contents

Interfaces

SurrogateInterface

Properties

$contentTypes  : mixed
$phpEscapeMap  : mixed

Methods

__construct()  : mixed
addSurrogateCapability()  : mixed
Adds Surrogate-capability to the given Request.
createCacheStrategy()  : ResponseCacheStrategyInterface
Returns a new cache strategy instance.
handle()  : string
Handles a Surrogate from the cache.
hasSurrogateCapability()  : bool
Checks that at least one surrogate has Surrogate capability.
needsParsing()  : bool
Checks that the Response needs to be parsed for Surrogate tags.
removeFromControl()  : mixed
Remove the Surrogate from the Surrogate-Control header.

Properties

$phpEscapeMap

protected mixed $phpEscapeMap = [['<?', '<%', '<s', '<S'], ['<?php echo "<?"; ?>', '<?php echo "<%"; ?>', '<?php echo "<s"; ?>', '<?php echo "<S"; ?>']]

Methods

__construct()

public __construct([array<string|int, mixed> $contentTypes = ['text/html', 'text/xml', 'application/xhtml+xml', 'application/xml'] ]) : mixed
Parameters
$contentTypes : array<string|int, mixed> = ['text/html', 'text/xml', 'application/xhtml+xml', 'application/xml']

An array of content-type that should be parsed for Surrogate information (default: text/html, text/xml, application/xhtml+xml, and application/xml)

addSurrogateCapability()

Adds Surrogate-capability to the given Request.

public addSurrogateCapability(Request $request) : mixed
Parameters
$request : Request

handle()

Handles a Surrogate from the cache.

public handle(HttpCache $cache, string $uri, string $alt, bool $ignoreErrors) : string
Parameters
$cache : HttpCache
$uri : string
$alt : string

An alternative URI

$ignoreErrors : bool
Return values
string

hasSurrogateCapability()

Checks that at least one surrogate has Surrogate capability.

public hasSurrogateCapability(Request $request) : bool
Parameters
$request : Request
Return values
bool

needsParsing()

Checks that the Response needs to be parsed for Surrogate tags.

public needsParsing(Response $response) : bool
Parameters
$response : Response
Return values
bool

removeFromControl()

Remove the Surrogate from the Surrogate-Control header.

protected removeFromControl(Response $response) : mixed
Parameters
$response : Response

        
On this page

Search results