System\Classes\ResizeImages

ResizeImages is used for resizing image files

Protected properties

protected array $availableSources

availableSources to get image paths

protected static $instance

Public methods

public void __clone()

public void __wakeup()

public static void forgetInstance()

Forget this singleton's instance if it exists

public void getContents($cacheKey)

getContents

Parameters
  • $cacheKey

public void getOutputPath()

getOutputPath returns the final resource path

public void getPublicPath()

getPublicPath returns the public address for the resources path

public void getTempPath()

getTempPath returns an internal working path

public void init()

init is a singleton constructor

public static void instance()

Create a new instance of this singleton.

public static void resetCache()

Resets the resizer cache

public static void resize($image, $width=NULL, $height=NULL, $options=array())

resize

Parameters
  • $image
  • $width
  • $height
  • $options

Protected methods

protected void __construct()

Constructor.

protected void getAvailableSources()

getAvailableSources returns available sources

protected array getCache(string $cacheKey)

Look up information about a cache identifier.

Parameters
  • string $cacheKey - Cache identifier

protected void getCacheKey($payload)

getCacheKey builds a unique string based on assets

Parameters
  • $payload

protected void getDefaultResizeOptions($overrideOptions=array())

getDefaultResizeOptions returns the default thumbnail options

Parameters
  • $overrideOptions

protected void getResizeFilename($id, $width, $height, $options)

getResizeFilename generates a thumbnail filename

Parameters
  • $id
  • $width
  • $height
  • $options

protected void getResizedUrl($outputFilename='undefined.css')

getResizedUrl

Parameters
  • $outputFilename

protected string parseFileName($filePath)

Parse the file name to get a relative path for the file

Parameters
  • $filePath

protected void prepareRequest($image, $width=NULL, $height=NULL, $options=array())

prepareRequest

Parameters
  • $image
  • $width
  • $height
  • $options

protected void processImage($image)

processImage

Parameters
  • $image

protected bool putCache(string $cacheKey, array $cacheInfo)

Stores information about a asset collection against a cache identifier.

Parameters
  • string $cacheKey - Cache identifier.
  • array $cacheInfo - List of asset files.

protected bool putCacheIndex(string $cacheKey)

Adds a cache identifier to the index store used for performing a reset of the cache.

Parameters
  • string $cacheKey - Cache identifier