Function __global->tar_add_folder

Definitions

sources/tar.php

  • Add a folder to the TAR archive.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
&$resource array Yes No required parameter N/A N/A The TAR file handle
$log_file ?resource No No required parameter N/A N/A The logfile to write to (null: no logging)
$path PATH No No required parameter N/A N/A The full path to the folder to add
$max_size ?integer No No Null N/A N/A The maximum file size to add (null: no limit)
$subpath PATH No No Blank (empty string) N/A N/A The subpath relative to the path (should be left as the default '', as this is used for the recursion to distinguish the adding base path from where it's currently looking)
$avoid_backing_up array No No [] N/A N/A A map (filename=>true) of files to not back up
$root_only_dirs ?array No No Null N/A N/A A list of directories ONLY to back up from the root (null: no restriction)
$tick boolean No No False N/A N/A Whether to output spaces as we go to keep the connection alive
$ignore_bitmask ?integer No No 0 N/A N/A Bitmask of extra stuff to ignore (see IGNORE_* constants) (null: don't ignore anything)
$callback ?mixed No No Null N/A N/A Callback to run on each iteration (null: none)

Preview

Code (PHP)

/**
 * Add a folder to the TAR archive.
 *
 * @param  array $resource The TAR file handle
 * @param  ?resource $log_file The logfile to write to (null: no logging)
 * @param  PATH $path The full path to the folder to add
 * @param  ?integer $max_size The maximum file size to add (null: no limit)
 * @param  PATH $subpath The subpath relative to the path (should be left as the default '', as this is used for the recursion to distinguish the adding base path from where it's currently looking)
 * @param  array $avoid_backing_up A map (filename=>true) of files to not back up
 * @param  ?array $root_only_dirs A list of directories ONLY to back up from the root (null: no restriction)
 * @param  boolean $tick Whether to output spaces as we go to keep the connection alive
 * @param  ?integer $ignore_bitmask Bitmask of extra stuff to ignore (see IGNORE_* constants) (null: don't ignore anything)
 * @param  ?mixed $callback Callback to run on each iteration (null: none)
 */

function tar_add_folder(array &$resource, $log_file, string $path, ?int $max_size = null, string $subpath = '', array $avoid_backing_up = [], ?array $root_only_dirs = null, bool $tick = false, ?int $ignore_bitmask = 0, $callback = null)