Tar
class Tar implements ArchiverInterface (View source)
Defines an archiver implementation for .tar files.
Properties
| protected ArchiveTar | $tar | The underlying ArchiveTar instance that does the heavy lifting. |
Methods
Constructs a Tar object.
Adds the specified file or directory to the archive.
Removes the specified file from the archive.
Extracts multiple files in the archive to the specified path.
Lists all files in the archive.
Retrieves the tar engine itself.
Details
__construct(string $file_path)
Constructs a Tar object.
$this
add(string $file_path)
Adds the specified file or directory to the archive.
$this
remove($file_path)
Removes the specified file from the archive.
$this
extract(string $path, array $files = [])
Extracts multiple files in the archive to the specified path.
array
listContents()
Lists all files in the archive.
Archive_Tar
getArchive()
Retrieves the tar engine itself.
In some cases it may be necessary to directly access the underlying Archive_Tar object for implementation-specific logic. This is for advanced use only as it is not shared by other implementations of ArchiveInterface.