class AssetsRevision
Produces a single token representing the current state of all compiled asset revisions, so a long-lived client can detect when the assets it booted with have been superseded (e.g. after a rebuild or extension toggle).
The token is derived solely from {[\Flarum\Frontend\Compiler\VersionerInterface::allRevisions()},](../../../Flarum/Frontend/Compiler/VersionerInterface.html) so it honours whatever versioner is bound — including a custom one. The same computation must be reproducible on the client from the `revisions` payload it boots with, so the manifest is canonicalised (sorted by key) before hashing.
Methods
Canonicalise a revisions map (sort by key) and hash it, so the server and client produce the same token from the same manifest regardless of order.
Details
at
line 24
__construct(VersionerInterface $versioner)
at
line 29
string
token()
at
line 42
static string
tokenFor(array $revisions)
Canonicalise a revisions map (sort by key) and hash it, so the server and client produce the same token from the same manifest regardless of order.