PHP Класс Horde_Pear_Package_Xml, horde

Автор: Gunnar Wrobel ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__call ( string $name, array $arguments ) : mixed Catch undefined method calls and try to run them as task.
__construct ( resource | string $xml, $factory = null ) Constructor.
__toString ( ) : string Return the complete package.xml as string.
_insertWhiteSpace ( DOMNode $parent, string $ws ) : DOMNode Insert some white space.
addNextVersion ( string $version, string $initial_note, string $stability_api = null, string $stability_release = null, boolean $keepTime = false ) : null Add the next version to the package.xml
addNote ( string $note ) : null Add a new note to the package.xml
append ( $elements, $parent )
createComment ( $comment )
createNode ( $name, $attributes = [] )
createText ( $text )
findNode ( string $query ) : DOMNode | false Return a single named node matching the given XPath query.
findNodeRelativeTo ( string $query, DOMNode $context ) : DOMNode | false Return a single named node below the given context matching the given XPath query.
findNodes ( string $query ) : DOMNodeList Return all nodes matching the given XPath query.
findNodesRelativeTo ( string $query, $context ) : DOMNodeList Return all nodes matching the given XPath query.
getChannel ( ) : string Return the package channel.
getContent ( $type = 'horde', $path = null ) : Horde_Pear_Package_Contents_List Return the list of contents.
getDate ( ) : string Return the release date.
getDependencies ( ) : array Return the package dependencies.
getDescription ( ) : string Return the package description.
getLeads ( ) : string Return the package lead developers.
getLicense ( ) : string Return the license name.
getLicenseLocation ( ) : string Return the URL to the license information.
getName ( ) : string Return the package name.
getNodeText ( string $path ) : string | false Return the content of a single named node matching the given XPath query.
getNodeTextRelativeTo ( string $path, DOMNode $context ) : string | false Return the content of a single named node below the given context and matching the given XPath query.
getNotes ( ) : string Return the package notes.
getState ( string $key = 'release' ) : string Return the stability of the release or api.
getSummary ( ) : string Return the package summary.
getVersion ( ) : string Return the package version.
getVersions ( ) : array Returns all package versions from the changelog.
insert ( $elements, $point )
removeComment ( $node, $comment )
removeWhitespace ( $node )
replaceTextNode ( string $path, string $value ) : DOMNodeList Replace a specific text node
replaceTextNodeRelativeTo ( string $path, DOMNode $context, string $value, $attributes = [] ) : DOMNodeList Replace a specific text node
setState ( string $rel_state = null, string $api_state = null ) : null Set the state in the package.xml
setVersion ( string $rel_version = null, string $api_version = null ) : null Set the version in the package.xml
syncCurrentVersion ( ) : null Synchronizes the current version information with the release information in the changelog.
timestamp ( boolean $keepTime = false ) Mark the package as being release and set the timestamps to now.

Приватные методы

Метод Описание
_appendChild ( DOMNode $parent, string $name, string $value, string $ws = '' ) : null Append a new child.
_appendLicense ( DOMNode $parent, string $license, string $uri, string $ws = null ) : null Append license information.
_appendStability ( DOMNode $parent, string $release, string $api, string $ws = null ) : null Append stability information.
_appendVersion ( DOMNode $parent, string $version, string $api, string $ws = '' ) : null Append version information.
_completeDependencies ( DOMNode $parent, &$result, string $optional ) : null Complete the dependency information.
_dependencyInputValue ( &$input, string $name, DOMNode $node ) : null Generate one element of the input data.
_fetchCurrentRelease ( ) : DOMElement | null Fetch the node holding the current release information in the changelog.
_findSingleNode ( DOMNodeList $result ) : DOMNode | false Return a single node for the result set.
_replacementNode ( DOMNode $old_node, string $value ) : DOMNode Generate a replacement node.
_requireCurrentRelease ( ) : DOMElement | null Fetch the node holding the current release information in the changelog and fail if there is no such node.

Описание методов

__call() публичный Метод

Catch undefined method calls and try to run them as task.
public __call ( string $name, array $arguments ) : mixed
$name string The method/task name.
$arguments array The arguments for the call.
Результат mixed

__construct() публичный Метод

Constructor.
public __construct ( resource | string $xml, $factory = null )
$xml resource | string The package.xml as stream or path.

__toString() публичный Метод

Return the complete package.xml as string.
public __toString ( ) : string
Результат string The package.xml content.

_insertWhiteSpace() публичный Метод

Insert some white space.
public _insertWhiteSpace ( DOMNode $parent, string $ws ) : DOMNode
$parent DOMNode The parent DOMNode.
$ws string Additional white space that should be inserted.
Результат DOMNode The inserted white space node.

addNextVersion() публичный Метод

Add the next version to the package.xml
public addNextVersion ( string $version, string $initial_note, string $stability_api = null, string $stability_release = null, boolean $keepTime = false ) : null
$version string The new version number.
$initial_note string The text for the initial note.
$stability_api string The API stability for the next release.
$stability_release string The stability for the next release.
$keepTime boolean Keep the
Результат null

addNote() публичный Метод

Add a new note to the package.xml
public addNote ( string $note ) : null
$note string The note text.
Результат null

append() публичный Метод

public append ( $elements, $parent )

createComment() публичный Метод

public createComment ( $comment )

createNode() публичный Метод

public createNode ( $name, $attributes = [] )

createText() публичный Метод

public createText ( $text )

findNode() публичный Метод

Return a single named node matching the given XPath query.
public findNode ( string $query ) : DOMNode | false
$query string The query.
Результат DOMNode | false The named DOMNode or empty if no node was found.

findNodeRelativeTo() публичный Метод

Return a single named node below the given context matching the given XPath query.
public findNodeRelativeTo ( string $query, DOMNode $context ) : DOMNode | false
$query string The query.
$context DOMNode Search below this node.
Результат DOMNode | false The named DOMNode or empty if no node was found.

findNodes() публичный Метод

Return all nodes matching the given XPath query.
public findNodes ( string $query ) : DOMNodeList
$query string The query.
Результат DOMNodeList The list of DOMNodes.

findNodesRelativeTo() публичный Метод

Return all nodes matching the given XPath query.
public findNodesRelativeTo ( string $query, $context ) : DOMNodeList
$query string The query.
Результат DOMNodeList The list of DOMNodes.

getChannel() публичный Метод

Return the package channel.
public getChannel ( ) : string
Результат string The channel of the package.

getContent() публичный Метод

Return the list of contents.
public getContent ( $type = 'horde', $path = null ) : Horde_Pear_Package_Contents_List
Результат Horde_Pear_Package_Contents_List The contents.

getDate() публичный Метод

Return the release date.
public getDate ( ) : string
Результат string The date for the current release.

getDependencies() публичный Метод

Return the package dependencies.
public getDependencies ( ) : array
Результат array The package dependencies.

getDescription() публичный Метод

Return the package description.
public getDescription ( ) : string
Результат string The description of the package.

getLeads() публичный Метод

Return the package lead developers.
public getLeads ( ) : string
Результат string The package lead developers.

getLicense() публичный Метод

Return the license name.
public getLicense ( ) : string
Результат string The name of the license.

getLicenseLocation() публичный Метод

Return the URL to the license information.
public getLicenseLocation ( ) : string
Результат string The license URI.

getName() публичный Метод

Return the package name.
public getName ( ) : string
Результат string The name of the package.

getNodeText() публичный Метод

Return the content of a single named node matching the given XPath query.
public getNodeText ( string $path ) : string | false
$path string The node path.
Результат string | false The node content as string or empty if no node was found.

getNodeTextRelativeTo() публичный Метод

Return the content of a single named node below the given context and matching the given XPath query.
public getNodeTextRelativeTo ( string $path, DOMNode $context ) : string | false
$path string The node path.
$context DOMNode Search below this node.
Результат string | false The node content as string or empty if no node was found.

getNotes() публичный Метод

Return the package notes.
public getNotes ( ) : string
Результат string The notes for the current release.

getState() публичный Метод

Return the stability of the release or api.
public getState ( string $key = 'release' ) : string
$key string "release" or "api"
Результат string The stability.

getSummary() публичный Метод

Return the package summary.
public getSummary ( ) : string
Результат string The summary of the package.

getVersion() публичный Метод

Return the package version.
public getVersion ( ) : string
Результат string The version of the package.

getVersions() публичный Метод

Returns all package versions from the changelog.
public getVersions ( ) : array
Результат array A list of versions and stabilities.

insert() публичный Метод

public insert ( $elements, $point )

removeComment() публичный Метод

public removeComment ( $node, $comment )

removeWhitespace() публичный Метод

public removeWhitespace ( $node )

replaceTextNode() публичный Метод

Replace a specific text node
public replaceTextNode ( string $path, string $value ) : DOMNodeList
$path string The XPath query pointing to the node.
$value string The new text value.
Результат DOMNodeList The list of DOMNodes.

replaceTextNodeRelativeTo() публичный Метод

Replace a specific text node
public replaceTextNodeRelativeTo ( string $path, DOMNode $context, string $value, $attributes = [] ) : DOMNodeList
$path string The XPath query pointing to the node.
$context DOMNode Search below this node.
$value string The new text value.
Результат DOMNodeList The list of DOMNodes.

setState() публичный Метод

Set the state in the package.xml
public setState ( string $rel_state = null, string $api_state = null ) : null
$rel_state string The new release state number.
$api_state string The new api state number.
Результат null

setVersion() публичный Метод

Set the version in the package.xml
public setVersion ( string $rel_version = null, string $api_version = null ) : null
$rel_version string The new release version number.
$api_version string The new api version number.
Результат null

syncCurrentVersion() публичный Метод

Synchronizes the current version information with the release information in the changelog.
public syncCurrentVersion ( ) : null
Результат null

timestamp() публичный Метод

Mark the package as being release and set the timestamps to now.
public timestamp ( boolean $keepTime = false )
$keepTime boolean Keep the