Elgg  Version master
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 (protected Config $config, protected SystemCache $cache, protected\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_'
 
 $client
 

Detailed Description

Fetch external images server side.

Definition at line 17 of file ImageFetcherService.php.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 33 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 53 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 112 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 126 of file ImageFetcherService.php.

Member Data Documentation

Elgg\Assets\ImageFetcherService::$client
protected

Definition at line 24 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: