PHP Class Horde_Pear_Package_Xml, horde

Datei anzeigen Open project: horde/horde Class Usage Examples

Public Methods

Method Description
__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.

Private Methods

Method Description
_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.

Method Details

__call() public method

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.
return mixed

__construct() public method

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

__toString() public method

Return the complete package.xml as string.
public __toString ( ) : string
return string The package.xml content.

_insertWhiteSpace() public method

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.
return DOMNode The inserted white space node.

addNextVersion() public method

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
return null

addNote() public method

Add a new note to the package.xml
public addNote ( string $note ) : null
$note string The note text.
return null

append() public method

public append ( $elements, $parent )

createComment() public method

public createComment ( $comment )

createNode() public method

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

createText() public method

public createText ( $text )

findNode() public method

Return a single named node matching the given XPath query.
public findNode ( string $query ) : DOMNode | false
$query string The query.
return DOMNode | false The named DOMNode or empty if no node was found.

findNodeRelativeTo() public method

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.
return DOMNode | false The named DOMNode or empty if no node was found.

findNodes() public method

Return all nodes matching the given XPath query.
public findNodes ( string $query ) : DOMNodeList
$query string The query.
return DOMNodeList The list of DOMNodes.

findNodesRelativeTo() public method

Return all nodes matching the given XPath query.
public findNodesRelativeTo ( string $query, $context ) : DOMNodeList
$query string The query.
return DOMNodeList The list of DOMNodes.

getChannel() public method

Return the package channel.
public getChannel ( ) : string
return string The channel of the package.

getContent() public method

Return the list of contents.
public getContent ( $type = 'horde', $path = null ) : Horde_Pear_Package_Contents_List
return Horde_Pear_Package_Contents_List The contents.

getDate() public method

Return the release date.
public getDate ( ) : string
return string The date for the current release.

getDependencies() public method

Return the package dependencies.
public getDependencies ( ) : array
return array The package dependencies.

getDescription() public method

Return the package description.
public getDescription ( ) : string
return string The description of the package.

getLeads() public method

Return the package lead developers.
public getLeads ( ) : string
return string The package lead developers.

getLicense() public method

Return the license name.
public getLicense ( ) : string
return string The name of the license.

getLicenseLocation() public method

Return the URL to the license information.
public getLicenseLocation ( ) : string
return string The license URI.

getName() public method

Return the package name.
public getName ( ) : string
return string The name of the package.

getNodeText() public method

Return the content of a single named node matching the given XPath query.
public getNodeText ( string $path ) : string | false
$path string The node path.
return string | false The node content as string or empty if no node was found.

getNodeTextRelativeTo() public method

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.
return string | false The node content as string or empty if no node was found.

getNotes() public method

Return the package notes.
public getNotes ( ) : string
return string The notes for the current release.

getState() public method

Return the stability of the release or api.
public getState ( string $key = 'release' ) : string
$key string "release" or "api"
return string The stability.

getSummary() public method

Return the package summary.
public getSummary ( ) : string
return string The summary of the package.

getVersion() public method

Return the package version.
public getVersion ( ) : string
return string The version of the package.

getVersions() public method

Returns all package versions from the changelog.
public getVersions ( ) : array
return array A list of versions and stabilities.

insert() public method

public insert ( $elements, $point )

removeComment() public method

public removeComment ( $node, $comment )

removeWhitespace() public method

public removeWhitespace ( $node )

replaceTextNode() public method

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.
return DOMNodeList The list of DOMNodes.

replaceTextNodeRelativeTo() public method

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.
return DOMNodeList The list of DOMNodes.

setState() public method

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.
return null

setVersion() public method

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.
return null

syncCurrentVersion() public method

Synchronizes the current version information with the release information in the changelog.
public syncCurrentVersion ( ) : null
return null

timestamp() public method

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