classes/phing/tasks/system/CopyTask.php
\CopyTask
A phing copy task. Copies a file or directory to a new file or directory. Files are only copied if the source file is newer than the destination file, or when the destination file does not exist. It is possible to explictly overwrite existing files.
Use {@link Project#createTask} to register a new Task.
- Extends from
- \Task
- author
- Andreas Aderhold, andi@binarycloud.com
- copyright
- 2001,2002 THYRELL. All rights reserved
- package
- phing.tasks.system
- version
- $Revision: 985 $ $Date: 2010-11-11 16:58:35 +0100 (Thu, 11 Nov 2010) $
Properties
Methods

__construct(
)
:
objectSets up this object internal stuff. i.e. the Fileutils instance
| Type | Description |
|---|---|
| object |
- access
- public

_scan(
$fromDir, $toDir, $files, $dirs
)
:
voidCompares source files to destination files to see if they
should be copied.
| Name | Type | Description |
|---|---|---|
| $fromDir | ||
| $toDir | ||
| $files | ||
| $dirs |
- access
- private

buildMap(
$fromDir, $toDir, $names, $mapper, $map
)
:
voidBuilds a map of filenames (from->to) that should be copied
| Name | Type | Description |
|---|---|---|
| $fromDir | ||
| $toDir | ||
| $names | ||
| $mapper | ||
| $map |
- access
- private

createFileList(
)
:
objectNested creator, adds a set of files (nested fileset attribute).
| Type | Description |
|---|---|
| object |
- access
- public

createFileSet(
)
:
objectNested creator, creates a FileSet for this task
| Type | Description |
|---|---|
| object |
- access
- public

createFilterChain(
)
:
objectCreates a filterchain
| Type | Description |
|---|---|
| object |
- access
- public

createMapper(
)
:
objectNested creator, creates one Mapper for this task
| Type | Description |
|---|---|
| object |
- access
- public
- throws

main(
)
:
trueThe main entry point where everything gets in motion.
| Type | Description |
|---|---|
| true |
- access
- public
- throws

setFile(
\string/object $file
)
:
voidSet the file. We have to manually take care of the
type that is coming due to limited type support in php
in and convert it manually if neccessary.
| Name | Type | Description |
|---|---|---|
| $file | \string/object | The source file. Either a string or an PhingFile object |
- access
- public

setHaltonerror(
boolean $haltonerror
)
:
voidSet the haltonerror attribute - when true, will
make the build fail when errors are detected.
| Name | Type | Description |
|---|---|---|
| $haltonerror | boolean | Flag if the build should be stopped on errors |
- access
- public

setIncludeEmptyDirs(
boolean $bool
)
:
voidSet the include empty dirs flag. IntrospectionHelper takes care of
booleans in set* methods so we can assume that the right
value (boolean primitive) is coming in here.
| Name | Type | Description |
|---|---|---|
| $bool | boolean | Flag if empty dirs should be cpoied too |
- access
- public

setMode(
integer $mode
)
:
voidSets the mode to create destination directories with (ignored on Windows).
Default mode is 0755.
| Name | Type | Description |
|---|---|---|
| $mode | integer | Octal mode |
- access
- public

setOverwrite(
boolean $bool
)
:
voidSet the overwrite flag. IntrospectionHelper takes care of
booleans in set* methods so we can assume that the right
value (boolean primitive) is coming in here.
| Name | Type | Description |
|---|---|---|
| $bool | boolean | Overwrite the destination file(s) if it/they already exist |
- access
- public

setPreserveLastModified(
boolean $bool
)
:
voidSet the preserve timestamp flag. IntrospectionHelper takes care of
booleans in set* methods so we can assume that the right
value (boolean primitive) is coming in here.
| Name | Type | Description |
|---|---|---|
| $bool | boolean | Preserve the timestamp on the destination file |
- access
- public

setTodir(
\string/object $dir
)
:
voidSet the toDir. We have to manually take care of the
type that is coming due to limited type support in php
in and convert it manually if neccessary.
| Name | Type | Description |
|---|---|---|
| $dir | \string/object | The directory, either a string or an PhingFile object |
- access
- public

setTofile(
\string/object $file
)
:
voidSet the toFile. We have to manually take care of the
type that is coming due to limited type support in php
in and convert it manually if neccessary.
| Name | Type | Description |
|---|---|---|
| $file | \string/object | The dest file. Either a string or an PhingFile object |
- access
- public

setVerbose(
boolean $verbosity
)
:
Used to force listing of all names of copied files.
| Name | Type | Description |
|---|---|---|
| $verbosity | boolean |