本文整理汇总了PHP中CRM_Core_BAO_ConfigSetting::applyLocale方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_ConfigSetting::applyLocale方法的具体用法?PHP CRM_Core_BAO_ConfigSetting::applyLocale怎么用?PHP CRM_Core_BAO_ConfigSetting::applyLocale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_ConfigSetting
的用法示例。
在下文中一共展示了CRM_Core_BAO_ConfigSetting::applyLocale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: error_reporting
/**
* Singleton function used to manage this object.
*
* @param bool $loadFromDB
* whether to load from the database.
* @param bool $force
* whether to force a reconstruction.
*
* @return CRM_Core_Config
*/
public static function &singleton($loadFromDB = TRUE, $force = FALSE)
{
if (self::$_singleton === NULL || $force) {
$GLOBALS['civicrm_default_error_scope'] = CRM_Core_TemporaryErrorScope::create(array('CRM_Core_Error', 'handle'));
$errorScope = CRM_Core_TemporaryErrorScope::create(array('CRM_Core_Error', 'simpleHandler'));
if (defined('E_DEPRECATED')) {
error_reporting(error_reporting() & ~E_DEPRECATED);
}
self::$_singleton = new CRM_Core_Config();
\Civi\Core\Container::boot($loadFromDB);
if ($loadFromDB && self::$_singleton->dsn) {
$domain = \CRM_Core_BAO_Domain::getDomain();
\CRM_Core_BAO_ConfigSetting::applyLocale(\Civi::settings($domain->id), $domain->locales);
unset($errorScope);
CRM_Utils_Hook::config(self::$_singleton);
self::$_singleton->authenticate();
// Extreme backward compat: $config binds to active domain at moment of setup.
self::$_singleton->getSettings();
Civi::service('settings_manager')->useDefaults();
self::$_singleton->handleFirstRun();
}
}
return self::$_singleton;
}
示例2: retrieve
/**
* Retrieve the settings values from db.
*
* @param $defaults
*
* @return array
*/
public static function retrieve(&$defaults)
{
$domain = new CRM_Core_DAO_Domain();
//we are initializing config, really can't use, CRM-7863
$urlVar = 'q';
if (defined('CIVICRM_UF') && CIVICRM_UF == 'Joomla') {
$urlVar = 'task';
}
if (CRM_Core_Config::isUpgradeMode()) {
$domain->selectAdd('config_backend');
} else {
$domain->selectAdd('config_backend, locales');
}
$domain->id = CRM_Core_Config::domainID();
$domain->find(TRUE);
if ($domain->config_backend) {
$defaults = unserialize($domain->config_backend);
if ($defaults === FALSE || !is_array($defaults)) {
$defaults = array();
return FALSE;
}
$skipVars = self::skipVars();
foreach ($skipVars as $skip) {
if (array_key_exists($skip, $defaults)) {
unset($defaults[$skip]);
}
}
CRM_Core_BAO_ConfigSetting::applyLocale(Civi::settings($domain->id), $domain->locales);
}
}