class FileConverterManager (View source)

This class holds a list of available file converters which it uses to convert files from one format to another.

Traits

Provides extensions to this object to integrate it with standard config API methods.

Config options

converters array

An array of classes or injector service names for classes that implement the FileConverter interface.

Properties

Methods

public static 
config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

public
mixed
uninherited(string $name)

Gets the uninherited value for the given config option

public
convert(File $from, string $toExtension, array $options = [])

Convert the file to the given format using the first available converter that can perform the conversion.

Details

static Config_ForClass config()

Get a configuration accessor for this class. Short hand for Config::inst()->get($this->class, .....).

Return Value

Config_ForClass

mixed uninherited(string $name)

Gets the uninherited value for the given config option

Parameters

string $name

Return Value

mixed

DBFile convert(File $from, string $toExtension, array $options = [])

Convert the file to the given format using the first available converter that can perform the conversion.

Parameters

File $from
string $toExtension

The file extension you want to convert to - e.g. "webp".

array $options

Any options defined for this converter which should apply to the conversion. Note that if a converter supports the conversion generally but doesn't support these options, that converter will not be used.

Return Value

DBFile

Exceptions

FileConverterException