Devise
Class

Devise\Media\Helpers\MediaPathHelper

class MediaPathHelper

Methods

__construct($basepath = null, $baseurl = null, Config $Config)

Create a new Media Path Helper the purpose of this class is to determine paths for media (and versions of media)

string basePath()

Gets the basepath for us

boolean fileExists($mediapath)

Check to see if a file exists or not

touch($mediapath)

Create an empty file in this location

fileVersionInfoFromUrl($url)

Gets the versioned path to this $url path

fileVersionInfo($filePath)

Gets the versioned path to this file

string makeRelativePath($path)

Make this path relative to public directory

string zencoderUrl($filename)

Returns the zencoder url for this filename

string downloadFromUrl($path)

Downloads the image so that we can re-use it later and crop it and resize it accordingly

boolean isUrlPath($url)

Returns true or false depending on if this is an image url or not

Details

at line 13
public __construct($basepath = null, $baseurl = null, Config $Config)

Create a new Media Path Helper the purpose of this class is to determine paths for media (and versions of media)

Parameters

$basepath
$baseurl
Config $Config

at line 25
public string basePath()

Gets the basepath for us

Return Value

string

at line 35
public boolean fileExists($mediapath)

Check to see if a file exists or not

Parameters

$mediapath

Return Value

boolean

at line 44
public touch($mediapath)

Create an empty file in this location

Parameters

$mediapath

at line 60
public fileVersionInfoFromUrl($url)

Gets the versioned path to this $url path

Parameters

$url

at line 88
public fileVersionInfo($filePath)

Gets the versioned path to this file

Parameters

$filePath

at line 145
public string makeRelativePath($path)

Make this path relative to public directory

Parameters

$path

Return Value

string

at line 155
public string zencoderUrl($filename)

Returns the zencoder url for this filename

Parameters

$filename

Return Value

string

at line 172
public string downloadFromUrl($path)

Downloads the image so that we can re-use it later and crop it and resize it accordingly

Parameters

$path

Return Value

string

at line 206
public boolean isUrlPath($url)

Returns true or false depending on if this is an image url or not

Parameters

$url

Return Value

boolean