配置文件格式:
#
# Main Configuration File
#
# it can be default or whatever language. Only greek are supported
# from non latin alphabet languages
# These attribute only apply for ldap not for sql
#
general_prefered_lang: el
general_prefered_lang_name: Greek
#
# Uncomment this if normal attributes (not the ;lang-xx ones) in ldap
# are utf8 encoded.
#
#general_decode_normal_attributes: yes
#
general_base_dir: /usr/local/dialup_admin
general_radiusd_base_dir: /usr/local/
general_domain: my.domain
读取配置文件的php函数
if (!isset($config)){
$ARR=file("admin.conf");
foreach($ARR as $val) {
$val=chop($val);
if (ereg('^[[:space:]]*#',$val) || ereg('^[[:space:]]*$',$val))
continue;
list($key,$v)=split(":[[:space:]]*",$val,2);
if (preg_match("/%\{(.+)\}/",$v,$matches)){
$val=$config[$matches[1]];
$v=preg_replace("/%\{$matches[1]\}/",$val,$v);
}
$config["$key"]="$v";
}
echo "<pre>";
var_dump($config);
}