# util/SourceFileScanner.php

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

## \SourceFileScanner
jump to top

Package: phing\util

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.

### Properties

`$fileUtils= ''`

Instance of FileUtils

Details

Type
  n/a

`$task= ''`

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

Details

Type
  n/a

### Methods

`__construct( \task $task ) : void`

Parameters

Name | Type | Description
--- | --- | ---
$task | \task | The task we should log messages through

`restrict( \files $files, \srcDir $srcDir, \destDir $destDir, \FilenameMapper $mapper, \force $force = false ) : void`

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

Parameters

Name | Type | Description
--- | --- | ---
$files | \files | the original set of files
$srcDir | \srcDir | all files are relative to this directory
$destDir | \destDir | 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 | \force | Boolean that determines if the files should be forced to be copied.

`restrictAsFiles( $files, $srcDir, $destDir, $mapper ) : void`

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

Parameters

Name | Type | Description
--- | --- | ---
$files |  |
$srcDir |  |
$destDir |  |
$mapper |  |

Documentation was generated by DocBlox 0.17.1.