Elgg  Version 5.1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\Assets\ImageFetcherService Class Reference

Fetch external images server side. More...

Public Member Functions

 __construct (Config $config, SystemCache $cache,\ElggSession $session)
 Constructor. More...
 
 getImage (string $image_url)
 Get an image. More...
 

Protected Member Functions

 loadFromCache (string $image_url)
 Load an image url from cache. More...
 
 saveToCache (string $image_url, array $data)
 Save image data in system cache for easy reuse. More...
 

Protected Attributes

const CACHE_PREFIX = 'image_fetcher_'
 
 $cache
 
 $client
 
 $config
 
 $session
 

Detailed Description

Fetch external images server side.

Definition at line 17 of file ImageFetcherService.php.

Constructor & Destructor Documentation

Elgg\Assets\ImageFetcherService::__construct ( Config  $config,
SystemCache  $cache,
\ElggSession  $session 
)

Constructor.

Parameters
Config$configconfig
SystemCache$cachethe system cache
\ElggSession$sessionthe current session

Definition at line 48 of file ImageFetcherService.php.

Member Function Documentation

Elgg\Assets\ImageFetcherService::getImage ( string  $image_url)

Get an image.

Parameters
string$image_urlthe image url to get
Exceptions

Definition at line 68 of file ImageFetcherService.php.

Elgg\Assets\ImageFetcherService::loadFromCache ( string  $image_url)
protected

Load an image url from cache.

Parameters
string$image_urlthe url to load
Returns
array

Definition at line 127 of file ImageFetcherService.php.

Elgg\Assets\ImageFetcherService::saveToCache ( string  $image_url,
array  $data 
)
protected

Save image data in system cache for easy reuse.

Parameters
string$image_urlthe image url
array$datathe image data
Returns
bool

Definition at line 141 of file ImageFetcherService.php.

Member Data Documentation

Elgg\Assets\ImageFetcherService::$cache
protected

Definition at line 24 of file ImageFetcherService.php.

Elgg\Assets\ImageFetcherService::$client
protected

Definition at line 29 of file ImageFetcherService.php.

Elgg\Assets\ImageFetcherService::$config
protected

Definition at line 34 of file ImageFetcherService.php.

Elgg\Assets\ImageFetcherService::$session
protected

Definition at line 39 of file ImageFetcherService.php.

const Elgg\Assets\ImageFetcherService::CACHE_PREFIX = 'image_fetcher_'
protected

Definition at line 19 of file ImageFetcherService.php.


The documentation for this class was generated from the following file: