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

__construct(VersionerInterface $versioner)

No description

string
token()

No description

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.

Details

__construct(VersionerInterface $versioner)

Parameters

VersionerInterface $versioner

string token()

Return Value

string

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.

Parameters

array $revisions

Return Value

string