Skip to content
Corex

AssetManager

Corex\Assets\AssetManager · class · Core layer

Resolves an asset’s URL, filesystem path, and cache-busting version for a given base (spec 047) — url('images/logo.svg'), path(...), version('build/app.css'). Reads a build manifest (hashed filename + hash) when present, else the plain file; the version follows the environment (filemtime in local, manifest hash in production, framework/site version fallback). The base URL is supplied pre-normalised either as a string or as a lazy, site-aware resolver. Only that URL is memoized and invalidated on a blog switch; the manifest and fallback version remain file-derived and unchanged.

__construct(string $baseDir, Closure|string $baseUrlResolver, AssetEnvironment $environment, BuildManifest $manifest, string $fallbackVersion, AssetVersion $versioner)

Section titled “__construct(string $baseDir, Closure|string $baseUrlResolver, AssetEnvironment $environment, BuildManifest $manifest, string $fallbackVersion, AssetVersion $versioner)”