util/FileUtils.php

Show: inherited
Table of Contents

\FileUtils

Package: phing\util

File utility class.

  • handles os independent stuff etc
  • mapper stuff
  • filter stuff
Version
$Id$  

Methods

methodpubliccontentEquals(  $file1,  $file2 ) : boolean

Parameters
Name Type Description
$file1
$file2
Returns
Type Description
boolean Whether contents of two files is the same.
methodpubliccopyFile( \PhingFile $sourceFile, \PhingFile $destFile, boolean $overwrite = false, boolean $preserveLastModified = true, array $filterChains = null, \Project $project, integer $mode = 0755 ) : void

Copies a file using filter chains.

Parameters
Name Type Description
$sourceFile \PhingFile
$destFile \PhingFile
$overwrite boolean
$preserveLastModified boolean
$filterChains array
$project \Project
$mode integer
methodpublicgetChainedReader( \Reader $in, array $filterChains, \Project $project ) : \Reader
static

Returns a new Reader with filterchains applied. If filterchains are empty, simply returns passed reader.

Parameters
Name Type Description
$in \Reader

Reader to modify (if appropriate).

$filterChains array

&$filterChains filter chains to apply.

$project \Project
Returns
Type Description
\Reader Assembled Reader (w/ filter chains).
methodpublicnormalize( string $path ) : string

Normalize the given absolute path.

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
Name Type Description
$path string

Path to normalize.

Returns
Type Description
string
methodpublicresolveFile( \$file $file, \$filename $filename ) : \PhingFile

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

Parameters
Name Type Description
$file \$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 \$filename

a file name

Returns
Type Description
\PhingFile A PhingFile object pointing to an absolute file that doesn't contain ./ or ../ sequences and uses the correct separator for the current platform.
Documentation was generated by DocBlox 0.18.1.