本文整理匯總了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;
}