You are here

class ExifFactory in Exif 8

Same name and namespace in other branches
  1. 8.2 src/ExifFactory.php \Drupal\exif\ExifFactory
  2. 7 ExifFactory.php \Drupal\exif\ExifFactory

Class ExifFactory allow to get right implementation.

@package Drupal\exif

Hierarchy

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'
exif.services.yml in ./exif.services.yml
exif.services.yml
1 service uses ExifFactory
exif.metadata.reader_factory in ./exif.services.yml
Drupal\exif\ExifFactory

File

src/ExifFactory.php, line 12

Namespace

Drupal\exif
View 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

Namesort descending Modifiers Type Description Overrides
ExifFactory::getExifInterface public static function Return configured exif parser.
ExifFactory::getExtractionSolutions public static function Return description of exif parser implementations.