# classes/phing/tasks/system/ImportTask.php

## \ImportTask
jump to top

Imports another build file into the current project.

Targets and properties of the imported file can be overrridden by targets and properties of the same name declared in the importing file.

The imported file will have a new synthetic property of "phing.file.<projectname>" declared which gives the full path to the imported file. Additionally each target in the imported file will be declared twice: once with the normal name and once with "<projectname>." prepended. The "<projectname>.<targetname>" synthetic targets allow the importing file a mechanism to call the imported files targets as dependencies or via the <phing> or <phingcall> task mechanisms.

Extends from
  \Task
author
  Bryan Davis
copyright
  2001,2002 THYRELL. All rights reserved
package
  phing.tasks.system
version
  $Revision: 969 $

### Properties

`\PhingFile $file= 'null'`

Default value `null` Details

Type
  \PhingFile

`\FileSystem $fs= ''`

Details

Type
  \FileSystem

`bool $optional= 'false'`

Default value `false` Details

Type
  bool

### Methods

`init( ) : void`
Initialize task.
`main( ) : void`
Parse a Phing build file and copy the properties, tasks, data types and targets it defines into the current project.
`setFile( string $f ) : void`
Set the file to import.
Parameters

Name | Type | Description
--- | --- | ---
$f | string | Path to file

`setOptional( bool $opt ) : void`
Is this include optional?
Parameters

Name | Type | Description
--- | --- | ---
$opt | bool | If true, do not stop the build if the file does not exist

Documentation was generated by DocBlox 0.13.1.