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