当前位置: 首页>>代码示例>>PHP>>正文


PHP PackageManager::getReleases方法代码示例

本文整理汇总了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));
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:36,代码来源:PackageController.php

示例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;
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:23,代码来源:PackageManager.php


注:本文中的PackageManager::getReleases方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。