phing-tasks-system
[ class tree: phing-tasks-system ] [ index: phing-tasks-system ] [ all elements ]

Class: CopyTask

Source Location: /tasks/system/CopyTask.php

Class Overview

ProjectComponent
   |
   --Task
      |
      --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.


Author(s):

  • Andreas Aderhold, andi@binarycloud.com

Version:

  • $Revision: 552 $ $Date: 2009-08-29 14:18:13 +0200 (Sat, 29 Aug 2009) $

Copyright:

  • � 2001,2002 THYRELL. All rights reserved

Variables

Methods


Child classes:

XsltTask
Implements an XSLT processing filter while copying files.
MoveTask
Moves a file or directory to a new file or directory.

Inherited Variables

Inherited Methods

Class: Task

Task::getDescription()
Returns the textual description of the task
Task::getLocation()
Returns the location within the buildfile this task occurs. Used by BuildException to give detailed error messages.
Task::getOwningTarget()
Returns the owning target of this task.
Task::getRegisterSlot()
Returns a name
Task::getRuntimeConfigurableWrapper()
Returns the wrapper object for runtime configuration
Task::getTaskName()
Returns the name of task, used only for log messages
Task::getTaskType()
Returns the name of the task under which it was invoked, usually the XML tagname
Task::init()
Called by the parser to let the task initialize properly.
Task::log()
Provides a project level log event to the task.
Task::main()
Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running <em>phing target1 target2</em> will run all tasks in target3 twice.
Task::maybeConfigure()
Configure this task if it hasn't been done already.
Task::perform()
Perfrom this task
Task::setDescription()
Sets a textual description of the task
Task::setLocation()
Sets the location within the buildfile this task occurs. Called by the parser to set location information.
Task::setOwningTarget()
Sets the owning target this task belongs to.
Task::setRuntimeConfigurableWrapper()
Sets the wrapper object this task should use for runtime configurable elements.
Task::setTaskName()
Sets the name of this task for log messages
Task::setTaskType()
Sets the type of the task. Usually this is the name of the XML tag

Class: ProjectComponent

ProjectComponent::getProject()
Returns a reference to current project
ProjectComponent::log()
Logs a message with the given priority.
ProjectComponent::setProject()
References the project to the current component.

Class Details

[line 39]
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.



Tags:

author:  Andreas Aderhold, andi@binarycloud.com
version:  $Revision: 552 $ $Date: 2009-08-29 14:18:13 +0200 (Sat, 29 Aug 2009) $
copyright:  � 2001,2002 THYRELL. All rights reserved


[ Top ]


Class Variables

$completeDirMap = array()

[line 52]



Tags:

access:  protected

Type:   mixed


[ Top ]

$destDir =  null

[line 43]



Tags:

access:  protected

Type:   mixed


[ Top ]

$destFile =  null

[line 42]



Tags:

access:  protected

Type:   mixed


[ Top ]

$dirCopyMap = array()

[line 51]



Tags:

access:  protected

Type:   mixed


[ Top ]

$file =  null

[line 41]



Tags:

access:  protected

Type:   mixed


[ Top ]

$fileCopyMap = array()

[line 50]



Tags:

access:  protected

Type:   mixed


[ Top ]

$filelists = array()

[line 55]



Tags:

access:  protected

Type:   mixed


[ Top ]

$filesets = array()

[line 54]



Tags:

access:  protected

Type:   mixed


[ Top ]

$fileUtils =  null

[line 53]



Tags:

access:  protected

Type:   mixed


[ Top ]

$filterChains = array()

[line 56]



Tags:

access:  protected

Type:   mixed


[ Top ]

$flatten =  false

[line 47]



Tags:

access:  protected

Type:   mixed


[ Top ]

$includeEmpty =  true

[line 46]



Tags:

access:  protected

Type:   mixed


[ Top ]

$mapperElement =  null

[line 48]



Tags:

access:  protected

Type:   mixed


[ Top ]

$mode =  0755

[line 60]



Tags:

access:  protected

Type:   mixed


[ Top ]

$overwrite =  false

[line 44]



Tags:

access:  protected

Type:   mixed


[ Top ]

$preserveLMT =  true

[line 45]



Tags:

access:  protected

Type:   mixed


[ Top ]

$verbosity =  Project::MSG_VERBOSE

[line 58]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 68]

object The __construct( )

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



Tags:

return:  CopyTask instnace
access:  public


Overridden in child classes as:

MoveTask::__construct()

[ Top ]

method createFileList [line 194]

object The createFileList( )

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



Tags:

return:  created filelist object
access:  public


[ Top ]

method createFileSet [line 183]

object The createFileSet( )

Nested creator, creates a FileSet for this task



Tags:

return:  created fileset object
access:  public


[ Top ]

method createFilterChain [line 204]

object The createFilterChain( )

Creates a filterchain



Tags:

return:  created filterchain object
access:  public


[ Top ]

method createMapper [line 216]

object The createMapper( )

Nested creator, creates one Mapper for this task



Tags:

return:  created Mapper type object
throws:  BuildException
access:  public


[ Top ]

method doWork [line 384]

void doWork( )

Actually copies the files



Tags:

throws:  BuildException
access:  protected


Overridden in child classes as:

MoveTask::doWork()

[ Top ]

method main [line 231]

true main( )

The main entry point where everything gets in motion.



Tags:

return:  on success
throws:  BuildException
access:  public


Overridden in child classes as:

XsltTask::main()
Set any XSLT Param and invoke CopyTask::main()

Overrides Task::main() (Called by the project to let the task do it's work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running <em>phing target1 target2</em> will run all tasks in target3 twice.)

[ Top ]

method setFile [line 134]

void setFile( $file)

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.



Tags:

access:  public


Parameters:

string/object   $file   The source file. Either a string or an PhingFile object

[ Top ]

method setIncludeEmptyDirs [line 120]

void setIncludeEmptyDirs( boolean $bool)

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.



Tags:

access:  public


Parameters:

boolean   $bool   Flag if empty dirs should be cpoied too

[ Top ]

method setMode [line 160]

void setMode( integer $mode)

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

Default mode is 0755.




Tags:

access:  public


Parameters:

integer   $mode   Octal mode

[ Top ]

method setOverwrite [line 81]

void setOverwrite( boolean $bool)

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.



Tags:

access:  public


Parameters:

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

[ Top ]

method setTodir [line 173]

void setTodir( $dir)

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.



Tags:

access:  public


Parameters:

string/object   $dir   The directory, either a string or an PhingFile object

[ Top ]

method setTofile [line 148]

void setTofile( $file)

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.



Tags:

access:  public


Parameters:

string/object   $file   The dest file. Either a string or an PhingFile object

[ Top ]

method setTstamp [line 106]

void setTstamp( boolean $bool)

Set the preserve timestmap flag. IntrospectionHelper takes care of booleans in set* methods so we can assume that the right value (boolean primitive) is coming in here.



Tags:

access:  public


Parameters:

boolean   $bool   Preserve the timestamp on the destination file

[ Top ]

method setVerbose [line 89]

void setVerbose( boolean $verbosity)

Used to force listing of all names of copied files.



Parameters:

boolean   $verbosity  

[ Top ]

method validateAttributes [line 297]

void validateAttributes( )

Validates attributes coming in from XML



Tags:

throws:  BuildException
access:  protected


Overridden in child classes as:

MoveTask::validateAttributes()
Validates attributes coming in from XML

[ Top ]


Documentation generated on Mon, 19 Oct 2009 10:50:36 +0200 by phpDocumentor 1.4.3