本文整理汇总了PHP中config::get_cfg_value方法的典型用法代码示例。如果您正苦于以下问题:PHP config::get_cfg_value方法的具体用法?PHP config::get_cfg_value怎么用?PHP config::get_cfg_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::get_cfg_value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
/* Check if we need to run setup */
if (!file_exists(CONFIG_DIR . '/' . CONFIG_FILE)) {
header('location:setup.php');
exit;
}
/* Check if fusiondirectory.conf (.CONFIG_FILE) is accessible */
if (!is_readable(CONFIG_DIR . '/' . CONFIG_FILE)) {
msg_dialog::display(_('Configuration error'), sprintf(_('FusionDirectory configuration %s/%s is not readable. Please run fusiondirectory-setup --check-config to fix this.'), CONFIG_DIR, CONFIG_FILE), FATAL_ERROR_DIALOG);
exit;
}
/* Parse configuration file */
$config = new config(CONFIG_DIR . '/' . CONFIG_FILE, $BASE_DIR);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
session::global_set('DEBUGLEVEL', 0);
} else {
session::global_set('DEBUGLEVEL', $config->get_cfg_value('DEBUGLEVEL'));
@DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, 'config');
}
/* Set template compile directory */
$smarty->compile_dir = $config->get_cfg_value('templateCompileDirectory', SPOOL_DIR);
/* Check for compile directory */
if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))) {
msg_dialog::display(_('Smarty error'), sprintf(_('Directory "%s" specified as compile directory is not accessible!'), $smarty->compile_dir), FATAL_ERROR_DIALOG);
exit;
}
/* Check for old files in compile directory */
clean_smarty_compile_dir($smarty->compile_dir);
initLanguage();
$smarty->assign('nextfield', 'username');
if (isset($_POST['server'])) {
$server = $_POST['server'];
示例2: elseif
} elseif (isset($_GET['directory'])) {
$directory = $_GET['directory'];
} else {
$directory = $config->data['MAIN']['DEFAULT'];
if (!isset($servers[$directory])) {
$directory = key($servers);
}
}
// Set location and reload the configRegistry - we've now access to the ldap.
if (isset($servers[$directory])) {
$config->set_current($directory);
$config->check_and_reload();
$config->configRegistry->reload(TRUE);
}
session::global_set('plist', new pluglist($config, $ui));
session::global_set('debugLevel', $config->get_cfg_value("core", "debugLevel"));
if ($_SERVER["REQUEST_METHOD"] != "POST") {
@DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
}
/* Set template compile directory */
$smarty->compile_dir = $config->get_cfg_value("core", "templateCompileDirectory");
/* Check for compile directory */
if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))) {
msg_dialog::display(_("Configuration error"), sprintf(_("Compile directory %s is not accessible!"), bold($smarty->compile_dir)), FATAL_ERROR_DIALOG);
exit;
}
/* Check for old files in compile directory */
clean_smarty_compile_dir($smarty->compile_dir);
/* Language setup */
if ($config->get_cfg_value("core", "language") == "") {
$lang = get_browser_language();
示例3: header
header("location:setup.php");
exit;
}
/* Reset errors */
session::set('errors', "");
/* Check if fusiondirectory.conf (.CONFIG_FILE) is accessible */
if (!is_readable(CONFIG_DIR . "/" . CONFIG_FILE)) {
msg_dialog::display(_("Configuration error"), sprintf(_("FusionDirectory configuration %s/%s is not readable. Please run fusiondirectory-setup --check-config to fix this."), CONFIG_DIR, CONFIG_FILE), FATAL_ERROR_DIALOG);
exit;
}
/* Parse configuration file */
$config = new config(CONFIG_DIR . "/" . CONFIG_FILE, $BASE_DIR);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
session::global_set('DEBUGLEVEL', 0);
} else {
session::global_set('DEBUGLEVEL', $config->get_cfg_value('DEBUGLEVEL'));
@DEBUG(DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
}
/* Set template compile directory */
$smarty->compile_dir = $config->get_cfg_value("templateCompileDirectory", SPOOL_DIR);
/* Check for compile directory */
if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))) {
msg_dialog::display(_("Smarty error"), sprintf(_("Directory '%s' specified as compile directory is not accessible!"), $smarty->compile_dir), FATAL_ERROR_DIALOG);
exit;
}
/* Check for old files in compile directory */
clean_smarty_compile_dir($smarty->compile_dir);
initLanguage();
$smarty->assign('nextfield', 'username');
if (isset($_POST['server'])) {
$server = $_POST['server'];
示例4: sprintf
$smarty->assign("version", get_gosa_version());
$smarty->display(get_template_path('login.tpl'));
exit;
}
/*****************************************************************************
* M A I N *
*****************************************************************************/
/* Check if gosa.conf (.CONFIG_FILE) is accessible */
if (!is_readable(CONFIG_DIR . "/" . CONFIG_FILE)) {
msg_dialog::display(_("Configuration error"), sprintf(_("GOsa configuration %s/%s is not readable. Aborted."), CONFIG_DIR, CONFIG_FILE), FATAL_ERROR_DIALOG);
exit;
}
/* Parse configuration file */
$config = new config(CONFIG_DIR . "/" . CONFIG_FILE, $BASE_DIR);
/* Set template compile directory */
$smarty->compile_dir = $config->get_cfg_value("core", "templateCompileDirectory");
$smarty->error_unassigned = true;
/* Check for compile directory */
if (!(is_dir($smarty->compile_dir) && is_writable($smarty->compile_dir))) {
msg_dialog::display(_("Smarty error"), sprintf(_("Compile directory %s is not accessible!"), $smarty->compile_dir), FATAL_ERROR_DIALOG);
exit;
}
/* Check for old files in compile directory */
clean_smarty_compile_dir($smarty->compile_dir);
/* Language setup */
$lang = get_browser_language();
putenv("LANGUAGE=");
putenv("LANG={$lang}");
setlocale(LC_ALL, $lang);
$GLOBALS['t_language'] = $lang;
$GLOBALS['t_gettext_message_dir'] = $BASE_DIR . '/locale/';