class ExifFactory in Exif 8.2
Same name and namespace in other branches
- 8 src/ExifFactory.php \Drupal\exif\ExifFactory
- 7 ExifFactory.php \Drupal\exif\ExifFactory
Class ExifFactory allow to get right implementation.
@package Drupal\exif
Hierarchy
- class \Drupal\exif\ExifFactory
Expanded class hierarchy of ExifFactory
3 files declare their use of ExifFactory
- ExifFieldWidgetBase.php in src/
Plugin/ Field/ FieldWidget/ ExifFieldWidgetBase.php - ExifSettingsController.php in src/
Controller/ ExifSettingsController.php - ExifSettingsForm.php in src/
Controller/ ExifSettingsForm.php
1 string reference to 'ExifFactory'
1 service uses ExifFactory
File
- src/
ExifFactory.php, line 12
Namespace
Drupal\exifView source
class ExifFactory {
/**
* Return description of exif parser implementations.
*
* @return array
* list names of parser implementations
*/
public static function getExtractionSolutions() {
return [
"simple_exiftool" => "exiftool",
"php_extensions" => "php extensions",
];
}
/**
* Return configured exif parser.
*
* @return \Drupal\exif\ExifInterface
* configured exif parser
*/
public static function getExifInterface() {
$config = Drupal::configFactory()
->get('exif.settings');
$extractionSolution = $config
->get('extraction_solution');
$useExifToolSimple = $extractionSolution == "simple_exiftool";
if (isset($useExifToolSimple) && $useExifToolSimple && SimpleExifToolFacade::checkConfiguration()) {
return SimpleExifToolFacade::getInstance();
}
else {
// Default case for now (same behavior as previous versions)
return ExifPHPExtension::getInstance();
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ExifFactory:: |
public static | function | Return configured exif parser. | |
ExifFactory:: |
public static | function | Return description of exif parser implementations. |