本文整理汇总了PHP中SugarConfig类的典型用法代码示例。如果您正苦于以下问题:PHP SugarConfig类的具体用法?PHP SugarConfig怎么用?PHP SugarConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SugarConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$config = SugarConfig::getInstance();
foreach ($this->upgradeLabels as $module => $labels) {
$changedLanguages = array();
// Let's fix labels for all languages
foreach ($config->get('languages') as $key => $value) {
if ($this->upgradeModuleLabels($module, $key)) {
$changedLanguages[$key] = $key;
}
}
// Rebuild changed languages for module
if (!empty($changedLanguages)) {
$this->rebuildLanguages($changedLanguages, $module);
}
$changedSubpanels = array();
// Fix subpanels
if ($this->upgradeSubpanelModuleLabels($module)) {
$changedSubpanels[$key] = $key;
}
$changedListViews = array();
// Fix list views
if ($this->upgradeListViewModuleLabels($module)) {
$changedListViews[$key] = $key;
}
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:27,代码来源:7_FixCustomLabelsForCoreModules.php
示例2: __construct
private function __construct()
{
$level = SugarConfig::getInstance()->get('logger.level', $this->level);
if (!empty($level)) {
$this->setLevel($level);
}
}
开发者ID:klr2003,项目名称:sourceread,代码行数:7,代码来源:LoggerManager.php
示例3: handleOverride
function handleOverride()
{
global $sugar_config, $sugar_version;
$sc = SugarConfig::getInstance();
$overrideArray = $this->readOverride();
$this->previous_sugar_override_config_array = $overrideArray;
$diffArray = deepArrayDiff($this->config, $sugar_config);
$overrideArray = sugarArrayMerge($overrideArray, $diffArray);
$overideString = "<?php\n/***CONFIGURATOR***/\n";
sugar_cache_put('sugar_config', $this->config);
$GLOBALS['sugar_config'] = $this->config;
foreach ($overrideArray as $key => $val) {
if (in_array($key, $this->allow_undefined) || isset($sugar_config[$key])) {
if (strcmp("{$val}", 'true') == 0) {
$val = true;
$this->config[$key] = $val;
}
if (strcmp("{$val}", 'false') == 0) {
$val = false;
$this->config[$key] = false;
}
}
$overideString .= override_value_to_string_recursive2('sugar_config', $key, $val);
}
$overideString .= '/***CONFIGURATOR***/';
$this->saveOverride($overideString);
if (isset($this->config['logger']['level']) && $this->logger) {
$this->logger->setLevel($this->config['logger']['level']);
}
}
开发者ID:nerdystudmuffin,项目名称:dashlet-subpanels,代码行数:30,代码来源:Configurator.php
示例4: display
/**
* @see SugarView::display()
*/
public function display()
{
global $current_user, $mod_strings, $app_strings, $app_list_strings, $sugar_config, $locale;
$configurator = new Configurator();
$sugarConfig = SugarConfig::getInstance();
$focus = new Administration();
$configurator->parseLoggerSettings();
$focus->retrieveSettings();
if (!empty($_POST['restore'])) {
$configurator->restoreConfig();
}
$this->ss->assign('MOD', $mod_strings);
$this->ss->assign('APP', $app_strings);
$this->ss->assign('APP_LIST', $app_list_strings);
$this->ss->assign('config', $configurator->config);
$this->ss->assign('error', $configurator->errors);
$this->ss->assign("AUTO_REFRESH_INTERVAL_OPTIONS", get_select_options_with_id($app_list_strings['dashlet_auto_refresh_options_admin'], isset($configurator->config['dashlet_auto_refresh_min']) ? $configurator->config['dashlet_auto_refresh_min'] : 30));
$this->ss->assign('LANGUAGES', get_languages());
$this->ss->assign("JAVASCRIPT", get_set_focus_js() . get_configsettings_js());
$this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
$this->ss->assign("settings", $focus->settings);
$this->ss->assign("mail_sendtype_options", get_select_options_with_id($app_list_strings['notifymail_sendtype'], $focus->settings['mail_sendtype']));
if (!empty($focus->settings['proxy_on'])) {
$this->ss->assign("PROXY_CONFIG_DISPLAY", 'inline');
} else {
$this->ss->assign("PROXY_CONFIG_DISPLAY", 'none');
}
if (!empty($focus->settings['proxy_auth'])) {
$this->ss->assign("PROXY_AUTH_DISPLAY", 'inline');
} else {
$this->ss->assign("PROXY_AUTH_DISPLAY", 'none');
}
if (!empty($configurator->config['logger']['level'])) {
$this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), $configurator->config['logger']['level']));
} else {
$this->ss->assign('log_levels', get_select_options_with_id(LoggerManager::getLoggerLevels(), ''));
}
if (!empty($configurator->config['lead_conv_activity_opt'])) {
$this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), $configurator->config['lead_conv_activity_opt']));
} else {
$this->ss->assign('lead_conv_activities', get_select_options_with_id(Lead::getActivitiesOptions(), ''));
}
if (!empty($configurator->config['logger']['file']['suffix'])) {
$this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, $configurator->config['logger']['file']['suffix']));
} else {
$this->ss->assign('filename_suffix', get_select_options_with_id(SugarLogger::$filename_suffix, ''));
}
echo $this->getModuleTitle(false);
$this->ss->display('modules/Configurator/tpls/EditView.tpl');
$javascript = new javascript();
$javascript->setFormName("ConfigureSettings");
$javascript->addFieldGeneric("notify_fromaddress", "email", $mod_strings['LBL_NOTIFY_FROMADDRESS'], TRUE, "");
$javascript->addFieldGeneric("notify_subject", "varchar", $mod_strings['LBL_NOTIFY_SUBJECT'], TRUE, "");
$javascript->addFieldGeneric("proxy_host", "varchar", $mod_strings['LBL_PROXY_HOST'], TRUE, "");
$javascript->addFieldGeneric("proxy_port", "int", $mod_strings['LBL_PROXY_PORT'], TRUE, "");
$javascript->addFieldGeneric("proxy_password", "varchar", $mod_strings['LBL_PROXY_PASSWORD'], TRUE, "");
$javascript->addFieldGeneric("proxy_username", "varchar", $mod_strings['LBL_PROXY_USERNAME'], TRUE, "");
echo $javascript->getScript();
}
开发者ID:omusico,项目名称:sugar_work,代码行数:62,代码来源:view.edit.php
示例5: tearDown
public function tearDown()
{
if (file_exists($this->_filename)) {
unlink($this->_filename);
}
$GLOBALS['sugar_config']['default_permissions'] = $this->_old_default_permissions;
SugarConfig::getInstance()->clearCache();
}
开发者ID:thsonvt,项目名称:sugarcrm_dev,代码行数:8,代码来源:SugarFileUtilsTest.php
示例6: __construct
/**
* Ctor
* @param string $version
*/
public function __construct($version, LoggerTransition $logger = null)
{
$this->localInstall = $version != "GLOBAL" && $version != "PROJECT";
if ($this->localInstall) {
$this->logger = new LoggerTransition(\LoggerManager::getLogger());
$this->config = \SugarConfig::getInstance();
}
parent::__construct('sugar-cli', $version);
}
开发者ID:mmarum-sugarcrm,项目名称:cli-tools,代码行数:13,代码来源:SugarCliApplication.php
示例7: logDebug
public function logDebug($message)
{
$defaultLogLevel = 'fatal';
$config = SugarConfig::getInstance();
$level = $config->get('logger.level', $defaultLogLevel);
if ($level == 'debug') {
$this->log($message);
}
}
开发者ID:dinhquyet92,项目名称:sugarcrm_advanced_workflows,代码行数:9,代码来源:GcoopLogger.php
示例8: __construct
private function __construct()
{
$level = SugarConfig::getInstance()->get('logger.level', $this->_level);
if (!empty($level)) {
$this->setLevel($level);
}
if (empty(self::$_loggers)) {
$this->_findAvailableLoggers();
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:10,代码来源:LoggerManager.php
示例9: display
/**
* @see SugarView::display()
*/
public function display()
{
global $current_user, $mod_strings, $app_list_strings, $sugar_config, $locale, $sugar_version;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$themeObject = SugarThemeRegistry::current();
$configurator = new Configurator();
$sugarConfig = SugarConfig::getInstance();
$focus = new Administration();
$focus->retrieveSettings();
$ut = $GLOBALS['current_user']->getPreference('ut');
if (empty($ut)) {
$this->ss->assign('SKIP_URL', 'index.php?module=Users&action=Wizard&skipwelcome=1');
} else {
$this->ss->assign('SKIP_URL', 'index.php?module=Home&action=index');
}
// Always mark that we have got past this point
$focus->saveSetting('system', 'adminwizard', 1);
$css = $themeObject->getCSS();
$favicon = $themeObject->getImageURL('sugar_icon.ico', false);
$this->ss->assign('FAVICON_URL', getJSPath($favicon));
$this->ss->assign('SUGAR_CSS', $css);
$this->ss->assign('MOD_USERS', return_module_language($GLOBALS['current_language'], 'Users'));
$this->ss->assign('CSS', '<link rel="stylesheet" type="text/css" href="' . SugarThemeRegistry::current()->getCSSURL('wizard.css') . '" />');
$this->ss->assign('LANGUAGES', get_languages());
$this->ss->assign('config', $sugar_config);
$this->ss->assign('SUGAR_VERSION', $sugar_version);
$this->ss->assign('settings', $focus->settings);
$this->ss->assign('exportCharsets', get_select_options_with_id($locale->getCharsetSelect(), $sugar_config['default_export_charset']));
$this->ss->assign('getNameJs', $locale->getNameJs());
$this->ss->assign('NAMEFORMATS', $locale->getUsableLocaleNameOptions($sugar_config['name_formats']));
$this->ss->assign('JAVASCRIPT', get_set_focus_js() . get_configsettings_js());
$this->ss->assign('company_logo', SugarThemeRegistry::current()->getImageURL('company_logo.png'));
$this->ss->assign('mail_smtptype', $focus->settings['mail_smtptype']);
$this->ss->assign('mail_smtpserver', $focus->settings['mail_smtpserver']);
$this->ss->assign('mail_smtpport', $focus->settings['mail_smtpport']);
$this->ss->assign('mail_smtpuser', $focus->settings['mail_smtpuser']);
$this->ss->assign('mail_smtppass', $focus->settings['mail_smtppass']);
$this->ss->assign('mail_smtpauth_req', $focus->settings['mail_smtpauth_req'] ? "checked='checked'" : '');
$this->ss->assign('MAIL_SSL_OPTIONS', get_select_options_with_id($app_list_strings['email_settings_for_ssl'], $focus->settings['mail_smtpssl']));
$this->ss->assign('notify_allow_default_outbound_on', !empty($focus->settings['notify_allow_default_outbound']) && $focus->settings['notify_allow_default_outbound'] == 2 ? 'CHECKED' : '');
$this->ss->assign('THEME', SugarThemeRegistry::current()->__toString());
// get javascript
ob_start();
$this->options['show_javascript'] = true;
$this->renderJavascript();
$this->options['show_javascript'] = false;
$this->ss->assign("SUGAR_JS", ob_get_contents() . $themeObject->getJS());
ob_end_clean();
$this->ss->assign('langHeader', get_language_header());
$this->ss->assign('START_PAGE', !empty($_REQUEST['page']) ? $_REQUEST['page'] : 'welcome');
$this->ss->display('modules/Configurator/tpls/adminwizard.tpl');
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:57,代码来源:view.adminwizard.php
示例10: __construct
function __construct()
{
$config = SugarConfig::getInstance();
$this->ext = $config->get('logger.file.ext', $this->ext);
$this->logfile = $config->get('logger.file.name', $this->logfile);
$this->dateFormat = $config->get('logger.file.dateFormat', $this->dateFormat);
$this->logSize = $config->get('logger.file.maxSize', $this->logSize);
$this->maxLogs = $config->get('logger.file.maxLogs', $this->maxLogs);
$this->filesuffix = $config->get('logger.file.suffix', $this->filesuffix);
unset($config);
$this->doInitialization();
}
开发者ID:klr2003,项目名称:sourceread,代码行数:12,代码来源:SugarLogger.php
示例11: _getMemcachedObject
/**
* Get the memcached object; initialize if needed
*/
protected function _getMemcachedObject()
{
if (!$this->_memcached instanceof Memcached) {
$this->_memcached = new Memcached();
$this->_host = SugarConfig::getInstance()->get('external_cache.memcache.host', $this->_host);
$this->_port = SugarConfig::getInstance()->get('external_cache.memcache.port', $this->_port);
if (!@$this->_memcached->addServer($this->_host, $this->_port)) {
return false;
}
}
return $this->_memcached;
}
开发者ID:MexinaD,项目名称:SuiteCRM,代码行数:15,代码来源:SugarCacheMemcached.php
示例12: __construct
public function __construct()
{
$config = SugarConfig::getInstance();
$this->ext = '.log';
$this->logfile = 'PMSE';
$this->dateFormat = $config->get('logger.file.dateFormat', $this->dateFormat);
$this->logSize = $config->get('logger.file.maxSize', $this->logSize);
$this->maxLogs = $config->get('logger.file.maxLogs', $this->maxLogs);
$this->filesuffix = $config->get('logger.file.suffix', $this->filesuffix);
$log_dir = $config->get('log_dir', $this->log_dir);
$this->log_dir = $log_dir . (empty($log_dir) ? '' : '/');
unset($config);
$this->_doInitialization();
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:14,代码来源:PMSELoggerWriter.php
示例13: testAssertLogging
public function testAssertLogging()
{
$GLOBALS['log']->setLevel('debug');
$GLOBALS['log']->assert('this was asserted true', true);
$GLOBALS['log']->assert('this was asserted false', false);
$config = SugarConfig::getInstance();
$ext = $config->get('logger.file.ext');
$logfile = $config->get('logger.file.name');
$log_dir = $config->get('log_dir');
$log_dir = $log_dir . (empty($log_dir) ? '' : '/');
$logFile = file_get_contents($log_dir . $logfile . $ext);
$this->assertContains('[DEBUG] this was asserted false', $logFile);
$this->assertNotContains('[DEBUG] this was asserted true', $logFile);
}
开发者ID:nickpro,项目名称:sugarcrm_dev,代码行数:14,代码来源:SugarLoggerTest.php
示例14: __construct
/**
* @param SugarSearchEngineAqbstractBase $engine
*/
public function __construct(SugarSearchEngineAbstractBase $engine = null)
{
if ($engine != null) {
$this->SSEngine = $engine;
} else {
$this->SSEngine = SugarSearchEngineFactory::getInstance();
}
$this->db = DBManagerFactory::getInstance('fts');
$this->table_name = self::QUEUE_TABLE;
$config = SugarConfig::getInstance();
$this->max_bulk_threshold = $config->get('search_engine.max_bulk_threshold', $this->max_bulk_threshold);
$this->max_bulk_query_threshold = $config->get('search_engine.max_bulk_query_threshold', $this->max_bulk_query_threshold);
$this->max_bulk_delete_threshold = $config->get('search_engine.max_bulk_delete_threshold', $this->max_bulk_delete_threshold);
$this->postpone_job_time = $config->get('search_engine.postpone_job_time', $this->postpone_job_time);
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:18,代码来源:SugarSearchEngineIndexerBase.php
示例15: __construct
/**
* Constructor
*
* Reads the config file for logger settings
*/
public function __construct()
{
$config = SugarConfig::getInstance();
$this->ext = $config->get('logger.file.ext', $this->ext);
$this->logfile = $config->get('logger.file.name', $this->logfile);
$this->dateFormat = $config->get('logger.file.dateFormat', $this->dateFormat);
$this->logSize = $config->get('logger.file.maxSize', $this->logSize);
$this->maxLogs = $config->get('logger.file.maxLogs', $this->maxLogs);
$this->filesuffix = $config->get('logger.file.suffix', $this->filesuffix);
$log_dir = $config->get('log_dir', $this->log_dir);
$this->log_dir = $log_dir . (empty($log_dir) ? '' : '/');
unset($config);
$this->_doInitialization();
LoggerManager::setLogger('default', 'SugarLogger');
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:20,代码来源:SugarLogger.php
示例16: _getRedisObject
/**
* Get the memcache object; initialize if needed
*/
protected function _getRedisObject()
{
try {
if (!$this->_redis instanceof Redis) {
$this->_redis = new Redis();
$this->_host = SugarConfig::getInstance()->get('external_cache.redis.host', $this->_host);
$this->_port = SugarConfig::getInstance()->get('external_cache.redis.port', $this->_port);
if (!$this->_redis->connect($this->_host, $this->_port)) {
return false;
}
}
} catch (RedisException $e) {
return false;
}
return $this->_redis;
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:19,代码来源:SugarCacheRedis.php
示例17: display
function display()
{
$smarty = new Sugar_Smarty();
parent::display();
$db = DBManagerFactory::getInstance();
//$myquery = 'SELECT tab4.first_name fname, tab4.last_name lname, tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink FROM reg_patient_reg_encounter_c tab1 WHERE tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE enc1.reg_patient_reg_encounterreg_patient_ida = patid) ) enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) refill, ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) uts , (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) next_pcp, (SELECT p1b.name provname from reg_provider p1b, reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) risk FROM reg_patient tab4, reg_patient_cstm tab5, reg_patient_reg_encounter_c tab1, ( SELECT max( date_modified ) dat, reg_patient_reg_encounterreg_patient_ida pat FROM reg_patient_reg_encounter_c GROUP BY reg_patient_reg_encounterreg_patient_ida) tab2, reg_encounter_cstm tab3 WHERE tab5.id_c = tab4.id AND tab1.date_modified = tab2.dat AND tab1.reg_patient_reg_encounterreg_patient_ida = tab2.pat AND tab3.id_c = tab1.reg_patient_reg_encounterreg_encounter_idb AND tab4.id = tab2.pat';
$myquery = 'SELECT tab4.first_name fname, tab4.last_name lname, tab5.mrn_c mrn, tab4.id patid, tab5.location_c location, tab5.active_c active, ( SELECT tab1.reg_patient_reg_encounterreg_encounter_idb enclink FROM reg_patient_reg_encounter_c tab1 WHERE tab1.reg_patient_reg_encounterreg_patient_ida = patid AND tab1.date_modified = (SELECT max( date_modified ) dat FROM reg_patient_reg_encounter_c enc1 WHERE enc1.reg_patient_reg_encounterreg_patient_ida = patid) ) enclink, ( SELECT DATE_FORMAT(tab3.next_rx_refill_due_c,"%m/%d/%Y") ref1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) refill, ( SELECT DATE_FORMAT(tab3.last_uts_c,"%m/%d/%Y") uts1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) last_uts , ( SELECT DATE_FORMAT(tab3.next_uts_due_c,"%m/%d/%Y") uts11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) uts , (SELECT DATE_FORMAT(tab3.next_pcp_visit_c,"%m/%d/%Y") pcp11 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) next_pcp, (SELECT p1b.name provname from reg_provider p1b, reg_provider_reg_patient_c p2b WHERE p2b.reg_provider_reg_patientreg_provider_ida = p1b.id AND p2b.reg_provider_reg_patientreg_patient_idb = patid) provname, ( SELECT risklvl_c risk1 FROM reg_encounter_cstm tab3 where tab3.id_c = enclink ) risk FROM reg_patient tab4, reg_patient_cstm tab5 WHERE tab5.id_c = tab4.id ';
$result = $db->query($myquery);
$mydata = null;
while ($row = $db->fetchRow($result)) {
$mydata[] = $row;
}
global $cal_strings, $current_language;
$cal_strings = return_module_language($current_language, 'Calendar');
if (empty($_REQUEST['view'])) {
$_REQUEST['view'] = SugarConfig::getInstance()->get('calendar.default_view', 'week');
}
$cal = new Calendar($_REQUEST['view']);
if (in_array($cal->view, array('day', 'week', 'month'))) {
$cal->add_activities($GLOBALS['current_user']);
} else {
if ($cal->view == 'shared') {
$cal->init_shared();
global $shared_user;
$shared_user = new User();
foreach ($cal->shared_ids as $member) {
$shared_user->retrieve($member);
$cal->add_activities($shared_user);
}
}
}
if (in_array($cal->view, array("day", "week", "month", "shared"))) {
$cal->load_activities();
}
if (!empty($_REQUEST['print']) && $_REQUEST['print'] == 'true') {
$cal->setPrint(true);
}
$display = new CalendarDisplay($cal);
$smarty->assign("mydata", $mydata);
echo "<table><tr><td>";
$smarty->display($this->lv->tpl);
echo "</td>";
echo "<td style='width:100%;vertical-align:top'>";
$caltest = new caltest();
$caltest->test();
echo "</td></tr></table>";
}
开发者ID:apikck,项目名称:REG_Patient,代码行数:47,代码来源:view.toplist.php
示例18: getInstance
/**
* getInstance()
*
* Create or fetch index strategy
*
* @static
* @param string $name
* @param array $config
* @return ElasticIndexStrategyInterface
*/
public static function getInstance($strategy = '', $config = null)
{
$sugarConfig = SugarConfig::getInstance();
// get strategy name from $sugar_config, default to "single"
if (empty($strategy)) {
$strategy = $sugarConfig->get('full_text_engine.Elastic.index_strategy.name', 'single');
}
if (!empty(self::$instance[$strategy])) {
return self::$instance[$strategy];
}
// use strategy config from $sugar_config if not set explicitly
if (!is_array($config)) {
$config = $sugarConfig->get('full_text_engine.Elastic.index_strategy.config', array());
}
// setup instance
self::$instance[$strategy] = self::setupStrategy($strategy, $config);
return self::$instance[$strategy];
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:28,代码来源:SugarSearchEngineElasticIndexStrategyFactory.php
示例19: _getMemcacheObject
/**
* Get the memcache object; initialize if needed
*/
protected function _getMemcacheObject()
{
if (!$this->_memcache instanceof Memcache) {
$this->_memcache = new Memcache();
$config = SugarConfig::getInstance();
$this->_host = $config->get('external_cache.memcache.host', $this->_host);
$this->_port = $config->get('external_cache.memcache.port', $this->_port);
if (!@$this->_memcache->connect($this->_host, $this->_port)) {
return false;
}
if ($config->get('external_cache.memcache.disable_compression', false)) {
$this->_memcache->setCompressThreshold($config->get('external_cache.memcache.min_compression', $this->min_compress));
} else {
$this->_memcache->setCompressThreshold(0);
}
}
return $this->_memcache;
}
开发者ID:delkyd,项目名称:sugarcrm_dev,代码行数:21,代码来源:SugarCacheMemcache.php
示例20: handleOverride
function handleOverride($fromParseLoggerSettings = false)
{
global $sugar_config, $sugar_version;
$sc = SugarConfig::getInstance();
$overrideArray = $this->readOverride();
$this->previous_sugar_override_config_array = $overrideArray;
$diffArray = deepArrayDiff($this->config, $sugar_config);
$overrideArray = sugarArrayMergeRecursive($overrideArray, $diffArray);
// To remember checkbox state
if (!$this->useAuthenticationClass && !$fromParseLoggerSettings) {
if (isset($overrideArray['authenticationClass']) && $overrideArray['authenticationClass'] == 'SAMLAuthenticate') {
unset($overrideArray['authenticationClass']);
}
}
$overideString = "<?php\n/***CONFIGURATOR***/\n";
sugar_cache_put('sugar_config', $this->config);
$GLOBALS['sugar_config'] = $this->config;
//print_r($overrideArray);
//Bug#53013: Clean the tpl cache if action menu style has been changed.
if (isset($overrideArray['enable_action_menu']) && (!isset($this->previous_sugar_override_config_array['enable_action_menu']) || $overrideArray['enable_action_menu'] != $this->previous_sugar_override_config_array['enable_action_menu'])) {
require_once 'modules/Administration/QuickRepairAndRebuild.php';
$repair = new RepairAndClear();
$repair->module_list = array();
$repair->clearTpls();
}
foreach ($overrideArray as $key => $val) {
if (in_array($key, $this->allow_undefined) || isset($sugar_config[$key])) {
if (strcmp("{$val}", 'true') == 0) {
$val = true;
$this->config[$key] = $val;
}
if (strcmp("{$val}", 'false') == 0) {
$val = false;
$this->config[$key] = false;
}
}
$overideString .= override_value_to_string_recursive2('sugar_config', $key, $val);
}
$overideString .= '/***CONFIGURATOR***/';
$this->saveOverride($overideString);
if (isset($this->config['logger']['level']) && $this->logger) {
$this->logger->setLevel($this->config['logger']['level']);
}
}
开发者ID:nicolasbui,项目名称:sugarcrm_dev,代码行数:44,代码来源:Configurator.php
注:本文中的SugarConfig类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论