InitialisationMiddleware
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.
Properties
static private bool | $xss_protection_enabled | 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 |
|
static private bool | $egress_proxy_default_enabled | 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. |
|
static private string[] | $egress_proxy_exclude_domains | Configure the list of domains to bypass proxy by setting the NO_PROXY environment variable. |
|
static private string | $strict_transport_security | Provide a value for the HTTP Strict Transport Security header. |
Methods
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
Gets the uninherited value for the given config option
Details
static Config_ForClass
config()
Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).
mixed
stat(string $name)
deprecated
deprecated
Get inherited config value
mixed
uninherited(string $name)
Gets the uninherited value for the given config option
$this
set_stat(string $name, mixed $value)
deprecated
deprecated
Update the config value for a given property
HTTPResponse
process(HTTPRequest $request, callable $delegate)
Generate response for the given request