FilesystemMapper
class FilesystemMapper implements Mapper
Maps asset references to files within a specified local directory.
Supports versioning based on file modification time and optional extension auto-detection.
Methods
No description
Resolves a relative reference to a FileAsset within the configured base path.
Constructs the full public URL by prepending the base URL to the reference.
Constructs the full filesystem path by prepending the base path to the reference.
Builds the final public URL, potentially including a version query parameter.
Determines the version string for an asset, typically based on file modification time.
Appends the version string to the URL as a query parameter '?v=...'.
Details
at line 14
__construct(string $baseUrl, string $basePath, array $extensions = [])
No description
at line 27
Asset|null
getAsset(string $reference, array $options = [])
Resolves a relative reference to a FileAsset within the configured base path.
Attempts to find a matching extension if configured.
at line 42
string
resolveUrl(string $reference)
Constructs the full public URL by prepending the base URL to the reference.
at line 51
string
resolvePath(string $reference)
Constructs the full filesystem path by prepending the base path to the reference.
at line 60
protected string
buildUrl(string $reference, array $options)
Builds the final public URL, potentially including a version query parameter.
at line 73
protected string|null
getVersion(string $reference)
Determines the version string for an asset, typically based on file modification time.
at line 83
protected string
applyVersion(string $url, string $version)
Appends the version string to the URL as a query parameter '?v=...'.