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


PHP CRM_Core_DAO::getGlobalSetting方法代码示例

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


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

示例1: checkUpgradeableVersion

 /**
  * Determine if $currentVer can be upgraded to $latestVer
  *
  * @param $currentVer
  * @param $latestVer
  *
  * @return mixed, a string error message or boolean 'false' if OK
  */
 public function checkUpgradeableVersion($currentVer, $latestVer)
 {
     $error = FALSE;
     // since version is suppose to be in valid format at this point, especially after conversion ($convertVer),
     // lets do a pattern check -
     if (!CRM_Utils_System::isVersionFormatValid($currentVer)) {
         $error = ts('Database is marked with invalid version format. You may want to investigate this before you proceed further.');
     } elseif (version_compare($currentVer, $latestVer) > 0) {
         // DB version number is higher than codebase being upgraded to. This is unexpected condition-fatal error.
         $error = ts('Your database is marked with an unexpected version number: %1. The automated upgrade to version %2 can not be run - and the %2 codebase may not be compatible with your database state. You will need to determine the correct version corresponding to your current database state. You may want to revert to the codebase you were using prior to beginning this upgrade until you resolve this problem.', array(1 => $currentVer, 2 => $latestVer));
     } elseif (version_compare($currentVer, $latestVer) == 0) {
         $error = ts('Your database has already been upgraded to CiviCRM %1', array(1 => $latestVer));
     } elseif (version_compare($currentVer, self::MINIMUM_UPGRADABLE_VERSION) < 0) {
         $error = ts('CiviCRM versions prior to %1 cannot be upgraded directly to %2. This upgrade will need to be done in stages. First download an intermediate version (the LTS may be a good choice) and upgrade to that before proceeding to this version.', array(1 => self::MINIMUM_UPGRADABLE_VERSION, 2 => $latestVer));
     }
     if (version_compare(phpversion(), self::MINIMUM_PHP_VERSION) < 0) {
         $error = ts('CiviCRM %3 requires PHP version %1 (or newer), but the current system uses %2 ', array(1 => self::MINIMUM_PHP_VERSION, 2 => phpversion(), 3 => $latestVer));
     }
     // check for mysql trigger privileges
     if (!CRM_Core_DAO::checkTriggerViewPermission(FALSE, TRUE)) {
         $error = ts('CiviCRM %1 requires MySQL trigger privileges.', array(1 => $latestVer));
     }
     if (CRM_Core_DAO::getGlobalSetting('thread_stack', 0) < 1024 * self::MINIMUM_THREAD_STACK) {
         $error = ts('CiviCRM %1 requires MySQL thread stack >= %2k', array(1 => $latestVer, 2 => self::MINIMUM_THREAD_STACK));
     }
     return $error;
 }
开发者ID:nganivet,项目名称:civicrm-core,代码行数:35,代码来源:Form.php


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