You are here

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

Overrides StreamDestination::checkWritable

File

src/Core/Destination/BrowserDownloadDestination.php, line 75

Class

BrowserDownloadDestination
@package Drupal\backup_migrate\Core\Destination

Namespace

Drupal\backup_migrate\Core\Destination

Code

public function checkWritable() {

  // Check that we're running as a web process via a browser.
  // @todo we could check if the 'HTTP_ACCEPT' header contains the right mime but that is probably overkill.
  if (!isset($_SERVER['REQUEST_METHOD'])) {
    throw new DestinationNotWritableException("The download destination only works when accessed through a http client.");
  }
}