當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。