You are here

function __flysystem_call_ensure in Flysystem 8

Same name and namespace in other branches
  1. 3.x flysystem.install \__flysystem_call_ensure()
  2. 2.0.x flysystem.install \__flysystem_call_ensure()
  3. 3.0.x flysystem.install \__flysystem_call_ensure()

Checks the state of existing configuratio.

1 call to __flysystem_call_ensure()
flysystem_requirements in ./flysystem.install
Implements hook_requirements().

File

./flysystem.install, line 82
Install, update and uninstall functions for the flysystem module.

Code

function __flysystem_call_ensure(array &$requirements) {
  foreach (\Drupal::service('flysystem_factory')
    ->ensure() as $scheme => $errors) {
    foreach ($errors as $error) {
      $requirements['flysystem:' . $scheme] = [
        'title' => \Drupal::translation()
          ->translate('Flysystem: @scheme', [
          '@scheme' => $scheme,
        ]),
        'description' => \Drupal::translation()
          ->translate($error['message'], $error['context']),
        'severity' => Convert::rfcToHookRequirements($error['severity']),
      ];
    }
  }
}