PHP Class CopyTask, symfony-1.4

Author: Andreas Aderhold, [email protected]
Inheritance: extends Task
Exibir arquivo Open project: vjousse/symfony-1.4 Class Usage Examples

Protected Properties

Property Type Description
$completeDirMap asoc array containing mapped file names
$destDir the destiantion file (from xml attribute)
$destFile the source file (from xml attribute)
$dirCopyMap asoc array containing mapped file names
$file
$fileCopyMap
$fileUtils asoc array containing complete dir names
$filesets a instance of fileutils
$filterChains all fileset objects assigned to this task
$flatten include empty dirs? (from XML)
$includeEmpty sync timestamps (from xml attribute)
$mapperElement apply the FlattenMapper right way (from XML)
$overwrite the destination dir (from xml attribute)
$preserveLMT overwrite destination (from xml attribute)
$verbosity all filterchains objects assigned to this task

Public Methods

Method Description
__construct ( ) : object Sets up this object internal stuff. i.e. the Fileutils instance
createFileSet ( ) : object Nested creator, creates a FileSet for this task
createFilterChain ( ) : object Creates a filterchain
createMapper ( ) : object Nested creator, creates one Mapper for this task
main ( ) : true The main entry point where everything gets in motion.
setFile ( PhingFile $file ) : void 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.
setIncludeEmptyDirs ( $bool ) : void 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.
setOverwrite ( $bool ) : void 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.
setTodir ( PhingFile $dir ) : void 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.
setTofile ( PhingFile $file ) : void 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.
setTstamp ( $bool ) : void 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.
setVerbose ( boolean $verbosity ) Used to force listing of all names of copied files.

Protected Methods

Method Description
doWork ( ) : void Actually copies the files
validateAttributes ( ) : void Validates attributes coming in from XML

Private Methods

Method Description
_scan ( &$fromDir, &$toDir, &$files, &$dirs ) : void Compares source files to destination files to see if they should be copied.
buildMap ( &$fromDir, &$toDir, &$names, &$mapper, &$map ) : void Builds a map of filenames (from->to) that should be copied

Method Details

__construct() public method

Sets up this object internal stuff. i.e. the Fileutils instance
public __construct ( ) : object
return object The CopyTask instnace

createFileSet() public method

Nested creator, creates a FileSet for this task
public createFileSet ( ) : object
return object The created fileset object

createFilterChain() public method

Creates a filterchain
public createFilterChain ( ) : object
return object The created filterchain object

createMapper() public method

Nested creator, creates one Mapper for this task
public createMapper ( ) : object
return object The created Mapper type object

doWork() protected method

Actually copies the files
protected doWork ( ) : void
return void

main() public method

The main entry point where everything gets in motion.
public main ( ) : true
return true on success

setFile() public method

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.
public setFile ( PhingFile $file ) : void
$file PhingFile
return void

setIncludeEmptyDirs() public method

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.
public setIncludeEmptyDirs ( $bool ) : void
return void

setOverwrite() public method

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.
public setOverwrite ( $bool ) : void
return void

setTodir() public method

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.
public setTodir ( PhingFile $dir ) : void
$dir PhingFile
return void

setTofile() public method

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.
public setTofile ( PhingFile $file ) : void
$file PhingFile
return void

setTstamp() public method

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.
public setTstamp ( $bool ) : void
return void

setVerbose() public method

Used to force listing of all names of copied files.
public setVerbose ( boolean $verbosity )
$verbosity boolean

validateAttributes() protected method

Validates attributes coming in from XML
protected validateAttributes ( ) : void
return void

Property Details

$completeDirMap protected_oe property

asoc array containing mapped file names
protected $completeDirMap

$destDir protected_oe property

the destiantion file (from xml attribute)
protected $destDir

$destFile protected_oe property

the source file (from xml attribute)
protected $destFile

$dirCopyMap protected_oe property

asoc array containing mapped file names
protected $dirCopyMap

$file protected_oe property

protected $file

$fileCopyMap protected_oe property

protected $fileCopyMap

$fileUtils protected_oe property

asoc array containing complete dir names
protected $fileUtils

$filesets protected_oe property

a instance of fileutils
protected $filesets

$filterChains protected_oe property

all fileset objects assigned to this task
protected $filterChains

$flatten protected_oe property

include empty dirs? (from XML)
protected $flatten

$includeEmpty protected_oe property

sync timestamps (from xml attribute)
protected $includeEmpty

$mapperElement protected_oe property

apply the FlattenMapper right way (from XML)
protected $mapperElement

$overwrite protected_oe property

the destination dir (from xml attribute)
protected $overwrite

$preserveLMT protected_oe property

overwrite destination (from xml attribute)
protected $preserveLMT

$verbosity protected_oe property

all filterchains objects assigned to this task
protected $verbosity