本文整理汇总了PHP中PackageManager::getReleases方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageManager::getReleases方法的具体用法?PHP PackageManager::getReleases怎么用?PHP PackageManager::getReleases使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PackageManager
的用法示例。
在下文中一共展示了PackageManager::getReleases方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkForUpdates
/**
* Check the SugarDepot for updates for the given type as passed in via POST
* @param type the type to check for
* @return array return an array of releases for each given installed object if an update is found
*/
function checkForUpdates()
{
$json = getJSONobj();
$type = '';
if (isset($_REQUEST['type'])) {
$type = nl2br($_REQUEST['type']);
}
$pm = new PackageManager();
$updates = $pm->checkForUpdates();
$nodes = array();
$release_map = array();
if (!empty($updates)) {
foreach ($updates as $update) {
$update = PackageManager::fromNameValueList($update);
$nodes[] = array('label' => $update['name'], 'description' => $update['description'], 'version' => $update['version'], 'build_number' => $update['build_number'], 'id' => $update['id'], 'type' => $update['type']);
$release_map[$update['id']] = array('package_id' => $update['package_id'], 'category_id' => $update['category_id'], 'type' => $update['type']);
}
}
//patches
$filter = array(array('name' => 'type', 'value' => "'patch'"));
$releases = $pm->getReleases('', '', $filter);
if (!empty($releases['packages'])) {
foreach ($releases['packages'] as $update) {
$update = PackageManager::fromNameValueList($update);
$nodes[] = array('label' => $update['name'], 'description' => $update['description'], 'version' => $update['version'], 'build_number' => $update['build_number'], 'id' => $update['id'], 'type' => $update['type']);
$release_map[$update['id']] = array('package_id' => $update['package_id'], 'category_id' => $update['category_id'], 'type' => $update['type']);
}
}
$_SESSION['ML_PATCHES'] = $release_map;
echo 'result = ' . $json->encode(array('updates' => $nodes));
}
示例2: getPackages
function getPackages($category_id, $filter = array())
{
$nodes = array();
$results = PackageManagerComm::getPackages($category_id, $filter);
PackageManagerComm::errorCheck();
$packages = array();
//$xml = '';
//$xml .= '<packages>';
if (!empty($results['packages'])) {
foreach ($results['packages'] as $package) {
$mypack = PackageManager::fromNameValueList($package);
$packages[$mypack['id']] = array('package_id' => $mypack['id'], 'name' => $mypack['name'], 'description' => $mypack['description'], 'category_id' => $mypack['category_id']);
$releases = PackageManager::getReleases($category_id, $mypack['id']);
$arr_releases = array();
foreach ($releases['packages'] as $release) {
$myrelease = PackageManager::fromNameValueList($release);
$arr_releases[$myrelease['id']] = array('release_id' => $myrelease['id'], 'version' => $myrelease['version'], 'description' => $myrelease['description'], 'category_id' => $mypack['category_id'], 'package_id' => $mypack['id']);
}
$packages[$mypack['id']]['releases'] = $arr_releases;
}
}
return $packages;
}