cvs: pear-core /PEAR/REST 11.php

From: Date: Sat, 01 Apr 2006 16:59:56 +0000
Subject: cvs: pear-core /PEAR/REST 11.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-core+get-4692@lists.php.net to get a copy of this message
pajoye Sat Apr 1 16:59:56 2006 UTC Modified files: /pear-core/PEAR/REST 11.php Log: - respect the old behavior, latest stable release version number is listed when the preferred_state is stable - add some air in this horrible block :) http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/REST/11.php?r1=1.4&r2=1.5&diff_format=u Index: pear-core/PEAR/REST/11.php diff -u pear-core/PEAR/REST/11.php:1.4 pear-core/PEAR/REST/11.php:1.5 --- pear-core/PEAR/REST/11.php:1.4 Fri Jan 6 04:47:37 2006 +++ pear-core/PEAR/REST/11.php Sat Apr 1 16:59:56 2006 @@ -15,7 +15,7 @@ * @author Greg Beaver <cellog@php.net> * @copyright 1997-2006 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: 11.php,v 1.4 2006/01/06 04:47:37 cellog Exp $ + * @version CVS: $Id: 11.php,v 1.5 2006/04/01 16:59:56 pajoye Exp $ * @link http://pear.php.net/package/PEAR * @since File available since Release 1.4.3 */ @@ -60,19 +60,24 @@ $categorylist['c'] = array($categorylist['c']); } PEAR::pushErrorHandling(PEAR_ERROR_RETURN); + foreach ($categorylist['c'] as $progress => $category) { $category = $category['_content']; $packagesinfo = $this->_rest->retrieveData($base . 'c/' . urlencode($category) . '/packagesinfo.xml'); + if (PEAR::isError($packagesinfo)) { continue; } + if (!is_array($packagesinfo) || !isset($packagesinfo['pi'])) { continue; } + if (!is_array($packagesinfo['pi']) || !isset($packagesinfo['pi'][0])) { $packagesinfo['pi'] = array($packagesinfo['pi']); } + foreach ($packagesinfo['pi'] as $packageinfo) { $info = $packageinfo['p']; $package = $info['n']; @@ -81,6 +86,7 @@ unset($unstable); unset($stable); unset($state); + if ($releases) { if (!isset($releases['r'][0])) { $releases['r'] = array($releases['r']); @@ -114,13 +120,23 @@ } } } + if ($basic) { // remote-list command if (!isset($latest)) { $latest = false; } - $ret[$package] = array('stable' => $latest); + if ($dostable) { + if ($state == 'stable') { + $ret[$package] = array('stable' => $latest); + } else { + $ret[$package] = array('stable' => '-n/a-'); + } + } else { + $ret[$package] = array('stable' => $latest); + } continue; } + // list-all command $deps = array(); if (!isset($unstable)) { @@ -132,9 +148,11 @@ } else { $latest = $unstable; } + if (!isset($latest)) { $latest = false; } + if ($latest) { if (isset($packageinfo['deps'])) { if (!is_array($packageinfo['deps']) || @@ -169,9 +187,7 @@ } } } - if (!isset($stable)) { - $stable = '-n/a-'; - } + $info = array('stable' => $latest, 'summary' => $info['s'], 'description' => $info['d'], 'deps' => $deps, 'category' => $info['ca']['_content'],

« previous php.pear.core (#4692) next »