XOOPS  2.6.0
tar Class Reference

Public Member Functions

 addDirectory ($dirname)
 
 addFile ($filename, $binary=false)
 
 appendTar ($filename)
 
 containsDirectory ($dirname)
 
 containsFile ($filename)
 
 getDirectory ($dirname)
 
 getFile ($filename)
 
 openTAR ($filename)
 
 removeDirectory ($dirname)
 
 removeFile ($filename)
 
 saveTar ()
 
 toTar ($filename, $useGzip)
 
 toTarOutput ($filename, $useGzip)
 

Public Attributes

 $directories
 
 $filename
 
 $files
 
 $isGzipped
 
 $numDirectories
 
 $numFiles
 
 $tar_file
 

Private Member Functions

 __computeUnsignedChecksum ($bytestring)
 
 __generateTAR ()
 
 __parseNullPaddedString ($string)
 
 __parseTar ()
 
 __readTar ($filename= '')
 

Detailed Description

Definition at line 91 of file class.tar.php.

Member Function Documentation

tar::__computeUnsignedChecksum (   $bytestring)
private

*#@- Computes the unsigned Checksum of a file's header to try to ensure valid file

Parameters
string$bytestring
Returns
int|string private

Definition at line 125 of file class.tar.php.

References $i.

Referenced by __generateTAR(), and __parseTar().

Here is the caller graph for this function:

tar::__generateTAR ( )
private

Generates a TAR file from the processed data

Returns
bool always TRUE private

Definition at line 280 of file class.tar.php.

References $header, $i, and __computeUnsignedChecksum().

Here is the call graph for this function:

tar::__parseNullPaddedString (   $string)
private

Converts a NULL padded string to a non-NULL padded string

Parameters
string$string
Returns
string private

Definition at line 145 of file class.tar.php.

Referenced by __parseTar().

Here is the caller graph for this function:

tar::__parseTar ( )
private

This function parses the current TAR file

Returns
bool always TRUE private

Unused Header Information

$activeFile["typeflag"] = substr($this->tar_file,$main_offset + 156,1); $activeFile["linkname"] = substr($this->tar_file,$main_offset + 157,100); $activeFile["magic"] = substr($this->tar_file,$main_offset + 257,6); $activeFile["version"] = substr($this->tar_file,$main_offset + 263,2); $activeFile["devmajor"] = substr($this->tar_file,$main_offset + 329,8); $activeFile["devminor"] = substr($this->tar_file,$main_offset + 337,8); $activeFile["prefix"] = substr($this->tar_file,$main_offset + 345,155); $activeFile["endheader"] = substr($this->tar_file,$main_offset + 500,12);

Definition at line 157 of file class.tar.php.

References __computeUnsignedChecksum(), and __parseNullPaddedString().

Referenced by __readTar().

Here is the call graph for this function:

Here is the caller graph for this function:

tar::__readTar (   $filename = '')
private

Read a non gzipped tar file in for processing.

Parameters
string$filenamefull filename
Returns
bool always TRUE private

Definition at line 250 of file class.tar.php.

References $filename, and __parseTar().

Referenced by appendTar(), and openTAR().

Here is the call graph for this function:

Here is the caller graph for this function:

tar::addDirectory (   $dirname)

Add a directory to this tar archive

Parameters
string$dirname
Returns
bool

Definition at line 481 of file class.tar.php.

References $dirname, and XoopsLoad\fileExists().

Here is the call graph for this function:

tar::addFile (   $filename,
  $binary = false 
)

Add a file to the tar archive

Parameters
string$filename
boolean$binaryBinary file?
Returns
bool

Definition at line 508 of file class.tar.php.

References $filename, containsFile(), and XoopsLoad\fileExists().

Here is the call graph for this function:

tar::appendTar (   $filename)

Appends a tar file to the end of the currently opened tar file.

Parameters
string$filename
Returns
bool

Definition at line 393 of file class.tar.php.

References $filename, __readTar(), and XoopsLoad\fileExists().

Here is the call graph for this function:

tar::containsDirectory (   $dirname)

Check if this tar archive contains a specific directory

Parameters
string$dirname
Returns
bool

Definition at line 463 of file class.tar.php.

References $dirname.

tar::containsFile (   $filename)

Check if this tar archive contains a specific file

Parameters
string$filename
Returns
bool

Definition at line 445 of file class.tar.php.

References $filename.

Referenced by addFile().

Here is the caller graph for this function:

tar::getDirectory (   $dirname)

Retrieves information about a directory in the current tar archive

Parameters
string$dirname
Returns
string FALSE on fail

Definition at line 427 of file class.tar.php.

References $dirname.

tar::getFile (   $filename)

Retrieves information about a file in the current tar archive

Parameters
string$filename
Returns
string FALSE on fail

Definition at line 409 of file class.tar.php.

References $filename.

tar::openTAR (   $filename)

Open a TAR file

Parameters
string$filename
Returns
bool

Definition at line 366 of file class.tar.php.

References $filename, __readTar(), and XoopsLoad\fileExists().

Here is the call graph for this function:

tar::removeDirectory (   $dirname)

Remove a directory from the tar archive

Parameters
string$dirname
Returns
bool

Definition at line 570 of file class.tar.php.

References $dirname.

tar::removeFile (   $filename)

Remove a file from the tar archive

Parameters
string$filename
Returns
bool

Definition at line 550 of file class.tar.php.

References $filename.

tar::saveTar ( )

Write the currently loaded tar archive to disk

Returns
bool

Definition at line 589 of file class.tar.php.

References toTar().

Here is the call graph for this function:

tar::toTar (   $filename,
  $useGzip 
)

Saves tar archive to a different file than the current file

Parameters
string$filename
bool$useGzipUse GZ compression?
Returns
bool

Definition at line 606 of file class.tar.php.

References $file, $filename, and $tar_file.

Referenced by saveTar().

Here is the caller graph for this function:

tar::toTarOutput (   $filename,
  $useGzip 
)

Sends tar archive to stdout

Parameters
string$filename
bool$useGzipUse GZ compression?
Returns
string

Definition at line 637 of file class.tar.php.

References $file, $filename, and $tar_file.

Member Data Documentation

tar::$directories

Definition at line 109 of file class.tar.php.

tar::$filename

*#@+ Unprocessed Archive Information

Definition at line 97 of file class.tar.php.

Referenced by __readTar(), addFile(), appendTar(), containsFile(), getFile(), openTAR(), removeFile(), toTar(), and toTarOutput().

tar::$files

*#@- *#@+ Processed Archive Information

Definition at line 108 of file class.tar.php.

tar::$isGzipped

Definition at line 98 of file class.tar.php.

tar::$numDirectories

Definition at line 111 of file class.tar.php.

tar::$numFiles

Definition at line 110 of file class.tar.php.

tar::$tar_file

Definition at line 99 of file class.tar.php.

Referenced by toTar(), and toTarOutput().


The documentation for this class was generated from the following file: