tasks/system/MoveTask.php

Show: inherited
Table of Contents

\MoveTask

Package: phing\tasks\system

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

Propertyprotected  $completeDirMap= 'array()'
inheritedInherited from: \CopyTask::$$completeDirMap
Default valuearray()Details
Type
n/a
Inherited_from
\CopyTask::$$completeDirMap  
Propertyprotected  $destDir= 'null'
inheritedInherited from: \CopyTask::$$destDir
Default valuenullDetails
Type
n/a
Inherited_from
\CopyTask::$$destDir  
Propertyprotected  $destFile= 'null'
inheritedInherited from: \CopyTask::$$destFile
Default valuenullDetails
Type
n/a
Inherited_from
\CopyTask::$$destFile  
Propertyprotected  $dirCopyMap= 'array()'
inheritedInherited from: \CopyTask::$$dirCopyMap
Default valuearray()Details
Type
n/a
Inherited_from
\CopyTask::$$dirCopyMap  
Propertyprotected  $file= 'null'
inheritedInherited from: \CopyTask::$$file
Default valuenullDetails
Type
n/a
Inherited_from
\CopyTask::$$file  
Propertyprotected  $fileCopyMap= 'array()'
inheritedInherited from: \CopyTask::$$fileCopyMap
Default valuearray()Details
Type
n/a
Inherited_from
\CopyTask::$$fileCopyMap  
Propertyprotected  $fileUtils= 'null'
inheritedInherited from: \CopyTask::$$fileUtils
Default valuenullDetails
Type
n/a
Inherited_from
\CopyTask::$$fileUtils  
Propertyprotected  $filelists= 'array()'
inheritedInherited from: \CopyTask::$$filelists
Default valuearray()Details
Type
n/a
Inherited_from
\CopyTask::$$filelists  
Propertyprotected  $filesets= 'array()'
inheritedInherited from: \CopyTask::$$filesets
Default valuearray()Details
Type
n/a
Inherited_from
\CopyTask::$$filesets  
Propertyprotected  $filterChains= 'array()'
inheritedInherited from: \CopyTask::$$filterChains
Default valuearray()Details
Type
n/a
Inherited_from
\CopyTask::$$filterChains  
Propertyprotected  $flatten= 'false'
inheritedInherited from: \CopyTask::$$flatten
Default valuefalseDetails
Type
n/a
Inherited_from
\CopyTask::$$flatten  
Propertyprotected  $haltonerror= 'true'
inheritedInherited from: \CopyTask::$$haltonerror
Default valuetrueDetails
Type
n/a
Inherited_from
\CopyTask::$$haltonerror  
Propertyprotected  $includeEmpty= 'true'
inheritedInherited from: \CopyTask::$$includeEmpty
Default valuetrueDetails
Type
n/a
Inherited_from
\CopyTask::$$includeEmpty  
Propertyprotected  $mapperElement= 'null'
inheritedInherited from: \CopyTask::$$mapperElement
Default valuenullDetails
Type
n/a
Inherited_from
\CopyTask::$$mapperElement  
Propertyprotected  $mode= '0755'
inheritedInherited from: \CopyTask::$$mode
Default value0755Details
Type
n/a
Inherited_from
\CopyTask::$$mode  
Propertyprotected  $overwrite= 'false'
inheritedInherited from: \CopyTask::$$overwrite
Default valuefalseDetails
Type
n/a
Inherited_from
\CopyTask::$$overwrite  
Propertyprotected  $preserveLMT= 'false'
inheritedInherited from: \CopyTask::$$preserveLMT
Default valuefalseDetails
Type
n/a
Inherited_from
\CopyTask::$$preserveLMT  
Propertyprotected  $verbosity= 'Project::MSG_VERBOSE'
inheritedInherited from: \CopyTask::$$verbosity
Default valueProject::MSG_VERBOSEDetails
Type
n/a
Inherited_from
\CopyTask::$$verbosity  

Methods

methodpublic__construct( ) : object

Sets up this object internal stuff. i.e. the Fileutils instance

Returns
Type Description
object The CopyTask instnace
methodprivate_scan(  $fromDir,  $toDir,  $files,  $dirs ) : void
inherited

Compares source files to destination files to see if they should be copied.

Inherited from: \CopyTask::_scan()
Parameters
Name Type Description
$fromDir
$toDir
$files
$dirs
Details
Access
private  
methodprivatebuildMap(  $fromDir,  $toDir,  $names,  $mapper,  $map ) : void
inherited

Builds a map of filenames (from->to) that should be copied

Inherited from: \CopyTask::buildMap()
Parameters
Name Type Description
$fromDir
$toDir
$names
$mapper
$map
Details
Access
private  
methodpubliccreateFileList( ) : object
inherited

Nested creator, adds a set of files (nested fileset attribute).

Inherited from: \CopyTask::createFileList()
Returns
Type Description
object The created filelist object
Details
Access
public  
methodpubliccreateFileSet( ) : object
inherited

Nested creator, creates a FileSet for this task

Inherited from: \CopyTask::createFileSet()
Returns
Type Description
object The created fileset object
Details
Access
public  
methodpubliccreateFilterChain( ) : object
inherited

Creates a filterchain

Inherited from: \CopyTask::createFilterChain()
Returns
Type Description
object The created filterchain object
Details
Access
public  
methodpubliccreateMapper( ) : object
inherited

Nested creator, creates one Mapper for this task

Inherited from: \CopyTask::createMapper()
Returns
Type Description
object The created Mapper type object
Throws
Exception Description
\BuildException
Details
Access
public  
methodprivatedeleteDir(  $d ) : void

Go and delete the directory tree.

Parameters
Name Type Description
$d
methodprotecteddoWork( ) : void

Actually copies the files

Throws
Exception Description
\BuildException
methodpublicgetDescription( ) : void
methodpublicgetLocation( ) : void
methodpublicgetOwningTarget( ) : void
methodpublicgetProject( ) : void
methodprotectedgetRegisterSlot( ) : void
methodpublicgetRuntimeConfigurableWrapper( ) : void
methodpublicgetTaskName( ) : void
methodpublicgetTaskType( ) : void
methodpublicinit( ) : void
inherited

Inherited from: Task::init()\CopyTask::init()
methodpubliclog( ) : void
inherited

Inherited from: Task::log()\CopyTask::log()
methodprotectedlogError(  $message,  $location = NULL ) : void
inherited

Inherited from: \CopyTask::logError()
Parameters
Name Type Description
$message
$location
methodpublicmain( ) : true
inherited

The main entry point where everything gets in motion.

Inherited from: \CopyTask::main()
Returns
Type Description
true on success
Throws
Exception Description
\BuildException
Details
Access
public  
methodpublicmaybeConfigure( ) : void
methodprivateokToDelete(  $d ) : void

Its only ok to delete a dir tree if there are no files in it.

Parameters
Name Type Description
$d
methodpublicperform( ) : void
inherited

Inherited from: Task::perform()\CopyTask::perform()
methodpublicsetDescription( ) : void
methodpublicsetFile( \string/object $file ) : void
inherited

Set 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()
Parameters
Name Type Description
$file \string/object

The source file. Either a string or an PhingFile object

Details
Access
public  
methodpublicsetHaltonerror( boolean $haltonerror ) : void
inherited

Set the haltonerror attribute - when true, will make the build fail when errors are detected.

Inherited from: \CopyTask::setHaltonerror()
Parameters
Name Type Description
$haltonerror boolean

Flag if the build should be stopped on errors

Details
Access
public  
methodpublicsetIncludeEmptyDirs( boolean $bool ) : void
inherited

Set 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()
Parameters
Name Type Description
$bool boolean

Flag if empty dirs should be cpoied too

Details
Access
public  
methodpublicsetLocation( ) : void
methodpublicsetMode( integer $mode ) : void
inherited

Sets the mode to create destination directories with (ignored on Windows).

Inherited from: \CopyTask::setMode()

Default mode is 0755.

Parameters
Name Type Description
$mode integer

Octal mode

Details
Access
public  
methodpublicsetOverwrite( boolean $bool ) : void
inherited

Set 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()
Parameters
Name Type Description
$bool boolean

Overwrite the destination file(s) if it/they already exist

Details
Access
public  
methodpublicsetOwningTarget( ) : void
methodpublicsetPreserveLastModified( boolean $bool ) : void
inherited

Set 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()
Parameters
Name Type Description
$bool boolean

Preserve the timestamp on the destination file

Details
Access
public  
methodpublicsetProject( ) : void
methodpublicsetRuntimeConfigurableWrapper( ) : void
methodpublicsetTaskName( ) : void
methodpublicsetTaskType( ) : void
methodpublicsetTodir( \string/object $dir ) : void
inherited

Set 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()
Parameters
Name Type Description
$dir \string/object

The directory, either a string or an PhingFile object

Details
Access
public  
methodpublicsetTofile( \string/object $file ) : void
inherited

Set 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()
Parameters
Name Type Description
$file \string/object

The dest file. Either a string or an PhingFile object

Details
Access
public  
methodpublicsetTstamp(  $bool ) : void
inherited

Inherited from: \CopyTask::setTstamp()
Parameters
Name Type Description
$bool
Details
See
\CopyTask::setPreserveLastModified  
methodpublicsetVerbose( boolean $verbosity ) : void
inherited

Used to force listing of all names of copied files.

Inherited from: \CopyTask::setVerbose()
Parameters
Name Type Description
$verbosity boolean
methodprotectedvalidateAttributes( ) : void

Validates attributes coming in from XML

Throws
Exception Description
\BuildException
Details
Access
private  
Documentation was generated by DocBlox 0.17.1.