SourceFileScanner

Utility class that collects the functionality of the various scanDir methods that have been scattered in several tasks before.

The only method returns an array of source files. The array is a subset of the files given as a parameter and holds only those that are newer than their corresponding target files.

package

phing.util

Methods

__construct

__construct(\Task $task) 

Arguments

$task

\Task

The task we should log messages through

Restrict the given set of files to those that are newer than their corresponding target files.

restrict(array &$files, \PhingFile $srcDir, \PhingFile $destDir, \FilenameMapper $mapper, boolean $force = false) : array

Arguments

$files

array

the original set of files

$srcDir

\PhingFile

all files are relative to this directory

$destDir

\PhingFile

target files live here. if null file names returned by the mapper are assumed to be absolute.

$mapper

\FilenameMapper

knows how to construct a target file names from source file names.

$force

boolean

Boolean that determines if the files should be forced to be copied.

Response

array

Convenience layer on top of restrict that returns the source files as PhingFile objects (containing absolute paths if srcDir is absolute).

restrictAsFiles( &$files,  &$srcDir,  &$destDir,  &$mapper) : array

Arguments

$files

$srcDir

$destDir

$mapper

Response

array

Properties

Instance of FileUtils

fileUtils : 

Type(s)

Task this class is working for -- for logging purposes.

task : 

Type(s)