class FileAsset implements Asset

Represents an asset backed by a local file.

Supports getting dimensions of images and duration of audio files.

Methods

__construct(string $url, string $path)

No description

string
getUrl()

Returns the publicly accessible URL.

string
getPath()

Returns the absolute filesystem path to the source file.

string
__toString()

Allows direct echoing of the object to get the URL.

int
getWidth()

Returns the width in pixels for image files.

int
getHeight()

Returns the height in pixels for image files.

float
getDuration()

Returns the estimated duration in seconds for an MP3 audio file (assumes CBR).

Details

at line 20
__construct(string $url, string $path)

No description

Parameters

string $url
string $path

at line 30
string getUrl()

Returns the publicly accessible URL.

Return Value

string

at line 39
string getPath()

Returns the absolute filesystem path to the source file.

Return Value

string

at line 48
string __toString()

Allows direct echoing of the object to get the URL.

Return Value

string

at line 58
int getWidth()

Returns the width in pixels for image files.

Return Value

int

Exceptions

RuntimeException

at line 68
int getHeight()

Returns the height in pixels for image files.

Return Value

int

Exceptions

RuntimeException

at line 93
float getDuration()

Returns the estimated duration in seconds for an MP3 audio file (assumes CBR).

Return Value

float

Exceptions

RuntimeException