Simplify code
parent
08de99f2be
commit
e92e3ba355
|
@ -51,10 +51,7 @@ class PearRepository extends ArrayRepository
|
||||||
$categories = $categoryXML->getElementsByTagName("c");
|
$categories = $categoryXML->getElementsByTagName("c");
|
||||||
|
|
||||||
foreach ($categories as $category) {
|
foreach ($categories as $category) {
|
||||||
$link = $category->getAttribute("xlink:href");
|
$link = '/' . ltrim($category->getAttribute("xlink:href"), '/');
|
||||||
if (0 !== strpos($link, '/')) {
|
|
||||||
$link = '/' . $link;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
$packagesLink = str_replace("info.xml", "packagesinfo.xml", $link);
|
$packagesLink = str_replace("info.xml", "packagesinfo.xml", $link);
|
||||||
$this->fetchPear2Packages($this->url . $packagesLink);
|
$this->fetchPear2Packages($this->url . $packagesLink);
|
||||||
|
|
Loading…
Reference in New Issue