You are here

public function FlysystemFactory::ensure in Flysystem 7

Same name and namespace in other branches
  1. 8 src/FlysystemFactory.php \Drupal\flysystem\FlysystemFactory::ensure()
  2. 3.x src/FlysystemFactory.php \Drupal\flysystem\FlysystemFactory::ensure()
  3. 2.0.x src/FlysystemFactory.php \Drupal\flysystem\FlysystemFactory::ensure()
  4. 3.0.x src/FlysystemFactory.php \Drupal\flysystem\FlysystemFactory::ensure()

Calls FlysystemPluginInterface::ensure() on each plugin.

Parameters

bool $force: (optional) Wheter to force the insurance. Defaults to false.

Return value

array Errors keyed by scheme.

File

src/FlysystemFactory.php, line 111
Contains \Drupal\flysystem\FlysystemFactory.

Class

FlysystemFactory
A factory for Flysystem filesystems.

Namespace

Drupal\flysystem

Code

public function ensure($force = FALSE) {
  $errors = array();
  foreach ($this->settings as $scheme => $configuration) {
    foreach ($this
      ->getPlugin($scheme)
      ->ensure($force) as $error) {
      $errors[$scheme][] = $error;
      watchdog('flysystem', $error['message'], $error['context'], $error['severity']);
    }
  }
  return $errors;
}