Page MenuHomePhorge
Diviner Tech Docs PhabricatorDifferenceEngine

final class PhabricatorDifferenceEngine
Phorge Technical Documentation ()

Utility class which encapsulates some shared behavior between different applications which render diffs.

Tasks

Configuring the Engine

  • public function setOldName($old_name) — Set the name to identify the old file with. Primarily cosmetic.
  • public function setNewName($new_name) — Set the name to identify the new file with. Primarily cosmetic.

Generating Diffs

  • public function generateRawDiffFromFileContent($old, $new) — Generate a raw diff from two raw files. This is a lower-level API than @{method:generateChangesetFromFileContent}, but may be useful if you need to use a custom parser configuration, as with Diffusion.
  • public function generateChangesetFromFileContent($old, $new) — Generate an @{class:DifferentialChangeset} from two raw files. This is principally useful because you can feed the output to @{class:DifferentialChangesetParser} in order to render it.

Other Methods

Methods

public function __get($name)
Inherited

This method is not documented.
Parameters
$name
Return
wild

public function __set($name, $value)
Inherited

This method is not documented.
Parameters
$name
$value
Return
wild

public function current()
Inherited

This method is not documented.
Return
wild

public function key()
Inherited

This method is not documented.
Return
wild

public function next()
Inherited

This method is not documented.
Return
wild

public function rewind()
Inherited

This method is not documented.
Return
wild

public function valid()
Inherited

This method is not documented.
Return
wild

private function throwOnAttemptedIteration()
Inherited

This method is not documented.
Return
wild

public function getPhobjectClassConstant($key, $byte_limit)
Inherited

Phobject

Read the value of a class constant.

This is the same as just typing self::CONSTANTNAME, but throws a more useful message if the constant is not defined and allows the constant to be limited to a maximum length.

Parameters
string$keyName of the constant.
int|null$byte_limitMaximum number of bytes permitted in the value.
Return
stringValue of the constant.

public function setOldName($old_name)

Set the name to identify the old file with. Primarily cosmetic.

Parameters
string$old_nameOld file name.
Return
this

public function setNewName($new_name)

Set the name to identify the new file with. Primarily cosmetic.

Parameters
string$new_nameNew file name.
Return
this

public function setNormalize($normalize)

This method is not documented.
Parameters
$normalize
Return
wild

public function getNormalize()

This method is not documented.
Return
wild

public function generateRawDiffFromFileContent($old, $new)

Generate a raw diff from two raw files. This is a lower-level API than generateChangesetFromFileContent(), but may be useful if you need to use a custom parser configuration, as with Diffusion.

Parameters
string$oldEntire previous file content.
string$newEntire current file content.
Return
stringRaw diff between the two files.

public function generateChangesetFromFileContent($old, $new)

Generate an DifferentialChangeset from two raw files. This is principally useful because you can feed the output to DifferentialChangesetParser in order to render it.

Parameters
string$oldEntire previous file content.
string$newEntire current file content.
Return
@{class:DifferentialChangeset}Synthetic changeset.

private function normalizeFile($corpus)

This method is not documented.
Parameters
$corpus
Return
wild

public static function applyIntralineDiff($str, $intra_stack)

This method is not documented.
Parameters
$str
$intra_stack
Return
wild