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


PHP PEAR_Dependency2::validatePackageDependency方法代码示例

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


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

示例1: validatePackageDependency

 public function validatePackageDependency($dep, $required, $params, $depv1 = false)
 {
     if ('symfony' === strtolower($dep['name'])) {
         return true;
     }
     if ('openpne' === strtolower($dep['name'])) {
         $extra = $this->_getExtraString($dep);
         if (isset($dep['min']) && !version_compare(OPENPNE_VERSION, $dep['min'], '>=')) {
             return $this->handleOpenPNEDependencyError('%s requires OpenPNE' . $extra . ', installed version is ' . OPENPNE_VERSION);
         }
         if (isset($dep['max']) && !version_compare(OPENPNE_VERSION, $dep['max'], '<=')) {
             return $this->handleOpenPNEDependencyError('%s requires OpenPNE' . $extra . ', installed version is ' . OPENPNE_VERSION);
         }
         if (isset($dep['exclude'])) {
             foreach ((array) $dep['exclude'] as $exclude) {
                 if (version_compare(OPENPNE_VERSION, $exclude, '==')) {
                     return $this->handleOpenPNEDependencyError('%s is not compatible with OpenPNE version ' . $exclude);
                 }
             }
         }
         return true;
     }
     $result = parent::validatePackageDependency($dep, $required, $params, $depv1);
     if (PEAR::isError($result)) {
         $dep['package'] = $dep['name'];
         $this->failedDependency['package'][] = $dep;
     }
     return $result;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:29,代码来源:opPluginDependency.class.php

示例2: checkDependency

 /**
  * Checks that the dependency is valid.
  *
  * @param  array   $dependency A dependency array
  *
  * @return Boolean true if the dependency is valid, false otherwise
  */
 protected function checkDependency($dependency)
 {
     $dependencyChecker = new PEAR_Dependency2($this->environment->getConfig(), array(), array('package' => '', 'channel' => ''));
     PEAR::staticPushErrorHandling(PEAR_ERROR_RETURN);
     $e = $dependencyChecker->validatePackageDependency($dependency, true, array());
     PEAR::staticPopErrorHandling();
     if (PEAR::isError($e)) {
         return false;
     }
     return true;
 }
开发者ID:JimmyVB,项目名称:Symfony-v1.2,代码行数:18,代码来源:sfPluginManager.class.php


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