You are here

public function StreamDestination::checkWritable in Backup and Migrate 5.0.x

1 method overrides StreamDestination::checkWritable()
BrowserDownloadDestination::checkWritable in src/Core/Destination/BrowserDownloadDestination.php

File

src/Core/Destination/StreamDestination.php, line 39

Class

StreamDestination
@package Drupal\backup_migrate\Core\Destination

Namespace

Drupal\backup_migrate\Core\Destination

Code

public function checkWritable() {
  $stream_uri = $this
    ->confGet('streamuri');

  // The stream must exist.
  if (!file_exists($stream_uri)) {
    throw new DestinationNotWritableException('The file stream !uri does not exist.', [
      '%uri' => $stream_uri,
    ]);
  }

  // The stream must be writable.
  if (!file_exists($stream_uri)) {
    throw new DestinationNotWritableException('The file stream !uri cannot be written to.', [
      '%uri' => $stream_uri,
    ]);
  }
}