class MediaPaths
Class MediaPaths abstracts away paths that we can use and also has a few helper methods for other classes to use
Methods
|
__construct(string $basepath = null, string $baseurl = null, null $Config = null)
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 $mediapath)
Check to see if a file exists or not |
|
|
touch($mediapath $mediapath)
Create an empty file in this location |
||
| stdClass |
fileVersionInfoFromUrl($url $url)
Gets the versioned path to this $url path |
|
| stdClass |
fileVersionInfo($filePath $filePath)
Gets the versioned path to this file |
|
| string |
makeRelativePath($path $path)
Make this path relative to public directory |
|
| string |
zencoderUrl($filename $filename)
Returns the zencoder url for this filename |
|
| string |
downloadFromUrl($path, $newFilePath = null)
Downloads the image so that we can re-use it later and crop it and resize it accordingly |
|
| boolean |
isUrlPath($url $url)
Returns true or false depending on if this is an image url or not |
Details
at line 22
public
__construct(string $basepath = null, string $baseurl = null, null $Config = null)
Create a new Media Path Helper the purpose of this class is to determine paths for media (and versions of media)
at line 34
public string
basePath()
Gets the basepath for us
at line 45
public boolean
fileExists($mediapath $mediapath)
Check to see if a file exists or not
at line 54
public
touch($mediapath $mediapath)
Create an empty file in this location
at line 72
public stdClass
fileVersionInfoFromUrl($url $url)
Gets the versioned path to this $url path
at line 103
public stdClass
fileVersionInfo($filePath $filePath)
Gets the versioned path to this file
at line 161
public string
makeRelativePath($path $path)
Make this path relative to public directory
at line 172
public string
zencoderUrl($filename $filename)
Returns the zencoder url for this filename
at line 190
public string
downloadFromUrl($path, $newFilePath = null)
Downloads the image so that we can re-use it later and crop it and resize it accordingly
at line 225
public boolean
isUrlPath($url $url)
Returns true or false depending on if this is an image url or not