Helpers
final class Helpers
Static helper class providing utility functions for working with assets.
Constants
private ExtensionToMime |
|
Methods
Creates an Asset instance. The asset type is detected by 'mimeType' if provided in $args, otherwise is guessed from the file extension of $path or $url.
No description
Splits a potentially qualified reference 'mapper:reference' into a [mapper, reference] array.
Validates an array of options against allowed optional and required keys.
Estimates the duration (in seconds) of an MP3 file, assuming constant bitrate (CBR).
No description
Details
at line 33
static Asset
createAssetFromUrl(string $url, string|null $path = null, array $args = [])
Creates an Asset instance. The asset type is detected by 'mimeType' if provided in $args, otherwise is guessed from the file extension of $path or $url.
at line 52
static string|null
guessMimeTypeFromExtension(string $url)
No description
at line 64
static array
parseReference(string $qualifiedRef)
Splits a potentially qualified reference 'mapper:reference' into a [mapper, reference] array.
at line 77
static void
checkOptions(array $array, array $optional = [], array $required = [])
Validates an array of options against allowed optional and required keys.
at line 92
static float
guessMP3Duration(string $path)
Estimates the duration (in seconds) of an MP3 file, assuming constant bitrate (CBR).
at line 118
static string|null
detectDevServer(string $infoFile)
No description