class Diff extends Diff (View source)

deprecated 4.13.0 Will be replaced with SilverStripe\View\Parsers\HtmlDiff

Class representing a 'diff' between two sequences of strings.

Properties

public static $html_cleaner_class

Methods

public
__construct($from_lines, $to_lines)

No description

public static 
mixed|string
cleanHTML(string $content, HTMLCleaner $cleaner = null) deprecated

Attempt to clean invalid HTML, which messes up diffs.

public static 
string
compareHTML(string $from, string $to, bool $escape = false) deprecated

No description

public static 
array
getHTMLChunks(string|bool|array $content) deprecated

No description

Details

__construct($from_lines, $to_lines)

No description

Parameters

$from_lines
$to_lines

static mixed|string cleanHTML(string $content, HTMLCleaner $cleaner = null) deprecated

deprecated 4.13.0 Will be removed without equivalent functionality

Attempt to clean invalid HTML, which messes up diffs.

This cleans code if possible, using an instance of HTMLCleaner

NB: By default, only extremely simple tidying is performed, by passing through DomDocument::loadHTML and saveXML

Parameters

string $content

HTML content

HTMLCleaner $cleaner

Optional instance of a HTMLCleaner class to use, overriding self::$html_cleaner_class

Return Value

mixed|string

static string compareHTML(string $from, string $to, bool $escape = false) deprecated

deprecated 4.13.0 Will be replaced with SilverStripe\View\Parsers\HtmlDiff::compareHTML()

No description

Parameters

string $from
string $to
bool $escape

Return Value

string

static array getHTMLChunks(string|bool|array $content) deprecated

deprecated 4.13.0 Will be removed without equivalent functionality

No description

Parameters

string|bool|array $content

If passed as an array, values will be concatenated with a comma.

Return Value

array