Book/xmldiff-Phpdoc专题

XML diff and merge

目录

简介

Base abstract class for all the comparsion classes in the extension.

类摘要

XMLDiff\Base

class XMLDiff\Base {

/* 方法 */

public <span class="methodname">__construct ( <span class="methodparam">string $nsname )

abstract <span class="modifier">public mixed <span class="methodname">diff ( <span class="type">mixed $from , <span class="methodparam">mixed $to )

abstract <span class="modifier">public mixed <span class="methodname">merge ( <span class="type">mixed $src , <span class="methodparam">mixed $diff )

}

XMLDiff\Base::__construct

Constructor

说明

public <span class="methodname">XMLDiff\Base::__construct ( <span class="methodparam">string $nsname )

Base constructor for all the worker classes in the xmldiff extension.

参数

nsname
Custom namespace name for the diff document. The default namespace is http://www.locus.cz/diffmark and that's enough to avoid namespace conflicts. Use this parameter if you want to change it for some reason.

返回值

XMLDiff\Base::diff

Produce diff of two XML documents

说明

abstract <span class="modifier">public mixed <span class="methodname">XMLDiff\Base::diff ( <span class="methodparam">mixed $from , mixed $to )

Abstract diff method to be implemented by inheriting classes.

The basic purpose of this method is to produce diff of the two documents. The param order matters and will produce different output.

参数

from
Source XML document.

to
Target XML document.

返回值

Implementation dependent.

XMLDiff\Base::merge

Produce new XML document based on diff

说明

abstract <span class="modifier">public mixed <span class="methodname">XMLDiff\Base::merge ( <span class="methodparam">mixed $src , mixed $diff )

Abstract merge method to be implemented by inheriting classes.

Basically the method purpose is to produce a new XML document based on the diff information.

参数

src
Source XML document.

diff
Document produced by the diff method.

返回值

Implementation dependent.

简介

类摘要

XMLDiff\DOM

class XMLDiff\DOM <span class="ooclass"> extends XMLDiff\Base {

/* 方法 */

public <span class="type">DOMDocument diff ( DOMDocument $from , <span class="type">DOMDocument $to )

public <span class="type">DOMDocument merge ( DOMDocument $src , <span class="type">DOMDocument $diff )

/* 继承的方法 */

public <span class="methodname">XMLDiff\Base::__construct ( <span class="methodparam">string $nsname )

abstract <span class="modifier">public mixed <span class="methodname">XMLDiff\Base::diff ( <span class="methodparam">mixed $from , mixed $to )

abstract <span class="modifier">public mixed <span class="methodname">XMLDiff\Base::merge ( <span class="methodparam">mixed $src , mixed $diff )

}

XMLDiff\DOM::diff

Diff two DOMDocument objects

说明

public <span class="type">DOMDocument <span class="methodname">XMLDiff\DOM::diff ( <span class="methodparam">DOMDocument $from , DOMDocument $to )

Diff two DOMDocument instances and produce the new one containing the diff information.

参数

from
Source DOMDocument object.

to
Target DOMDocument object.

返回值

DOMDocument with the diff information or NULL.

XMLDiff\DOM::merge

Produce merged DOMDocument

说明

public <span class="type">DOMDocument <span class="methodname">XMLDiff\DOM::merge ( <span class="methodparam">DOMDocument $src , DOMDocument $diff )

Create new DOMDocument based on the diff.

参数

src
Source DOMDocument object.

diff
DOMDocument object containing the diff information.

返回值

Merged DOMDocument or NULL.

简介

类摘要

XMLDiff\Memory

class XMLDiff\Memory <span class="ooclass"> extends XMLDiff\Base {

/* 方法 */

public string diff ( <span class="type">string $from , <span class="methodparam">string $to )

public string merge ( <span class="type">string $src , <span class="methodparam">string $diff )

/* 继承的方法 */

public <span class="methodname">XMLDiff\Base::__construct ( <span class="methodparam">string $nsname )

abstract <span class="modifier">public mixed <span class="methodname">XMLDiff\Base::diff ( <span class="methodparam">mixed $from , mixed $to )

abstract <span class="modifier">public mixed <span class="methodname">XMLDiff\Base::merge ( <span class="methodparam">mixed $src , mixed $diff )

}

XMLDiff\Memory::diff

Diff two XML documents

说明

public string XMLDiff\Memory::diff ( <span class="methodparam">string $from , string $to )

Diff two strings containing XML documents and produce the diff information.

参数

from
Source XML document.

to
Target XML document.

返回值

String with the XML document containing the diff information or NULL.

XMLDiff\Memory::merge

Produce merged XML document

说明

public string XMLDiff\Memory::merge ( <span class="methodparam">string $src , string $diff )

Create new XML document based on diffs and source document.

参数

src
Source XML document.

diff
XML document containing diff information.

返回值

String with the new XML document or NULL.

简介

类摘要

XMLDiff\File

class XMLDiff\File <span class="ooclass"> extends XMLDiff\Base {

/* 方法 */

public string diff ( <span class="type">string $from , <span class="methodparam">string $to )

public string merge ( <span class="type">string $src , <span class="methodparam">string $diff )

/* 继承的方法 */

public <span class="methodname">XMLDiff\Base::__construct ( <span class="methodparam">string $nsname )

abstract <span class="modifier">public mixed <span class="methodname">XMLDiff\Base::diff ( <span class="methodparam">mixed $from , mixed $to )

abstract <span class="modifier">public mixed <span class="methodname">XMLDiff\Base::merge ( <span class="methodparam">mixed $src , mixed $diff )

}

XMLDiff\File::diff

Diff two XML files

说明

public string XMLDiff\File::diff ( <span class="methodparam">string $from , string $to )

Diff two local XML files and produce string with the diff information.

参数

from
Path to the source document.

to
Path to the target document.

返回值

String with the XML document containing the diff information or NULL.

XMLDiff\File::merge

Produce merged XML document

说明

public string XMLDiff\File::merge ( <span class="methodparam">string $src , string $diff )

Create new XML document based on diffs and source document.

参数

src
Path to the source XML document.

diff
Path to the XML document with the diff information.

返回值

String with the new XML document or NULL.


本站为非盈利网站,作品由网友提供上传,如无意中有侵犯您的版权,请联系删除