# tasks/ext/TarTask.php

## \TarFileSet
jump to top

Package: phing\tasks\ext

This is a FileSet with the option to specify permissions.

Permissions are currently not implemented by PEAR Archive_Tar, but hopefully they will be in the future.

Parent(s)
  \FileSet < \AbstractFileSet < \DataType < \ProjectComponent

### Properties

`$files= 'null'`
Default value `null` Details

Type
  n/a

`$fullpath= '""'`
Default value`""`Details

Type
  n/a

`$groupName= '""'`
Default value`""`Details

Type
  n/a

`$mode= '0100644'`
Default value `0100644` Details

Type
  n/a

`$prefix= '""'`
Default value`""`Details

Type
  n/a

`$preserveLeadingSlashes= 'false'`
Default value `false` Details

Type
  n/a

`$userName= '""'`
Default value`""`Details

Type
  n/a

### Methods

`__clone( ) : void`

`__construct( ) : void`

`appendSelector( ) : void`

`circularReference( ) : void`

`createAnd( ) : void`

`createContains( ) : void`

`createContainsRegexp( ) : void`

`createCustom( ) : void`

`createDate( ) : void`

`createDepend( ) : void`

`createDepth( ) : void`

`createExclude( ) : void`

`createExcludesFile( ) : void`

`createFilename( ) : void`

`createInclude( ) : void`

`createIncludesFile( ) : void`

`createMajority( ) : void`

`createNone( ) : void`

`createNot( ) : void`

`createOr( ) : void`

`createPatternSet( ) : void`

`createPresent( ) : void`

`createSelector( ) : void`

`createSize( ) : void`

`createType( ) : void`

`dieOnCircularReference( ) : void`

`getCheckedRef( ) : void`

`getDescription( ) : void`

`getDir( ) : void`

`getDirectoryScanner( ) : void`

`getFiles( $p, $includeEmpty = true ) : void`

Get a list of files and directories specified in the fileset.

@return array a list of file and directory names, relative to the baseDir for the project.

Parameters

Name | Type | Description
--- | --- | ---
$p |  |
$includeEmpty |  |

`getFullpath( ) : void`

`getGroup( ) : void`

`getMode( ) : void`

`getPrefix( ) : void`

`getPreserveLeadingSlashes( ) : void`

`getProject( ) : void`

`getRef( ) : void`

`getSelectors( ) : void`

`getUserName( ) : void`

`hasPatterns( ) : void`

`hasSelectors( ) : void`

`isReference( ) : void`

`log( ) : void`

`noChildrenAllowed( ) : void`

`parsingComplete( ) : void`

`selectorCount( ) : void`

`selectorElements( ) : void`

`setCaseSensitive( ) : void`

`setDefaultexcludes( ) : void`

`setDescription( ) : void`

`setDir( ) : void`

`setExcludes( ) : void`

`setExcludesfile( ) : void`

`setExpandSymbolicLinks( ) : void`

`setFullpath( $fullpath ) : void`

If the fullpath attribute is set, the file in the fileset is written with that path in the archive. The prefix attribute, if specified, is ignored. It is an error to have more than one file specified in such a fileset.

Parameters

Name | Type | Description
--- | --- | ---
$fullpath |  |

`setGroup( $groupName ) : void`

The groupname for the tar entry; optional, default="" This is not the same as the GID, which is not currently set by the task.

Parameters

Name | Type | Description
--- | --- | ---
$groupName |  |

`setIncludes( ) : void`

`setIncludesfile( ) : void`

`setMode( string $octalString ) : void`

A 3 digit octal string, specify the user, group and other modes in the standard Unix fashion; optional, default=0644

Parameters

Name | Type | Description
--- | --- | ---
$octalString | string |

`setPrefix( $prefix ) : void`

If the prefix attribute is set, all files in the fileset are prefixed with that path in the archive.

optional.

Parameters

Name | Type | Description
--- | --- | ---
$prefix |  |

`setPreserveLeadingSlashes( $b ) : void`

Flag to indicates whether leading `/'s should be preserved in the file names.

Optional, default is

    false

.

Parameters

Name | Type | Description
--- | --- | ---
$b |  |

`setProject( ) : void`

`setRefid( ) : void`

`setUserName( $userName ) : void`

The username for the tar entry This is not the same as the UID, which is not currently set by the task.

Parameters

Name | Type | Description
--- | --- | ---
$userName |  |

`setupDirectoryScanner( ) : void`

`tooManyAttributes( ) : void`

## \TarTask
jump to top

Package: phing\tasks\ext

Creates a tar archive using PEAR Archive_Tar.

Parent(s)
  \MatchingTask < \Task < \ProjectComponent
Author
  Hans Lellelid (Phing)
Author
  Stefano Mazzocchi (Ant)
Author
  Stefan Bodewig (Ant)
Author
  Magesh Umasankar
Version
  $Id: TarTask.php 1379 2011-12-07 19:59:40Z mrook $

### Constants

`TAR_NAMELEN = 100`

`WARN = "warn"`

`FAIL = "fail"`

`OMIT = "omit"`

### Properties

`$baseDir= ''`
Details

Type
  n/a

`$compression= 'null'`

Compression mode. Available options "gzip", "bzip2", "none" (null).

Default value `null` Details

Type
  n/a

`$fileSetFiles= 'array()'`
Default value `array()`Details

Type
  n/a

`$filesets= 'array()'`
Default value `array()`Details

Type
  n/a

`$includeEmpty= 'true'`
Default value `true` Details

Type
  n/a

`$longFileMode= '"warn"'`
Default value`"warn"`Details

Type
  n/a

`$longWarningGiven= 'false'`

Indicates whether the user has been warned about long files already.

Default value `false` Details

Type
  n/a

`string $prefix= 'null'`

File path prefix in the tar archive

Default value `null` Details

Type
  string

`$tarFile= ''`
Details

Type
  n/a

### Methods

`__construct( ) : void`

`appendSelector( ) : void`

`archiveIsUpToDate( array $files, \PhingFile $dir ) : boolean`

Parameters

Name | Type | Description
--- | --- | ---
$files | array | array of filenames
$dir | \PhingFile |

Returns

Type | Description
--- | ---
boolean |

`createAnd( ) : void`

`createContains( ) : void`

`createCustom( ) : void`

`createDate( ) : void`

`createDepend( ) : void`

`createDepth( ) : void`

`createExclude( ) : void`

`createExcludesFile( ) : void`

`createFileSet( ) : \FileSet`

Add a new fileset. Alias to createTarFileSet() for backwards compatibility.

Returns

Type | Description
--- | ---
\FileSet |

Details

See
  \createTarFileSet()

`createFilename( ) : void`

`createInclude( ) : void`

`createIncludesFile( ) : void`

`createMajority( ) : void`

`createNone( ) : void`

`createNot( ) : void`

`createOr( ) : void`

`createPatternSet( ) : void`

`createPresent( ) : void`

`createSelector( ) : void`

`createSize( ) : void`

`createTarFileSet( ) : \FileSet`

Add a new fileset

Returns

Type | Description
--- | ---
\FileSet |

`getDescription( ) : void`

`getDirectoryScanner( ) : void`

`getImplicitFileSet( ) : void`
final

`getLocation( ) : void`

`getOwningTarget( ) : void`

`getProject( ) : void`

`getRegisterSlot( ) : void`

`getRuntimeConfigurableWrapper( ) : void`

`getSelectors( ) : void`

`getTaskName( ) : void`

`getTaskType( ) : void`

`hasSelectors( ) : void`

`init( ) : void`

Ensures that PEAR lib exists.

`log( ) : void`

`main( ) : void`

do the work

Throws

Exception | Description
--- | ---
\BuildException |

`maybeConfigure( ) : void`

`perform( ) : void`

`selectorCount( ) : void`

`selectorElements( ) : void`

`setBasedir( \PhingFile $baseDir ) : void`

This is the base directory to look in for things to tar.

Parameters

Name | Type | Description
--- | --- | ---
$baseDir | \PhingFile |

`setCaseSensitive( ) : void`

`setCompression( $mode ) : void`

Set compression method.

Allowable values are

- none - no compression
- gzip - Gzip compression
- bzip2 - Bzip2 compression

Parameters

Name | Type | Description
--- | --- | ---
$mode |  |

`setDefaultexcludes( ) : void`

`setDescription( ) : void`

`setDestFile( \PhingFile $destFile ) : void`

Set is the name/location of where to create the tar file.

Parameters

Name | Type | Description
--- | --- | ---
$destFile | \PhingFile | The output of the tar

`setExcludes( ) : void`

`setExcludesfile( ) : void`

`setFollowSymlinks( ) : void`

`setIncludeEmptyDirs( boolean $bool ) : void`

Set the include empty dirs flag.

Parameters

Name | Type | Description
--- | --- | ---
$bool | boolean | Flag if empty dirs should be tarred too

Details

Access
  public

`setIncludes( ) : void`

`setIncludesfile( ) : void`

`setLocation( ) : void`

`setLongfile( $mode ) : void`

Set how to handle long files, those with a path>100 chars.

Optional, default=warn.

<

p> Allowable values are

- truncate - paths are truncated to the maximum length
- fail - paths greater than the maximim cause a build exception
- warn - paths greater than the maximum cause a warning and GNU is used
- gnu - GNU extensions are used for any paths greater than the maximum.
- omit - paths greater than the maximum are omitted from the archive

Parameters

Name | Type | Description
--- | --- | ---
$mode |  |

`setOwningTarget( ) : void`

`setPrefix( string $prefix ) : void`

Sets the file path prefix for file in the tar file.

Parameters

Name | Type | Description
--- | --- | ---
$prefix | string | Prefix

`setProject( ) : void`

`setRuntimeConfigurableWrapper( ) : void`

`setTaskName( ) : void`

`setTaskType( ) : void`

Documentation was generated by DocBlox 0.17.1.