PHP Class Devise\Media\MediaPaths

Mostrar archivo Open project: devisephp/cms

Public Methods

Method Description
__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)
basePath ( ) : string Gets the basepath for us
downloadFromUrl ( $path, $newFilePath = null ) : string Downloads the image so that we can re-use it later and crop it and resize it accordingly
fileExists ( $mediapath ) : boolean Check to see if a file exists or not
fileVersionInfo ( $filePath ) : stdClass Gets the versioned path to this file
fileVersionInfoFromUrl ( $url ) : stdClass Gets the versioned path to this $url path
imageCaptionPath ( $imagePath ) : string Get caption path from image path
isUrlPath ( $url ) : boolean Returns true or false depending on if this is an image url or not
makeRelativePath ( $path ) : string Make this path relative to public directory
touch ( $mediapath ) Create an empty file in this location
zencoderUrl ( $filename ) : string Returns the zencoder url for this filename

Method Details

__construct() public method

Create a new Media Path Helper the purpose of this class is to determine paths for media (and versions of media)
public __construct ( string $basepath = null, string $baseurl = null, null $Config = null )
$basepath string
$baseurl string
$Config null

basePath() public method

Gets the basepath for us
public basePath ( ) : string
return string

downloadFromUrl() public method

Downloads the image so that we can re-use it later and crop it and resize it accordingly
public downloadFromUrl ( $path, $newFilePath = null ) : string
$path
return string

fileExists() public method

Check to see if a file exists or not
public fileExists ( $mediapath ) : boolean
$mediapath
return boolean

fileVersionInfo() public method

Gets the versioned path to this file
public fileVersionInfo ( $filePath ) : stdClass
$filePath
return stdClass

fileVersionInfoFromUrl() public method

Gets the versioned path to this $url path
public fileVersionInfoFromUrl ( $url ) : stdClass
$url
return stdClass

imageCaptionPath() public method

Get caption path from image path
public imageCaptionPath ( $imagePath ) : string
return string

isUrlPath() public method

Returns true or false depending on if this is an image url or not
public isUrlPath ( $url ) : boolean
$url
return boolean

makeRelativePath() public method

Make this path relative to public directory
public makeRelativePath ( $path ) : string
$path
return string

touch() public method

Create an empty file in this location
public touch ( $mediapath )
$mediapath

zencoderUrl() public method

Returns the zencoder url for this filename
public zencoderUrl ( $filename ) : string
$filename
return string