Skip to content

Commit

Permalink
[jan] Add Horde_Pear_Package_Xml#getVersions().
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Apr 5, 2016
1 parent f35aa67 commit d3da167
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions framework/Pear/lib/Horde/Pear/Package/Xml.php
Expand Up @@ -186,6 +186,27 @@ public function getVersion()
return $this->getNodeText('/p:package/p:version/p:release');
}

/**
* Returns all package versions from the changelog.
*
* @return array A list of versions and stabilities.
*/
public function getVersions()
{
$versions = array();
foreach ($this->findNodes('/p:package/p:changelog/p:release') as $release) {
$versions[] = array(
'version' => $this->getNodeTextRelativeTo(
'p:version/p:release', $release
),
'stability' => $this->getNodeTextRelativeTo(
'p:stability/p:release', $release
),
);
}
return $versions;
}

/**
* Return the release date.
*
Expand Down
4 changes: 2 additions & 2 deletions framework/Pear/package.xml
Expand Up @@ -21,7 +21,7 @@
</stability>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Add Horde_Pear_Package_Xml#getVersions().
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -587,7 +587,7 @@
<date>2016-03-08</date>
<license uri="http://www.horde.org/licenses/lgpl21">LGPL-2.1</license>
<notes>
*
* [jan] Add Horde_Pear_Package_Xml#getVersions().
</notes>
</release>
</changelog>
Expand Down

0 comments on commit d3da167

Please sign in to comment.