class InitialisationMiddleware implements HTTPMiddleware (View source)

Initialises CWP-specific configuration settings, to avoid _config.php.

Traits

Provides extensions to this object to integrate it with standard config API methods.

Config options

xss_protection_enabled bool

Disable the automatically added 'X-XSS-Protection' header that is added to all responses. This should be left alone in most circumstances to include the header. Refer to Mozilla Developer Network for more information: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection

egress_proxy_default_enabled bool

Enable egress proxy. This works on the principle of setting http(s)_proxy environment variables, which will be automatically picked up by curl. This means RestfulService and raw curl requests should work out of the box. Stream-based requests need extra manual configuration.

egress_proxy_exclude_domains string[]

Configure the list of domains to bypass proxy by setting the NO_PROXY environment variable.

strict_transport_security string

Provide a value for the HTTP Strict Transport Security header.

Properties

Methods

public static 
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

public
mixed
stat(string $name) deprecated

Get inherited config value

public
mixed
uninherited(string $name)

Gets the uninherited value for the given config option

public
$this
set_stat(string $name, mixed $value) deprecated

Update the config value for a given property

public
process(HTTPRequest $request, callable $delegate)

Generate response for the given request

protected
configureEgressProxy()

If the outbound egress proxy details have been defined in environment variables, configure the proxy variables that are used to configure it.

protected
configureProxyDomainExclusions()

Configure any domains that should be excluded from egress proxy rules and provide them to the environment

Details

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed stat(string $name) deprecated

deprecated 5.0 Use ->config()->get() instead

Get inherited config value

Parameters

string $name

Return Value

mixed

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

$this set_stat(string $name, mixed $value) deprecated

deprecated 5.0 Use ->config()->set() instead

Update the config value for a given property

Parameters

string $name
mixed $value

Return Value

$this

HTTPResponse process(HTTPRequest $request, callable $delegate)

Generate response for the given request

Parameters

HTTPRequest $request
callable $delegate

Return Value

HTTPResponse

protected configureEgressProxy()

If the outbound egress proxy details have been defined in environment variables, configure the proxy variables that are used to configure it.

protected configureProxyDomainExclusions()

Configure any domains that should be excluded from egress proxy rules and provide them to the environment