Same name and namespace in other branches
- 7.x-1.x ExifFactory.php \Drupal\exif\ExifFactory 1 comment
- 8.x-2.x src/ExifFactory.php \Drupal\exif\ExifFactory 1 comment
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
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
ExifFactory::getExifInterface | public static | function | Return configured exif parser. |
ExifFactory::getExtractionSolutions | public static | function | Return description of exif parser implementations. |