Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Tar.php

function Tar::__construct

Constructs a Tar object.

Parameters

string $file_path: The full system path of the archive to manipulate. Only local files are supported. If the file does not yet exist, it will be created if appropriate.

array $configuration: (Optional) settings to open the archive with the following keys:

  • 'compress': Indicates if the 'gzip', 'bz2', or 'lzma2' compression is required.
  • 'buffer_length': Length of the read buffer in bytes.

Throws

\Drupal\Core\Archiver\ArchiverException

File

core/lib/Drupal/Core/Archiver/Tar.php, line 32

Class

Tar
Defines an archiver implementation for .tar files.

Namespace

Drupal\Core\Archiver

Code

public function __construct($file_path, array $configuration = []) {
    $compress = $configuration['compress'] ?? NULL;
    $buffer = $configuration['buffer_length'] ?? 512;
    $this->tar = new ArchiveTar($file_path, $compress, $buffer);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal