You are here

class FileUploadSecureValidatorServiceProvider in File Upload Secure Validator 8

Dynamically register a fileinfo validator service.

Registers only if the fileinfo extension is available.

Hierarchy

Expanded class hierarchy of FileUploadSecureValidatorServiceProvider

File

src/FileUploadSecureValidatorServiceProvider.php, line 14

Namespace

Drupal\file_upload_secure_validator
View source
class FileUploadSecureValidatorServiceProvider implements ServiceModifierInterface {

  /**
   * {@inheritdoc}
   */
  public function alter(ContainerBuilder $container) {
    if (!SymfonyFileinfoMimeTypeGuesser::isSupported()) {
      $container
        ->removeDefinition('file_upload_secure_validator');
    }
  }

}

Members