Overview

Namespaces

  • splitbrain
    • PHPArchive

Classes

  • Archive
  • FileInfo
  • Tar
  • Zip

Exceptions

  • ArchiveCorruptedException
  • ArchiveIllegalCompressionException
  • ArchiveIOException
  • FileInfoException
  • Overview
  • Namespace
  • Class

Class FileInfo

Class FileInfo

stores meta data about a file in an Archive

Namespace: splitbrain\PHPArchive
Package: splitbrain\PHPArchive
License: MIT
Author: Andreas Gohr andi@splitbrain.org
Located at FileInfo.php
Methods summary
public
# __construct( string $path = '' )

initialize dynamic defaults

initialize dynamic defaults

Parameters

$path
The path of the file, can also be set later through setPath()
public mixed
# __call( string $name, array $arguments )

Handle calls to deprecated methods

Handle calls to deprecated methods

Parameters

$name
$arguments

Returns

mixed
public static splitbrain\PHPArchive\FileInfo
# fromPath( string $path, string $as = '' )

Factory to build FileInfo from existing file or directory

Factory to build FileInfo from existing file or directory

Parameters

$path
path to a file on the local file system
$as
optional path to use inside the archive

Returns

splitbrain\PHPArchive\FileInfo

Throws

splitbrain\PHPArchive\FileInfoException
public integer
# getSize( )

Returns

integer
the filesize. always 0 for directories
public
# setSize( integer $size )

Parameters

$size
public integer
# getCompressedSize( )

Returns

integer
public
# setCompressedSize( integer $csize )

Parameters

$csize
public integer
# getMtime( )

Returns

integer
public
# setMtime( integer $mtime )

Parameters

$mtime
public integer
# getGid( )

Returns

integer
public
# setGid( integer $gid )

Parameters

$gid
public integer
# getUid( )

Returns

integer
public
# setUid( integer $uid )

Parameters

$uid
public string
# getComment( )

Returns

string
public
# setComment( string $comment )

Parameters

$comment
public string
# getGroup( )

Returns

string
public
# setGroup( string $group )

Parameters

$group
public boolean
# getIsdir( )

Returns

boolean
public
# setIsdir( boolean $isdir )

Parameters

$isdir
public integer
# getMode( )

Returns

integer
public
# setMode( integer $mode )

Parameters

$mode
public string
# getOwner( )

Returns

string
public
# setOwner( string $owner )

Parameters

$owner
public string
# getPath( )

Returns

string
public
# setPath( string $path )

Parameters

$path
protected string
# cleanPath( string $path )

Cleans up a path and removes relative parts, also strips leading slashes

Cleans up a path and removes relative parts, also strips leading slashes

Parameters

$path

Returns

string
public
# strip( integer|string $strip )

Strip given prefix or number of path segments from the filename

Strip given prefix or number of path segments from the filename

The $strip parameter allows you to strip a certain number of path components from the filenames found in the tar file, similar to the --strip-components feature of GNU tar. This is triggered when an integer is passed as $strip. Alternatively a fixed string prefix may be passed in $strip. If the filename matches this prefix, the prefix will be stripped. It is recommended to give prefixes with a trailing slash.

Parameters

$strip
public boolean
# matchExpression( string $include = '', string $exclude = '' )

Does the file match the given include and exclude expressions?

Does the file match the given include and exclude expressions?

Exclude rules take precedence over include rules

Parameters

$include
Regular expression of files to include
$exclude
Regular expression of files to exclude

Returns

boolean
Properties summary
protected boolean $isdir
# false
protected string $path
# ''
protected integer $size
# 0
protected integer $csize
# 0
protected integer $mtime
# 0
protected integer $mode
# 0664
protected string $owner
# ''
protected string $group
# ''
protected integer $uid
# 0
protected integer $gid
# 0
protected string $comment
# ''
API documentation generated by ApiGen