tasks/system/MoveTask.php
\MoveTask
Moves a file or directory to a new file or directory.
By default, the destination file is overwritten if it already exists. When overwrite is turned off, then files are only moved if the source file is newer than the destination file, or when the destination file does not exist.
Source files and directories are only deleted when the file or directory has been copied to the destination successfully.
- Parent(s)
- \CopyTask < \Task < \ProjectComponent
- Author
- Andreas Aderhold, andi@binarycloud.com
- Version
- $Revision: 985 $
Properties

$completeDirMap= 'array()'
array()Details- Type
- n/a
- Inherited_from
- \CopyTask::$$completeDirMap

$destDir= 'null'
nullDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$destDir

$destFile= 'null'
nullDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$destFile

$dirCopyMap= 'array()'
array()Details- Type
- n/a
- Inherited_from
- \CopyTask::$$dirCopyMap

$file= 'null'
nullDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$file

$fileCopyMap= 'array()'
array()Details- Type
- n/a
- Inherited_from
- \CopyTask::$$fileCopyMap

$fileUtils= 'null'
nullDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$fileUtils

$filelists= 'array()'
array()Details- Type
- n/a
- Inherited_from
- \CopyTask::$$filelists

$filesets= 'array()'
array()Details- Type
- n/a
- Inherited_from
- \CopyTask::$$filesets

$filterChains= 'array()'
array()Details- Type
- n/a
- Inherited_from
- \CopyTask::$$filterChains

$flatten= 'false'
falseDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$flatten

$haltonerror= 'true'
trueDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$haltonerror

$includeEmpty= 'true'
trueDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$includeEmpty

$mapperElement= 'null'
nullDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$mapperElement

$mode= '0755'
0755Details- Type
- n/a
- Inherited_from
- \CopyTask::$$mode

$overwrite= 'false'
falseDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$overwrite

$preserveLMT= 'false'
falseDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$preserveLMT

$verbosity= 'Project::MSG_VERBOSE'
Project::MSG_VERBOSEDetails- Type
- n/a
- Inherited_from
- \CopyTask::$$verbosity
Methods

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

_scan(
$fromDir, $toDir, $files, $dirs
)
:
voidCompares source files to destination files to see if they should be copied.
Inherited from: \CopyTask::_scan()| 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
Inherited from: \CopyTask::buildMap()| Name | Type | Description |
|---|---|---|
| $fromDir | ||
| $toDir | ||
| $names | ||
| $mapper | ||
| $map |
- Access
- private

createFileList(
)
:
objectNested creator, adds a set of files (nested fileset attribute).
Inherited from: \CopyTask::createFileList()| Type | Description |
|---|---|
| object | The created filelist object |
- Access
- public

createFileSet(
)
:
object
| Type | Description |
|---|---|
| object | The created fileset object |
- Access
- public

createFilterChain(
)
:
object
| Type | Description |
|---|---|
| object | The created filterchain object |
- Access
- public

createMapper(
)
:
object
| Type | Description |
|---|---|
| object | The created Mapper type object |
| Exception | Description |
|---|---|
| \BuildException |
- Access
- public

getRuntimeConfigurableWrapper(
)
:
void
logError(
$message, $location
=
NULL
)
:
void| Name | Type | Description |
|---|---|---|
| $message | ||
| $location |

main(
)
:
true
| Type | Description |
|---|---|
| true | on success |
| Exception | Description |
|---|---|
| \BuildException |
- Access
- public

okToDelete(
$d
)
:
voidIts only ok to delete a dir tree if there are no files in it.
| Name | Type | Description |
|---|---|---|
| $d |

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.
Inherited from: \CopyTask::setFile()| 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.
Inherited from: \CopyTask::setHaltonerror()| 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.
Inherited from: \CopyTask::setIncludeEmptyDirs()| 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).
Inherited from: \CopyTask::setMode()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.
Inherited from: \CopyTask::setOverwrite()| 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.
Inherited from: \CopyTask::setPreserveLastModified()| Name | Type | Description |
|---|---|---|
| $bool | boolean | Preserve the timestamp on the destination file |
- Access
- public

setRuntimeConfigurableWrapper(
)
:
void
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.
Inherited from: \CopyTask::setTodir()| 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.
Inherited from: \CopyTask::setTofile()| Name | Type | Description |
|---|---|---|
| $file | \string/object | The dest file. Either a string or an PhingFile object |
- Access
- public

setTstamp(
$bool
)
:
void| Name | Type | Description |
|---|---|---|
| $bool |

setVerbose(
boolean $verbosity
)
:
voidUsed to force listing of all names of copied files.
Inherited from: \CopyTask::setVerbose()| Name | Type | Description |
|---|---|---|
| $verbosity | boolean |

validateAttributes(
)
:
voidValidates attributes coming in from XML
| Exception | Description |
|---|---|
| \BuildException |
- Access
- private