You are here

public function TempFileAdapter::__construct in Backup and Migrate 5.0.x

Construct a manager.

Parameters

string $dir: A file path or stream URL for the temp directory.

string $prefix: A string prefix to add to each created file.

1 call to TempFileAdapter::__construct()
DrupalTempFileAdapter::__construct in src/Drupal/File/DrupalTempFileAdapter.php
Construct a manager.
1 method overrides TempFileAdapter::__construct()
DrupalTempFileAdapter::__construct in src/Drupal/File/DrupalTempFileAdapter.php
Construct a manager.

File

src/Core/File/TempFileAdapter.php, line 43

Class

TempFileAdapter
A very basic temp file manager.

Namespace

Drupal\backup_migrate\Core\File

Code

public function __construct($dir, $prefix = 'bam') {

  // Add a trailing slash if needed.
  if (substr($dir, -1) !== '/') {
    $dir .= '/';
  }
  $this->dir = $dir;
  $this->prefix = $prefix;
  $this->tempfiles = [];

  // @todo check that temp directory is writeable or throw an exception.
}