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


PHP PackageManager::fromNameValueList方法代码示例

本文整理汇总了PHP中PackageManager::fromNameValueList方法的典型用法代码示例。如果您正苦于以下问题:PHP PackageManager::fromNameValueList方法的具体用法?PHP PackageManager::fromNameValueList怎么用?PHP PackageManager::fromNameValueList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PackageManager的用法示例。


在下文中一共展示了PackageManager::fromNameValueList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: createJavascriptPackageArray

 function createJavascriptPackageArray($releases)
 {
     $output = "var mti_data = [";
     $count = count($releases);
     $index = 1;
     if (!empty($releases['packages'])) {
         foreach ($releases['packages'] as $release) {
             $release = PackageManager::fromNameValueList($release);
             $output .= "[";
             $output .= "'" . $release['description'] . "', '" . $release['version'] . "', '" . $release['build_number'] . "', '" . $release['id'] . "'";
             $output .= "]";
             if ($index < $count) {
                 $output .= ",";
             }
             $index++;
         }
     }
     $output .= "]\n;";
     return $output;
 }
开发者ID:jgera,项目名称:sugarcrm_dev,代码行数:20,代码来源:PackageManagerDisplay.php

示例3: buildPackageXML

 function buildPackageXML($package, $releases = array())
 {
     $xml = '<package>';
     $xml .= '<package_id>' . $package['id'] . '</package_id>';
     $xml .= '<name>' . $package['name'] . '</name>';
     $xml .= '<description>' . $package['description'] . '</description>';
     if (!empty($releases)) {
         $xml .= '<releases>';
         foreach ($releases['packages'] as $release) {
             $myrelease = PackageManager::fromNameValueList($release);
             $xml .= '<release>';
             $xml .= '<release_id>' . $myrelease['id'] . '</release_id>';
             $xml .= '<version>' . $myrelease['version'] . '</version>';
             $xml .= '<description>' . $myrelease['description'] . '</description>';
             $xml .= '<package_id>' . $package['id'] . '</package_id>';
             $xml .= '<category_id>' . $package['category_id'] . '</category_id>';
             $xml .= '</release>';
         }
         $xml .= '</releases>';
     }
     $xml .= '</package>';
     return $xml;
 }
开发者ID:netconstructor,项目名称:sugarcrm_dev,代码行数:23,代码来源:PackageManager.php


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