class RequestFlushDiscoverer implements FlushDiscoverer (View source)

The default flush discovery implementation

  • if request has flush or URL is dev/build
  • AND in CLI or DEV mode
  • then flush

Properties

protected string $env

Environment type (dev, test or live)

protected HTTPRequest $request

Active request instance (session is not initialized yet!)

Methods

public
__construct(HTTPRequest $request, string $env)

Initialize it with active Request and Kernel

protected
null|bool
lookupRequest()

Checks whether the request contains any flush indicators

protected
bool|null
isAllowed()

Checks for permission to flush

public
null|bool
shouldFlush()

Check whether we have to flush manifest

Details

__construct(HTTPRequest $request, string $env)

Initialize it with active Request and Kernel

Parameters

HTTPRequest $request

instance of the request (session is not initialized yet!)

string $env

Environment type (dev, test or live)

protected null|bool lookupRequest()

Checks whether the request contains any flush indicators

Return Value

null|bool

flush or don't care

protected bool|null isAllowed()

Checks for permission to flush

Startup flush through a request is only allowed to CLI or DEV modes for security reasons

Return Value

bool|null

true for allow, false for denying, or null if don't care

null|bool shouldFlush()

Check whether we have to flush manifest

The return value is either null or a bool

  • null means the discoverer does not override the default behaviour (other discoverers decision)
  • bool means the discoverer wants to force flush or prevent it (true or false respectively)

Return Value

null|bool

null if don't care or bool to force or prevent flush