class Patcher

A Unified Diff Format Patcher class

Constants

SRC_FILE

Regular expression for searching source files

DST_FILE

Regular expression for searching destination files

HUNK

Regular expression for searching hunks of differences

SPLIT

Regular expression for splitting lines

Methods

static  FilesystemPatcher
getInstance()

Method to get a patcher

FilesystemPatcher
reset()

Reset the pacher

integer
apply()

Apply the patches

FilesystemPatcher
addFile( string $filename, string $root = JPATH_BASE, string $strip)

Add a unified diff file to the patcher

FilesystemPatcher
add( string $udiff, string $root = JPATH_BASE, string $strip)

Add a unified diff string to the patcher

Details

static FilesystemPatcher getInstance()

Method to get a patcher

Return Value

FilesystemPatcher an instance of the patcher

FilesystemPatcher reset()

Reset the pacher

Return Value

FilesystemPatcher This object for chaining

integer apply()

Apply the patches

Return Value

integer The number of files patched

Exceptions

RuntimeException

FilesystemPatcher addFile( string $filename, string $root = JPATH_BASE, string $strip)

Add a unified diff file to the patcher

Parameters

string $filename Path to the unified diff file
string $root The files root path
string $strip The number of '/' to strip

Return Value

FilesystemPatcher $this for chaining

FilesystemPatcher add( string $udiff, string $root = JPATH_BASE, string $strip)

Add a unified diff string to the patcher

Parameters

string $udiff Unified diff input string
string $root The files root path
string $strip The number of '/' to strip

Return Value

FilesystemPatcher $this for chaining