TAR

class OC\Archive\TAR
Source:lib/private/Archive/TAR.php#38
Parent:OC\Archive\Archive

Constants

PLAIN = 0
Source:lib/private/Archive/TAR.php#39
GZIP = 1
Source:lib/private/Archive/TAR.php#40
BZIP = 2
Source:lib/private/Archive/TAR.php#41

Properties

Methods

public OC\Archive\TAR::__construct($source)
Source:

lib/private/Archive/TAR.php#55

Parameters:
  • $source (string)
public static OC\Archive\TAR::getTarType($file)
try to detect the type of tar compression
Source:

lib/private/Archive/TAR.php#67

Parameters:
  • $file (string)
Returns:

int

public OC\Archive\TAR::addFolder($path)
add an empty folder to the archive
Source:

lib/private/Archive/TAR.php#93

Parameters:
  • $path (string)
Returns:

bool

public OC\Archive\TAR::addFile($path, $source="")
add a file to the archive
Source:

lib/private/Archive/TAR.php#121

Parameters:
  • $path (string)
  • $source (string) either a local file or string data
Returns:

bool

public OC\Archive\TAR::rename($source, $dest)
rename a file or folder in the archive
Source:

lib/private/Archive/TAR.php#141

Parameters:
  • $source (string)
  • $dest (string)
Returns:

bool

public OC\Archive\TAR::filesize($path)
get the uncompressed size of a file in the archive
Source:

lib/private/Archive/TAR.php#181

Parameters:
  • $path (string)
Returns:

int

public OC\Archive\TAR::mtime($path)
get the last modified time of a file in the archive
Source:

lib/private/Archive/TAR.php#192

Parameters:
  • $path (string)
Returns:

int

public OC\Archive\TAR::getFolder($path)
get the files in a folder
Source:

lib/private/Archive/TAR.php#203

Parameters:
  • $path (string)
Returns:

array

public OC\Archive\TAR::getFiles()
get all files in the archive
Source:lib/private/Archive/TAR.php#229
Returns:array
public OC\Archive\TAR::getFile($path)
get the content of a file
Source:

lib/private/Archive/TAR.php#250

Parameters:
  • $path (string)
Returns:

string

public OC\Archive\TAR::extractFile($path, $dest)
extract a single file from the archive
Source:

lib/private/Archive/TAR.php#261

Parameters:
  • $path (string)
  • $dest (string)
Returns:

bool

public OC\Archive\TAR::extract($dest)
extract the archive
Source:

lib/private/Archive/TAR.php#284

Parameters:
  • $dest (string)
Returns:

bool

public OC\Archive\TAR::fileExists($path)
check if a file or folder exists in the archive
Source:

lib/private/Archive/TAR.php#294

Parameters:
  • $path (string)
Returns:

bool

public OC\Archive\TAR::remove($path)
remove a file or folder from the archive
Source:

lib/private/Archive/TAR.php#320

Parameters:
  • $path (string)
Returns:

bool

public OC\Archive\TAR::getStream($path, $mode)
get a file handler
Source:

lib/private/Archive/TAR.php#344

Parameters:
  • $path (string)
  • $mode (string)
Returns:

bool | resource

public OC\Archive\TAR::writeBack($tmpFile, $path)
write back temporary files
Source:lib/private/Archive/TAR.php#369
public OC\Archive\TAR::getError()
Get error object from archive_tar.
Source:lib/private/Archive/TAR.php#389