class RevisionCompiler implements CompilerInterface
Traits
Constants
| EMPTY_REVISION |
|
Properties
| protected callable[] | $sourcesCallbacks | from HasSources |
|
|
| protected array<string,string> | $pendingSidecars | Sidecar files (e.g. JsCompiler's `.map`) queued by renderOutput() during the current commit, written only if the primary file is — so an unchanged bundle rewrites nothing at all. |
|
Methods
No description
Recompile this asset and record its revision. Files are only written when the compiled output actually differs from what the revision manifest says is on disk (or the file has gone missing) — so routine rebuilds of unchanged assets are complete no-ops with zero writes.
Produce the exact bytes to write to the primary asset file, or null when there is nothing to write (empty sources). This is what the revision is hashed from, so it must be identical to what gets committed — subclasses that transform or add to the output (e.g. JsCompiler's sourcemap handling) override this and queue any sidecar files (like the `.map`) on {$pendingSidecars} rather than writing them, so sidecars are only written when the bundle itself is.
Details
in HasSources
at
line 25
void
addSources(callable $callback)
in HasSources
at
line 33
protected array
getSources()
at
line 191
protected array
allowedSourceTypes()
at
line 28
__construct(Cloud $assetsDir, string $filename, SettingsRepositoryInterface $settings, VersionerInterface $versioner)
at
line 36
string|null
getFilename()
at
line 41
void
setFilename(string $filename)
at
line 57
void
commit(bool $force = false)
Recompile this asset and record its revision. Files are only written when the compiled output actually differs from what the revision manifest says is on disk (or the file has gone missing) — so routine rebuilds of unchanged assets are complete no-ops with zero writes.
at
line 101
protected void
writePendingSidecars()
at
line 108
protected string
hashOutput(string $content)
at
line 124
protected string|null
renderOutput(array $sources)
Produce the exact bytes to write to the primary asset file, or null when there is nothing to write (empty sources). This is what the revision is hashed from, so it must be identical to what gets committed — subclasses that transform or add to the output (e.g. JsCompiler's sourcemap handling) override this and queue any sidecar files (like the `.map`) on {$pendingSidecars} rather than writing them, so sidecars are only written when the bundle itself is.