PHP Class Craft\Minimee_RemoteAssetModel

Inheritance: extends Minimee_BaseAssetModel
Datei anzeigen Open project: johndwells/craft.minimee

Protected Properties

Property Type Description
$_client

Public Methods

Method Description
__construct ( $attributes = [], ClientInterface $client = null )
exists ( ) : Bool Always will return true, since it is too expensive to fetch a remote file
getContents ( ) : String Get the contents of the remote asset.
getFilenameUrlWithProtocol ( ) : String Returns the filename URL with a valid protocol
getLastTimeModified ( ) : craft\DateTime Return a very old DateTime, since it is too expensive to fetch a remote file's headers
setAttribute ( String $name, Mixed $value ) Attribute mutators

Protected Methods

Method Description
_getInstanceOfClient ( ) Either create a fresh instance of Guzzle\Http\Client, or pass the instance we were given during instantiation.
_sendClientRequest ( ) Prepare & return response from sending a client request

Method Details

__construct() public method

public __construct ( $attributes = [], ClientInterface $client = null )
$client ClientInterface

_getInstanceOfClient() protected method

Either create a fresh instance of Guzzle\Http\Client, or pass the instance we were given during instantiation.
protected _getInstanceOfClient ( )

_sendClientRequest() protected method

Prepare & return response from sending a client request
protected _sendClientRequest ( )

exists() public method

Always will return true, since it is too expensive to fetch a remote file
public exists ( ) : Bool
return Bool

getContents() public method

Get the contents of the remote asset.
public getContents ( ) : String
return String

getFilenameUrlWithProtocol() public method

cURL can't (yet?) handle protocol relative URLs, so we match the session and use a secure or unsecure protocol to fetch the remote URLs contents.
public getFilenameUrlWithProtocol ( ) : String
return String

getLastTimeModified() public method

Return a very old DateTime, since it is too expensive to fetch a remote file's headers
public getLastTimeModified ( ) : craft\DateTime
return craft\DateTime

setAttribute() public method

Attribute mutators
public setAttribute ( String $name, Mixed $value )
$name String
$value Mixed

Property Details

$_client protected_oe property

protected $_client