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 (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 18 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 49 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 87 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 146 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 160 of file ImageFetcherService.php.

Member Data Documentation

Elgg\Assets\ImageFetcherService::$cache
protected

Definition at line 25 of file ImageFetcherService.php.

Elgg\Assets\ImageFetcherService::$client
protected

Definition at line 30 of file ImageFetcherService.php.

Elgg\Assets\ImageFetcherService::$config
protected

Definition at line 35 of file ImageFetcherService.php.

Elgg\Assets\ImageFetcherService::$session
protected

Definition at line 40 of file ImageFetcherService.php.

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

Definition at line 20 of file ImageFetcherService.php.


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