classes/phing/tasks/ext/PatchTask.php
\PatchTask
Patches a file by applying a 'diff' file to it
Requires "patch" to be on the execution path.
- Extends from
- \Task
- author
- Andreas Aderhold
- copyright
- 2001,2002 THYRELL. All rights reserved
- package
- phing.tasks.ext
- version
- $Revision: 912 $
Constants
Properties

array
$cmdArgs= 'array'
Command line arguments for patch binary
arrayDetails- Type
- array

bool
$haltOnFailure= 'false'
Halt on error return value from patch invocation.
falseDetails- Type
- bool
Methods

setBackups(
bool $backups
)
:
voidFlag to create backups
Optional, default - false
| Name | Type | Description |
|---|---|---|
| $backups | bool | If true create backups |

setDestFile(
string $file
)
:
voidThe name of a file to send the output to, instead of patching
the file(s) in place
Optional.
| Name | Type | Description |
|---|---|---|
| $file | string | File to send the output to |

setDir(
string $directory
)
:
voidThe directory to run the patch command in
Defaults to the project's base directory.
| Name | Type | Description |
|---|---|---|
| $directory | string | Directory to run the patch command in |

setForward(
bool $flag
)
:
voidIgnore patches that seem to be reversed or already applied
| Name | Type | Description |
|---|---|---|
| $flag | bool | If true set the -N (--forward) option |

setFuzz(
string $value
)
:
voidSet the maximum fuzz factor
Defaults to 0
| Name | Type | Description |
|---|---|---|
| $value | string | Value of a fuzz factor |

setHaltOnFailure(
bool $value
)
:
voidIf true, stop the build process if the patch command
exits with an error status.
The default is "false"
| Name | Type | Description |
|---|---|---|
| $value | bool | "true" if it should halt, otherwise "false" |

setIgnoreWhiteSpace(
bool $ignore
)
:
voidFlag to ignore whitespace differences;
Default - false
| Name | Type | Description |
|---|---|---|
| $ignore | bool | If true ignore whitespace differences |

setOriginalFile(
string $file
)
:
voidThe file to patch
Optional if it can be inferred from the diff file.
| Name | Type | Description |
|---|---|---|
| $file | string | File to patch |

setPatchFile(
string $file
)
:
voidThe file containing the diff output
Required.
| Name | Type | Description |
|---|---|---|
| $file | string | File containing the diff output |
- throws
- if $file not exists

setQuiet(
bool $flag
)
:
voidWork silently unless an error occurs
Optional, default - false
| Name | Type | Description |
|---|---|---|
| $flag | bool | If true suppress set the -s option on the patch command |

setReverse(
bool $flag
)
:
voidAssume patch was created with old and new files swapped
Optional, default - false
| Name | Type | Description |
|---|---|---|
| $flag | bool | If true set the -R option on the patch command |