mediatekformation

JsonManifestVersionStrategy
in package
implements VersionStrategyInterface

Reads the versioned path of an asset from a JSON manifest file.

For example, the manifest file might look like this: { "main.js": "main.abc123.js", "css/styles.css": "css/styles.555abc.css" }

You could then ask for the version of "main.js" or "css/styles.css".

Interfaces, Classes, Traits and Enums

VersionStrategyInterface
Asset version strategy interface.

Table of Contents

$manifestData  : mixed
$manifestPath  : mixed
__construct()  : mixed
applyVersion()  : string
Applies version to the supplied path.
getVersion()  : string
With a manifest, we don't really know or care about what the version is. Instead, this returns the path to the versioned file.
getManifestPath()  : string|null

Properties

Methods

__construct()

public __construct(string $manifestPath) : mixed
Parameters
$manifestPath : string

Absolute path to the manifest file

Return values
mixed

applyVersion()

Applies version to the supplied path.

public applyVersion(mixed $path) : string
Parameters
$path : mixed

A path

Return values
string

The versionized path

getVersion()

With a manifest, we don't really know or care about what the version is. Instead, this returns the path to the versioned file.

public getVersion(mixed $path) : string
Parameters
$path : mixed

A path

Return values
string

The version string

getManifestPath()

private getManifestPath(string $path) : string|null
Parameters
$path : string
Return values
string|null

Search results