File utility class.

  • handles os independent stuff etc
  • mapper stuff
  • filter stuff
package phing.util
version $Id: 65bc3c3635d86cfa281e1ea0b087053fd3936eaa $

 Methods

contentEquals()

contentEquals(\PhingFile $file1, \PhingFile $file2) : boolean

Parameters

$file1

$file2

Returns

booleanWhether contents of two files is the same.

Copies a file using filter chains.

copyFile(\PhingFile $sourceFile, \PhingFile $destFile, boolean $overwrite, boolean $preserveLastModified, array $filterChains, \Project $project, integer $mode) : void

Parameters

$sourceFile

\PhingFile

$destFile

\PhingFile

$overwrite

boolean

$preserveLastModified

boolean

$filterChains

array

$project

\Project

$mode

integer

Returns a new Reader with filterchains applied.

getChainedReader(\Reader $in, array $filterChains, \Project $project) : \Reader
Static

If filterchains are empty, simply returns passed reader.

Parameters

$in

\Reader

Reader to modify (if appropriate).

$filterChains

array

&$filterChains filter chains to apply.

$project

\Project

Returns

\ReaderAssembled Reader (w/ filter chains).

Normalize the given absolute path.

normalize(string $path) : string

This includes: - Uppercase the drive letter if there is one. - Remove redundant slashes after the drive spec. - resolve all ./, .\, ../ and ..\ sequences. - DOS style paths that start with a drive letter will have \ as the separator.

Parameters

$path

string

Path to normalize.

Returns

string

Interpret the filename as a file relative to the given file - unless the filename already represents an absolute filename.

resolveFile($file, $filename) : \PhingFile

Parameters

$file

the "reference" file for relative paths. This instance must be an absolute file and must not contain ./ or ../ sequences (same for \ instead of /).

$filename

a file name

Returns

\PhingFileA PhingFile object pointing to an absolute file that doesn't contain ./ or ../ sequences and uses the correct separator for the current platform.