function ArchiveTar::addString

This method add a single string as a file at the end of the existing archive. If the archive does not yet exists it is created.

@access public

Parameters

string $p_filename A string which contains the full: * filename path that will be associated * with the string.

string $p_string The content of the file added in: * the archive.

Return value

true on success, false on error.

File

drupal/core/lib/Drupal/Component/Archiver/ArchiveTar.php, line 442

Class

ArchiveTar
Creates a (compressed) Tar archive

Namespace

Drupal\Component\Archiver

Code

function addString($p_filename, $p_string) {
  $v_result = true;
  if (!$this
    ->_isArchive()) {
    if (!$this
      ->_openWrite()) {
      return false;
    }
    $this
      ->_close();
  }
  if (!$this
    ->_openAppend()) {
    return false;
  }

  // Need to check the get back to the temporary file ? ....
  $v_result = $this
    ->_addString($p_filename, $p_string);
  $this
    ->_writeFooter();
  $this
    ->_close();
  return $v_result;
}