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


PHP PEAR_PackageFile_v2::getDeps方法代码示例

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


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

示例1: packageInfo

 function packageInfo($base, $package)
 {
     PEAR::pushErrorHandling(PEAR_ERROR_RETURN);
     $pinfo = $this->_rest->retrieveData($base . 'p/' . strtolower($package) . '/info.xml');
     if (PEAR::isError($pinfo)) {
         PEAR::popErrorHandling();
         return PEAR::raiseError('Unknown package: "' . $package . '" (Debug: ' . $pinfo->getMessage() . ')');
     }
     $releases = array();
     $allreleases = $this->_rest->retrieveData($base . 'r/' . strtolower($package) . '/allreleases.xml');
     if (!PEAR::isError($allreleases)) {
         if (!class_exists('PEAR_PackageFile_v2')) {
             require_once 'PEAR/PackageFile/v2.php';
         }
         if (!is_array($allreleases['r']) || !isset($allreleases['r'][0])) {
             $allreleases['r'] = array($allreleases['r']);
         }
         $pf = new PEAR_PackageFile_v2();
         foreach ($allreleases['r'] as $release) {
             $ds = $this->_rest->retrieveCacheFirst($base . 'r/' . strtolower($package) . '/deps.' . $release['v'] . '.txt');
             if (PEAR::isError($ds)) {
                 continue;
             }
             if (!isset($latest)) {
                 $latest = $release['v'];
             }
             $pf->setDeps(unserialize($ds));
             $ds = $pf->getDeps();
             $info = $this->_rest->retrieveCacheFirst($base . 'r/' . strtolower($package) . '/' . $release['v'] . '.xml');
             if (PEAR::isError($info)) {
                 continue;
             }
             $releases[$release['v']] = array('doneby' => $info['m'], 'license' => $info['l'], 'summary' => $info['s'], 'description' => $info['d'], 'releasedate' => $info['da'], 'releasenotes' => $info['n'], 'state' => $release['s'], 'deps' => $ds ? $ds : array());
         }
     } else {
         $latest = '';
     }
     PEAR::popErrorHandling();
     if (isset($pinfo['dc']) && isset($pinfo['dp'])) {
         if (is_array($pinfo['dp'])) {
             $deprecated = array('channel' => (string) $pinfo['dc'], 'package' => trim($pinfo['dp']['_content']));
         } else {
             $deprecated = array('channel' => (string) $pinfo['dc'], 'package' => trim($pinfo['dp']));
         }
     } else {
         $deprecated = false;
     }
     return array('name' => $pinfo['n'], 'channel' => $pinfo['c'], 'category' => $pinfo['ca']['_content'], 'stable' => $latest, 'license' => $pinfo['l'], 'summary' => $pinfo['s'], 'description' => $pinfo['d'], 'releases' => $releases, 'deprecated' => $deprecated);
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:49,代码来源:10.php

示例2: listAll


//.........这里部分代码省略.........
             unset($state);
             if ($releases) {
                 if (!isset($releases['r'][0])) {
                     $releases['r'] = array($releases['r']);
                 }
                 foreach ($releases['r'] as $release) {
                     if (!isset($latest)) {
                         if ($dostable && $release['s'] == 'stable') {
                             $latest = $release['v'];
                             $state = 'stable';
                         }
                         if (!$dostable) {
                             $latest = $release['v'];
                             $state = $release['s'];
                         }
                     }
                     if (!isset($stable) && $release['s'] == 'stable') {
                         $stable = $release['v'];
                         if (!isset($unstable)) {
                             $unstable = $stable;
                         }
                     }
                     if (!isset($unstable) && $release['s'] != 'stable') {
                         $unstable = $release['v'];
                         $state = $release['s'];
                     }
                     if (isset($latest) && !isset($state)) {
                         $state = $release['s'];
                     }
                     if (isset($latest) && isset($stable) && isset($unstable)) {
                         break;
                     }
                 }
             }
             if ($basic) {
                 // remote-list command
                 if (!isset($latest)) {
                     $latest = false;
                 }
                 if ($dostable) {
                     // $state is not set if there are no releases
                     if (isset($state) && $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)) {
                 $unstable = false;
                 $state = 'stable';
                 if (isset($stable)) {
                     $latest = $unstable = $stable;
                 }
             } else {
                 $latest = $unstable;
             }
             if (!isset($latest)) {
                 $latest = false;
             }
             if ($latest && isset($packageinfo['deps'])) {
                 if (!is_array($packageinfo['deps']) || !isset($packageinfo['deps'][0])) {
                     $packageinfo['deps'] = array($packageinfo['deps']);
                 }
                 $d = false;
                 foreach ($packageinfo['deps'] as $dep) {
                     if ($dep['v'] == $latest) {
                         $d = unserialize($dep['d']);
                     }
                 }
                 if ($d) {
                     if (isset($d['required'])) {
                         if (!isset($pf)) {
                             $pf = new PEAR_PackageFile_v2();
                         }
                         $pf->setDeps($d);
                         $tdeps = $pf->getDeps();
                     } else {
                         $tdeps = $d;
                     }
                     foreach ($tdeps as $dep) {
                         if ($dep['type'] !== 'pkg') {
                             continue;
                         }
                         $deps[] = $dep;
                     }
                 }
             }
             $info = array('stable' => $latest, 'summary' => $info['s'], 'description' => $info['d'], 'deps' => $deps, 'category' => $info['ca']['_content'], 'unstable' => $unstable, 'state' => $state);
             $ret[$package] = $info;
         }
     }
     PEAR::popErrorHandling();
     return $ret;
 }
开发者ID:rjsmelo,项目名称:tiki,代码行数:101,代码来源:11.php

示例3: array


//.........这里部分代码省略.........
                 return $inf;
             }
             if ($searchpackage) {
                 $found = !empty($searchpackage) && stristr($package, $searchpackage) !== false;
                 if (!$found && !(isset($searchsummary) && !empty($searchsummary) && (stristr($inf['s'], $searchsummary) !== false || stristr($inf['d'], $searchsummary) !== false))) {
                     continue;
                 }
             }
             $releases = $rest->_rest->retrieveData($base . 'r/' . strtolower($package) . '/allreleases.xml');
             if (PEAR::isError($releases)) {
                 continue;
             }
             if (!isset($releases['r'][0])) {
                 $releases['r'] = array($releases['r']);
             }
             unset($latest);
             unset($unstable);
             unset($stable);
             unset($state);
             foreach ($releases['r'] as $release) {
                 if (!isset($latest)) {
                     if ($dostable && $release['s'] == 'stable') {
                         $latest = $release['v'];
                         $state = 'stable';
                     }
                     if (!$dostable) {
                         $latest = $release['v'];
                         $state = $release['s'];
                     }
                 }
                 if (!isset($stable) && $release['s'] == 'stable') {
                     $stable = $release['v'];
                     if (!isset($unstable)) {
                         $unstable = $stable;
                     }
                 }
                 if (!isset($unstable) && $release['s'] != 'stable') {
                     $latest = $unstable = $release['v'];
                     $state = $release['s'];
                 }
                 if (isset($latest) && !isset($state)) {
                     $state = $release['s'];
                 }
                 if (isset($latest) && isset($stable) && isset($unstable)) {
                     break;
                 }
             }
             $deps = array();
             if (!isset($unstable)) {
                 $unstable = false;
                 $state = 'stable';
                 if (isset($stable)) {
                     $latest = $unstable = $stable;
                 }
             } else {
                 $latest = $unstable;
             }
             if (!isset($latest)) {
                 $latest = false;
             }
             if ($latest) {
                 $d = $rest->_rest->retrieveCacheFirst($base . 'r/' . strtolower($package) . '/deps.' . $latest . '.txt');
                 if (!PEAR::isError($d)) {
                     $d = unserialize($d);
                     if ($d) {
                         if (isset($d['required'])) {
                             if (!class_exists('PEAR_PackageFile_v2')) {
                                 require_once 'PEAR/PackageFile/v2.php';
                             }
                             if (!isset($pf)) {
                                 $pf = new PEAR_PackageFile_v2();
                             }
                             $pf->setDeps($d);
                             $tdeps = $pf->getDeps();
                         } else {
                             $tdeps = $d;
                         }
                         foreach ($tdeps as $dep) {
                             if ($dep['type'] !== 'pkg') {
                                 continue;
                             }
                             $deps[] = $dep;
                         }
                     }
                 }
             }
             if (!isset($stable)) {
                 $stable = '-n/a-';
             }
             if (!$searchpackage) {
                 $info = array('stable' => $latest, 'summary' => $inf['s'], 'description' => $inf['d'], 'deps' => $deps, 'category' => $inf['ca']['_content'], 'unstable' => $unstable, 'state' => $state);
             } else {
                 $info = array('stable' => $stable, 'summary' => $inf['s'], 'description' => $inf['d'], 'deps' => $deps, 'category' => $inf['ca']['_content'], 'unstable' => $unstable, 'state' => $state);
             }
         }
         $ret[$package] = $info;
     }
     PEAR::popErrorHandling();
     return $ret;
 }
开发者ID:BGCX261,项目名称:zigolive-svn-to-git,代码行数:101,代码来源:Web_Command_Forward_Compatible.php


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