* Call config.php3 before outputing any html.
* Add sessions in order to cache the various mappings. Add a corresponding configuration directive
general_use_session. Also add a session cache destroy page.
+* Also cache the admin.conf if use_session is set to 1 in config.php3
Ver 1.55:
* Update the FAQ about missing attributes from the user/group edit pages and add a few comments
in the configuration files
general_domain: company.com
#
# Set it to yes to use sessions and cache the various mappings
+# You can also set use_session = 1 in config.php3 to also cache
+# the admin.conf
# This feature is considered experimantal for the moment
general_use_session: no
<?php
-$ARR=file("../conf/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);
+# If using sessions set use_session to 1 to also cache the config file
+#
+$use_session = 0;
+if ($use_session){
+ // Start session
+ @session_start();
+}
+if (!isset($config)){
+ $ARR=file("../conf/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";
}
- $config["$key"]="$v";
+ if ($use_session)
+ session_register('config');
}
-if ($config[general_use_session] == 'yes'){
+if ($use_session == 0 && $config[general_use_session] == 'yes'){
// Start session
@session_start();
}