本文整理汇总了PHP中get_sugar_config_defaults函数的典型用法代码示例。如果您正苦于以下问题:PHP get_sugar_config_defaults函数的具体用法?PHP get_sugar_config_defaults怎么用?PHP get_sugar_config_defaults使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_sugar_config_defaults函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
// Fill the missing settings.
$defaultSettings = get_sugar_config_defaults();
foreach ($defaultSettings as $key => $defaultValue) {
if (!array_key_exists($key, $this->upgrader->config)) {
$this->log("Setting {$key} does not exist. Setting the default value.");
$this->upgrader->config[$key] = $defaultValue;
}
}
$this->upgrader->config['sugar_version'] = $this->to_version;
if (!isset($this->upgrader->config['logger'])) {
$this->upgrader->config['logger'] = array('level' => 'fatal', 'file' => array('ext' => '.log', 'name' => 'sugarcrm', 'dateFormat' => '%c', 'maxSize' => '10MB', 'maxLogs' => 10, 'suffix' => ''));
}
if (!isset($this->upgrader->config['lead_conv_activity_opt'])) {
$this->upgrader->config['lead_conv_activity_opt'] = 'copy';
}
// We no longer have multiple themes support.
// We removed the ability for the user to choose his preferred theme.
// In the future, we'll add this feature back, in the new Sidecar Themes
// format.
// Backward compatibilty modules look and feel must be in accordance to
// Sidecar modules, thus there is only one possible theme: `RacerX`
$this->upgrader->config['default_theme'] = 'RacerX';
$this->removeMassActionsDefaultSettings();
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:26,代码来源:3_ConfigSettings.php
示例2: run
public function run()
{
// The only supported upgrade for this is 7.6.0.0RC4 to 7.6.0.0
if (version_compare($this->from_version, '7.6.0.0RC4', '==') && version_compare($this->to_version, '7.6.0.0', '==')) {
// Fill in any missing settings
$defaults = get_sugar_config_defaults();
foreach ($defaults as $key => $default) {
if (!array_key_exists($key, $this->upgrader->config)) {
$this->log("Setting {$key} does not exist. Setting the default value.");
$this->upgrader->config[$key] = $default;
}
}
// Get the known PMSE settings from the database
$current = $this->getCurrentSettings();
// Get the new default values
$pmse = $this->getDefaultSettings();
// If there is no current entry in sugar_config for PMSE settings...
if (!isset($this->upgrader->config['pmse_settings_default'])) {
// ... loop over current settings in the database, replacing default
// settings with custom ones if they exist
foreach ($current as $key => $val) {
$pmse[$key] = $val;
}
$this->upgrader->config['pmse_settings_default'] = $pmse;
}
// delete PMSESettings.php
$this->fileToDelete('modules/pmse_Inbox/engine/PMSESettings.php');
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:29,代码来源:9_FixPMSESettings.php
示例3: rebuildConfigFile
/**
* This function will rebuild the config file
* @param $sugar_config
* @param $sugar_version
* @return bool true if successful
*/
function rebuildConfigFile($sugar_config, $sugar_version)
{
// add defaults to missing values of in-memory sugar_config
$sugar_config = sugarArrayMerge(get_sugar_config_defaults(), $sugar_config);
// need to override version with default no matter what
$sugar_config['sugar_version'] = $sugar_version;
ksort($sugar_config);
if (write_array_to_file("sugar_config", $sugar_config, "config.php")) {
return true;
} else {
return false;
}
}
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:19,代码来源:utils.php
示例4: handleSugarConfig
/**
* takes session vars and creates config.php
* @return array bottle collection of error messages
*/
function handleSugarConfig()
{
global $bottle;
global $cache_dir;
global $mod_strings;
global $setup_db_host_name;
global $setup_db_host_instance;
global $setup_db_port_num;
global $setup_db_sugarsales_user;
global $setup_db_sugarsales_password;
global $setup_db_database_name;
global $setup_site_host_name;
global $setup_site_log_dir;
global $setup_site_log_file;
global $setup_site_session_path;
global $setup_site_guid;
global $setup_site_url;
global $setup_sugar_version;
global $sugar_config;
global $setup_site_log_level;
echo "<b>{$mod_strings['LBL_PERFORM_CONFIG_PHP']} (config.php)</b><br>";
///////////////////////////////////////////////////////////////////////////////
//// $sugar_config SETTINGS
if (is_file('config.php')) {
$is_writable = is_writable('config.php');
// require is needed here (config.php is sometimes require'd from install.php)
require 'config.php';
} else {
$is_writable = is_writable('.');
}
// build default sugar_config and merge with new values
$sugar_config = sugarArrayMerge(get_sugar_config_defaults(), $sugar_config);
// always lock the installer
$sugar_config['installer_locked'] = true;
// we're setting these since the user was given a fair chance to change them
$sugar_config['dbconfig']['db_host_name'] = $setup_db_host_name;
if (!empty($setup_db_host_instance)) {
$sugar_config['dbconfig']['db_host_instance'] = $setup_db_host_instance;
} else {
$sugar_config['dbconfig']['db_host_instance'] = '';
}
if (!isset($_SESSION['setup_db_manager'])) {
$_SESSION['setup_db_manager'] = DBManagerFactory::getManagerByType($_SESSION['setup_db_type']);
}
$sugar_config['dbconfig']['db_user_name'] = $setup_db_sugarsales_user;
$sugar_config['dbconfig']['db_password'] = $setup_db_sugarsales_password;
$sugar_config['dbconfig']['db_name'] = $setup_db_database_name;
$sugar_config['dbconfig']['db_type'] = $_SESSION['setup_db_type'];
$sugar_config['dbconfig']['db_port'] = $setup_db_port_num;
$sugar_config['dbconfig']['db_manager'] = $_SESSION['setup_db_manager'];
if (!empty($_SESSION['setup_db_options'])) {
$sugar_config['dbconfigoption'] = array_merge($sugar_config['dbconfigoption'], $_SESSION['setup_db_options']);
}
$sugar_config['cache_dir'] = $cache_dir;
$sugar_config['default_charset'] = $mod_strings['DEFAULT_CHARSET'];
$sugar_config['default_email_client'] = 'sugar';
$sugar_config['default_email_editor'] = 'html';
$sugar_config['host_name'] = $setup_site_host_name;
$sugar_config['js_custom_version'] = '';
$sugar_config['use_real_names'] = true;
$sugar_config['disable_convert_lead'] = false;
$sugar_config['log_dir'] = $setup_site_log_dir;
$sugar_config['log_file'] = $setup_site_log_file;
//Setup FTS
if (!empty($_SESSION['fts_type'])) {
$sugar_config['full_text_engine'] = array($_SESSION['fts_type'] => array('host' => $_SESSION['fts_host'], 'port' => $_SESSION['fts_port']));
}
// for silent install
if (!empty($_SESSION['setup_fts_type'])) {
$sugar_config['full_text_engine'] = array($_SESSION['setup_fts_type'] => array('host' => $_SESSION['setup_fts_host'], 'port' => $_SESSION['setup_fts_port']));
if (isset($_SESSION['setup_fts_hide_config'])) {
$sugar_config['hide_full_text_engine_config'] = $_SESSION['setup_fts_hide_config'];
}
}
/*nsingh(bug 22402): Consolidate logger settings under $config['logger'] as liked by the new logger! If log4pphp exists,
these settings will be overwritten by those in log4php.properties when the user access admin->system settings.*/
$sugar_config['logger'] = array('level' => $setup_site_log_level, 'file' => array('ext' => '.log', 'name' => 'sugarcrm', 'dateFormat' => '%c', 'maxSize' => '10MB', 'maxLogs' => 10, 'suffix' => ''));
$sugar_config['session_dir'] = $setup_site_session_path;
$sugar_config['site_url'] = $setup_site_url;
$sugar_config['sugar_version'] = $setup_sugar_version;
$sugar_config['tmp_dir'] = $cache_dir . 'xml/';
$sugar_config['upload_dir'] = 'upload/';
// $sugar_config['use_php_code_json'] = returnPhpJsonStatus(); // true on error
if (isset($_SESSION['setup_site_sugarbeet_anonymous_stats'])) {
$sugar_config['sugarbeet'] = $_SESSION['setup_site_sugarbeet_anonymous_stats'];
}
$sugar_config['demoData'] = $_SESSION['demoData'];
if (isset($setup_site_guid)) {
$sugar_config['unique_key'] = $setup_site_guid;
}
if (empty($sugar_config['unique_key'])) {
$sugar_config['unique_key'] = md5(create_guid());
}
// add installed langs to config
// entry in upgrade_history comes AFTER table creation
if (isset($_SESSION['INSTALLED_LANG_PACKS']) && is_array($_SESSION['INSTALLED_LANG_PACKS']) && !empty($_SESSION['INSTALLED_LANG_PACKS'])) {
//.........这里部分代码省略.........
开发者ID:stefano6310,项目名称:SuiteCRM,代码行数:101,代码来源:install_utils.php
示例5: handleSugarConfig
/**
* takes session vars and creates config.php
* @return array bottle collection of error messages
*/
function handleSugarConfig()
{
global $bottle;
global $cache_dir;
global $mod_strings;
global $setup_db_host_name;
global $setup_db_host_instance;
global $setup_db_sugarsales_user;
global $setup_db_sugarsales_password;
global $setup_db_database_name;
global $setup_site_host_name;
global $setup_site_log_dir;
global $setup_site_log_file;
global $setup_site_session_path;
global $setup_site_guid;
global $setup_site_url;
global $setup_sugar_version;
global $sugar_config;
global $setup_site_log_level;
echo "<b>{$mod_strings['LBL_PERFORM_CONFIG_PHP']} (config.php)</b><br>";
///////////////////////////////////////////////////////////////////////////////
//// $sugar_config SETTINGS
if (is_file('config.php')) {
$is_writable = is_writable('config.php');
// require is needed here (config.php is sometimes require'd from install.php)
require 'config.php';
} else {
$is_writable = is_writable('.');
}
// build default sugar_config and merge with new values
$sugar_config = sugarArrayMerge(get_sugar_config_defaults(), $sugar_config);
// always lock the installer
$sugar_config['installer_locked'] = true;
// we're setting these since the user was given a fair chance to change them
$sugar_config['dbconfig']['db_host_name'] = $setup_db_host_name;
$sugar_config['dbconfig']['db_host_instance'] = $setup_db_host_instance;
$sugar_config['dbconfig']['db_user_name'] = $setup_db_sugarsales_user;
$sugar_config['dbconfig']['db_password'] = $setup_db_sugarsales_password;
$sugar_config['dbconfig']['db_name'] = $setup_db_database_name;
$sugar_config['dbconfig']['db_type'] = $_SESSION['setup_db_type'];
if (isset($_SESSION['setup_db_port_num'])) {
$sugar_config['dbconfig']['db_port'] = $_SESSION['setup_db_port_num'];
}
$sugar_config['cache_dir'] = $cache_dir;
$sugar_config['default_charset'] = $mod_strings['DEFAULT_CHARSET'];
$sugar_config['default_email_client'] = 'sugar';
$sugar_config['default_email_editor'] = 'html';
$sugar_config['host_name'] = $setup_site_host_name;
$sugar_config['import_dir'] = $cache_dir . 'import/';
$sugar_config['js_custom_version'] = '';
$sugar_config['log_dir'] = $setup_site_log_dir;
$sugar_config['log_file'] = $setup_site_log_file;
/*nsingh(bug 22402): Consolidate logger settings under $config['logger'] as liked by the new logger! If log4pphp exists,
these settings will be overwritten by those in log4php.properties when the user access admin->system settings.*/
$sugar_config['logger'] = array('level' => $setup_site_log_level, 'file' => array('ext' => '.log', 'name' => 'sugarcrm', 'dateFormat' => '%c', 'maxSize' => '10MB', 'maxLogs' => 10, 'suffix' => '%m_%Y'));
$sugar_config['session_dir'] = $setup_site_session_path;
$sugar_config['site_url'] = $setup_site_url;
$sugar_config['sugar_version'] = $setup_sugar_version;
$sugar_config['tmp_dir'] = $cache_dir . 'xml/';
$sugar_config['upload_dir'] = $cache_dir . 'upload/';
$sugar_config['use_php_code_json'] = returnPhpJsonStatus();
// true on error
if (isset($_SESSION['setup_site_sugarbeet_anonymous_stats'])) {
$sugar_config['sugarbeet'] = $_SESSION['setup_site_sugarbeet_anonymous_stats'];
}
$sugar_config['demoData'] = $_SESSION['demoData'];
if (isset($sugar_config['unique_key'])) {
$sugar_config['unique_key'] = $setup_site_guid;
}
if (empty($sugar_config['unique_key'])) {
$sugar_config['unique_key'] = md5(create_guid());
}
// add installed langs to config
// entry in upgrade_history comes AFTER table creation
if (isset($_SESSION['INSTALLED_LANG_PACKS']) && is_array($_SESSION['INSTALLED_LANG_PACKS']) && !empty($_SESSION['INSTALLED_LANG_PACKS'])) {
foreach ($_SESSION['INSTALLED_LANG_PACKS'] as $langZip) {
$lang = getSugarConfigLanguageArray($langZip);
if (!empty($lang)) {
$exLang = explode('::', $lang);
if (is_array($exLang) && count($exLang) == 3) {
$sugar_config['languages'][$exLang[0]] = $exLang[1];
}
}
}
}
// handle localization defaults
$sugar_config['default_date_format'] = $_SESSION["default_date_format"];
$sugar_config['default_time_format'] = $_SESSION["default_time_format"];
$sugar_config['default_language'] = $_SESSION["default_language"];
$sugar_config['default_locale_name_format'] = $_SESSION["default_locale_name_format"];
$sugar_config['default_email_charset'] = $_SESSION["default_email_charset"];
$sugar_config['default_export_charset'] = $_SESSION["default_export_charset"];
$sugar_config['export_delimiter'] = $_SESSION["export_delimiter"];
$sugar_config['default_currency_name'] = $_SESSION["default_currency_name"];
$sugar_config['default_currency_symbol'] = $_SESSION["default_currency_symbol"];
$sugar_config['default_currency_iso4217'] = $_SESSION["default_currency_iso4217"];
//.........这里部分代码省略.........
开发者ID:klr2003,项目名称:sourceread,代码行数:101,代码来源:install_utils.php
示例6: get_sugar_config_defaults
}
$dbUser .= " {$mod_strings['LBL_CONFIRM_BE_CREATED']})";
$yesNoDropCreate = $mod_strings['LBL_NO'];
if ($_SESSION['setup_db_drop_tables'] === true || $_SESSION['setup_db_drop_tables'] == 'true') {
$yesNoDropCreate = $mod_strings['LBL_YES'];
}
$yesNoSugarUpdates = $_SESSION['setup_site_sugarbeet'] ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
$yesNoCustomSession = $_SESSION['setup_site_custom_session_path'] ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
$yesNoCustomLog = $_SESSION['setup_site_custom_log_dir'] ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
$yesNoCustomId = $_SESSION['setup_site_specify_guid'] ? $mod_strings['LBL_YES'] : $mod_strings['LBL_NO'];
$demoData = $_SESSION['demoData'] == 'en_us' ? $mod_strings['LBL_YES'] : $_SESSION['demoData'];
// Populate the default date format, time format, and language for the system
$defaultDateFormat = "";
$defaultTimeFormat = "";
$defaultLanguages = "";
$sugar_config_defaults = get_sugar_config_defaults();
if (isset($_REQUEST['default_language'])) {
$defaultLanguages = $sugar_config_defaults['languages'][$_REQUEST['default_language']];
}
///////////////////////////////////////////////////////////////////////////////
//// START OUTPUT
$out = <<<EOQ
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>{$mod_strings['LBL_WIZARD_TITLE']} {$mod_strings['LBL_CONFIRM_TITLE']}</title>
<link REL="SHORTCUT ICON" HREF="{$icon}">
<link rel="stylesheet" href="{$css}" type="text/css" />
开发者ID:razorinc,项目名称:sugarcrm-example,代码行数:31,代码来源:confirmSettings.php
示例7: foreach
if (isset($validation_errors) && is_array($validation_errors)) {
if (count($validation_errors) > 0) {
$errors = '<div id="errorMsgs">';
$errors .= '<p>' . $mod_strings['LBL_SITECFG_FIX_ERRORS'] . '</p><ul>';
foreach ($validation_errors as $error) {
$errors .= '<li>' . $error . '</li>';
}
$errors .= '</ul></div>';
}
}
//// ternaries
$sugarUpdates = isset($_SESSION['setup_site_sugarbeet']) && !empty($_SESSION['setup_site_sugarbeet']) ? 'checked="checked"' : '';
$siteSecurity = isset($_SESSION['setup_site_defaults']) && !empty($_SESSION['setup_site_defaults']) ? 'checked="checked"' : '';
$customSession = isset($_SESSION['setup_site_custom_session_path']) && !empty($_SESSION['setup_site_custom_session_path']) ? 'checked="checked"' : '';
$customLog = isset($_SESSION['setup_site_custom_log_dir']) && !empty($_SESSION['setup_site_custom_log_dir']) ? 'checked="checked"' : '';
$customId = isset($_SESSION['setup_site_specify_guid']) && !empty($_SESSION['setup_site_specify_guid']) ? 'checked="checked"' : '';
$customSessionHidden = isset($_SESSION['setup_site_custom_session_path']) && !empty($_SESSION['setup_site_custom_session_path']) ? '' : ' style="display:none;" ';
$customLogHidden = isset($_SESSION['setup_site_custom_log_dir']) && !empty($_SESSION['setup_site_custom_log_dir']) ? '' : ' style="display:none;" ';
$customIdHidden = isset($_SESSION['setup_site_specify_guid']) && !empty($_SESSION['setup_site_specify_guid']) ? '' : ' style="display:none;" ';
// defaults or user sets
// warn: may the system bring it up
$_SESSION = array_merge($_SESSION, $_POST);
$sugarConfigDefaults = array_merge(get_sugar_config_defaults(), $_SESSION);
//----- show layout
// show display errors (for testing only - do not forget restore!)
// DisplayErrors::show();
$installConfigLayout = new InstallLayout();
$installConfigLayout->show(get_defined_vars());
// restore display errors
// DisplayErrors::restore();
// TODO--low: add Name Format [default_locale_name_format] [Dr. David Livingstone] -- ???
开发者ID:sacredwebsite,项目名称:SuiteCRM,代码行数:31,代码来源:installConfig.php
示例8: rebuildConfigFile
/**
* This function will rebuild the config file
* @param $sugar_config
* @param $sugar_version
* @return bool true if successful
*/
function rebuildConfigFile($sugar_config, $sugar_version)
{
// add defaults to missing values of in-memory sugar_config
$sugar_config = sugarArrayMerge(get_sugar_config_defaults(), $sugar_config);
if (isset($sugar_config['sugarbeet'])) {
//$sugar_config['sugarbeet'] is only set in COMM
unset($sugar_config['sugarbeet']);
}
if (isset($sugar_config['disable_team_access_check'])) {
//$sugar_config['disable_team_access_check'] is a runtime configration,
//no need to write to config.php
unset($sugar_config['disable_team_access_check']);
}
// need to override version with default no matter what
$sugar_config['sugar_version'] = $sugar_version;
ksort($sugar_config);
if (write_array_to_file("sugar_config", $sugar_config, "config.php")) {
return true;
} else {
return false;
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:28,代码来源:utils.php
注:本文中的get_sugar_config_defaults函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论