CacheEvent
in package
FinalYes
What a `Cache::listen()` listener receives -- the PHP counterpart of the Elixir original's `[:cooper, :cache, :file_changed]` and `[:cooper, :cache, :env_changed]` telemetry events.
FILE_CHANGED: a previously cached entry was found stale because a contributing file's modification time changed, and has just been re-parsed.$changedlists those files. Never fired for an entry's first population.ENV_CHANGED: an environment variable that shaped a cached tree (a${?NAME}guard,${NAME}in an import path or an interpolated key) has a different value now, so the entry was dropped and the file re-parsed.$changedlists those names.
Table of Contents
Constants
- ENV_CHANGED : mixed = 'env_changed'
- FILE_CHANGED : mixed = 'file_changed'
Properties
Methods
- __construct() : mixed
Constants
ENV_CHANGED
public
mixed
ENV_CHANGED
= 'env_changed'
FILE_CHANGED
public
mixed
FILE_CHANGED
= 'file_changed'
Properties
$changed read-only
public
array<string|int, mixed>
$changed
$path read-only
public
string
$path
$root read-only
public
string
$root
$time read-only
public
float
$time
$type read-only
public
string
$type
Methods
__construct()
public
__construct(string $type, string $path, string $root, array<int, string> $changed, float $time) : mixed
Parameters
- $type : string
-
FILE_CHANGEDorENV_CHANGED - $path : string
-
the cached entry file's absolute path
- $root : string
-
the root its bare imports resolve against
- $changed : array<int, string>
-
the changed files, or the changed variable names
- $time : float
-
when it happened, as a Unix timestamp with microseconds