filesystem
[ class tree: filesystem ] [ index: filesystem ] [ all elements ]

Class: TAR

Source Location: /filesystem/TAR.class.php

Class Overview


This class reads and writes Tape-Archive (TAR) Files and Gzip compressed TAR files, which are mainly used on UNIX systems.


Author(s):

Version:

  • 0.2.3

Copyright:

  • Copyright (c) 2002 Josh Barger <joshb@npt.com>

    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License.

    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Variables

Methods



Class Details

[line 79]
This class reads and writes Tape-Archive (TAR) Files and Gzip compressed TAR files, which are mainly used on UNIX systems.

This class works on both windows AND unix systems, and does NOT rely on external applications!! Woohoo!

Version History: 1.0 04/10/2002 - InitialRelease

2.0 04/11/2002 - Merged both tarReader and tarWriter classes into one

    • Added additional comments to functions to help users
    directories from archive

    2.1 04/12/2002 - Fixed serious bug in generating tar

    • Created another example file
    • Added check to make sure ZLIB is installed before running GZIP compression on TAR
    2.2 05/07/2002 - Added automatic detection of Gzipped tar files (Thanks go to Jürgen Falch for the idea)
    • Changed "private" functions to have special function names beginning with two underscores
    If you use this script in your application/website, please send me an e-mail letting me know about it :)

    Bugs: Please report any bugs you might find to my e-mail address at joshb@npt.com. If you have already created a fix/patch for the bug, please do send it to me so I can incorporate it into my release.




    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  0.2.3
    copyright:  

    Copyright (c) 2002 Josh Barger <joshb@npt.com>

    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License.

    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

    license:  GNU Lesser General Public License


    [ Top ]


    Class Variables

    $directories =

    [line 119]



    Tags:

    access:  public

    Type:   array


    [ Top ]

    $filename =

    [line 86]



    Tags:

    access:  public

    Type:   string


    [ Top ]

    $files =

    [line 114]



    Tags:

    access:  public

    Type:   array


    [ Top ]

    $ftp =  null

    [line 106]

    This reference of a FTP object is for the use of the filesystem on the server via FTP, cause of SAFE MODE restriction.



    Tags:

    access:  private

    Type:   FTPHost


    [ Top ]

    $isGzipped =  false

    [line 91]



    Tags:

    access:  public

    Type:   boolean


    [ Top ]

    $numDirectories =

    [line 129]



    Tags:

    access:  private

    Type:   integer


    [ Top ]

    $numFiles =

    [line 124]



    Tags:

    access:  private

    Type:   integer


    [ Top ]

    $tar_file =  ""

    [line 98]

    The data content of the archive will be stored in ths variable.



    Tags:

    access:  public

    Type:   string


    [ Top ]



    Class Methods


    constructor TAR [line 142]

    tar TAR( [ $ftp_host = null])

    Class Constructor -- Does nothing...

    Perhaps it sets a reference to an FTPHost-Object.




    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

       $ftp_host  

    [ Top ]

    method addDirectory [line 682]

    boolean addDirectory( string $dirname, [boolean $recursive = true])

    Check if this tar archive contains a specific directory.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    author:  Daniel Plücken <daniel@debakel.net> (only FTP-Functionality)
    version:  1.0
    access:  public


    Parameters:

    string   $dirname  
    boolean   $recursive  

    [ Top ]

    method addFile [line 762]

    boolean addFile( $filename, [boolean $ftp_disconnect = true], string $dirname)

    Add a file to the tar archive.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

    string   $dirname  
    boolean   $ftp_disconnect  
       $filename  

    [ Top ]

    method addFTPData [line 161]

    void addFTPData( string $host, string $user, string $password, [string $port = 21])

    Adds ftp data to this object. This can be useful for writing dumps if the sever has SAFE MODE restrictions.



    Tags:

    author:  Daniel Plücken <daniel@debakel.net>
    version:  1.0
    since:  0.2.3
    access:  public


    Parameters:

    string   $host  
    string   $user  
    string   $password  
    string   $port  

    [ Top ]

    method appendTar [line 574]

    boolean appendTar( string $filename)

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



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

    string   $filename  

    [ Top ]

    method containsDirectory [line 659]

    boolean containsDirectory( string $dirname)

    Check if this tar archive contains a specific directory.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

    string   $dirname  

    [ Top ]

    method containsFile [line 638]

    boolean containsFile( string $filename)

    Check if this tar archive contains a specific file.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

    string   $filename  

    [ Top ]

    method getDirectory [line 617]

    boolean getDirectory( string $dirname)

    Retrieves information about a directory in the current tar archive.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

    string   $dirname  

    [ Top ]

    method getFile [line 596]

    boolean getFile( string $filename)

    Retrieves information about a file in the current tar archive.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

    string   $filename  

    [ Top ]

    method openTAR [line 540]

    boolean openTAR( string $filename)

    Computes the unsigned Checksum of a file's header to try to ensure valid file.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

    string   $filename  

    [ Top ]

    method removeDirectory [line 863]

    boolean removeDirectory( $dirname)

    Remove a directory from the tar archive.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

       $dirname  

    [ Top ]

    method removeFile [line 839]

    boolean removeFile( $filename, string $dirname)

    Remove a file from the tar archive.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  public


    Parameters:

    string   $dirname  
       $filename  

    [ Top ]

    method saveTar [line 889]

    boolean saveTar( )

    Write the currently loaded tar archive to disk or to a ftp ressource if the attribute ftp is a FTPHost-Object.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    author:  Daniel Plücken <daniel@debakel.net> (only FTP-Functionality)
    version:  1.0
    access:  public


    [ Top ]

    method toTar [line 913]

    boolean toTar( string $filename, boolean $useGzip)

    Saves tar archive to a different file than the current file.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    author:  Daniel Plücken <daniel@debakel.net> (only FTP-Functionality)
    version:  1.0
    access:  public


    Parameters:

    string   $filename  
    boolean   $useGzip  

    [ Top ]

    method __computeUnsignedChecksum [line 180]

    string __computeUnsignedChecksum( $bytestring)

    Computes the unsigned Checksum of a file's header to try to ensure valid file.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  private


    Parameters:

       $bytestring  

    [ Top ]

    method __generateTAR [line 396]

    boolean __generateTAR( )

    Generates a TAR file from the processed data.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  private


    [ Top ]

    method __parseNullPaddedString [line 202]

    string __parseNullPaddedString( $string)

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



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  private


    Parameters:

       $string  

    [ Top ]

    method __parseTar [line 218]

    boolean __parseTar( )

    This function parses the current TAR file.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  private


    [ Top ]

    method __readTar [line 355]

    string __readTar( [ $filename = ''])

    Read a non gzipped tar file in for processing.



    Tags:

    author:  Josh Barger <joshb@npt.com>
    version:  1.0
    access:  private


    Parameters:

       $filename  

    [ Top ]


    Documentation generated on Thu, 05 Jun 2008 19:15:26 +0200 by phpDocumentor 1.4.1