Repair purgeLocalCache + improve default cache conf (Lemonldap-499)

This commit is contained in:
François-Xavier Deltombe 2012-08-13 10:01:59 +00:00
parent 94ea52a4af
commit d455e5fd6b
2 changed files with 37 additions and 20 deletions

View File

@ -79,23 +79,23 @@ dirName=/var/lib/lemonldap-ng/conf
# LOCAL CACHE CONFIGURATION
#
# To increase performances, use a local cache for the configuration. You have
# to choose a Cache::Cache module and set it's parameters (1 line). Example:
# to choose a Cache::Cache module and set its parameters. Example:
#
# localStorage = Cache::FileCache
# localStorageOptions={ \
# 'namespace' => 'lemonldap-ng',\
# 'default_expires_in' => 600, \
# 'directory_umask' => '007', \
# 'cache_root' => '/tmp', \
# 'cache_depth' => 5, \
# localStorageOptions={ \
# 'namespace' => 'lemonldap-ng-config',\
# 'default_expires_in' => 600, \
# 'directory_umask' => '007', \
# 'cache_root' => '/tmp', \
# 'cache_depth' => 0, \
# }
localStorage=Cache::FileCache
localStorageOptions={ \
'namespace' => 'lemonldap-ng',\
'default_expires_in' => 600, \
'directory_umask' => '007', \
'cache_root' => '/tmp', \
'cache_depth' => 5, \
localStorageOptions={ \
'namespace' => 'lemonldap-ng-config',\
'default_expires_in' => 600, \
'directory_umask' => '007', \
'cache_root' => '/tmp', \
'cache_depth' => 0, \
}
[portal]
@ -209,6 +209,28 @@ localStorageOptions={ \
[handler]
# SESSION CACHE CONFIGURATION
#
# To increase performances, use a local cache for sessions. You have
# to choose a Cache::Cache module and set its parameters. Example:
#
# localStorage = Cache::FileCache
# localStorageOptions={ \
# 'namespace' => 'lemonldap-ng-sessions',\
# 'default_expires_in' => 600, \
# 'directory_umask' => '007', \
# 'cache_root' => '/tmp', \
# 'cache_depth' => 3, \
# }
localStorage=Cache::FileCache
localStorageOptions={ \
'namespace' => 'lemonldap-ng-sessions',\
'default_expires_in' => 600, \
'directory_umask' => '007', \
'cache_root' => '/tmp', \
'cache_depth' => 3, \
}
# Set https to 1 if your handler protect a https website (used only for
# redirections to the portal)
;https = 0

View File

@ -19,20 +19,15 @@ my $debug = 0;
#=============================================================================
my $lmconf = Lemonldap::NG::Common::Conf->new()
or die $Lemonldap::NG::Common::Conf::msg;
my $conf = $lmconf->getConf or die "Unable to get configuration ($!)";
my $localconf = $lmconf->getLocalConf(HANDLERSECTION)
my $conf = $lmconf->getLocalConf(HANDLERSECTION)
or die "Unable to get local configuration ($!)";
if ($localconf) {
$conf->{$_} = $localconf->{$_} foreach ( keys %$localconf );
}
print "Configuration loaded\n" if $debug;
exit 0 unless ( $conf->{localStorage} );
eval "require $conf->{localStorage}";
$conf->{localStorageOptions}->{namespace} ||= "lemonldap";
$conf->{localStorageOptions}->{default_expires_in} ||= 600;
my $c = $conf->{localStorage}->new( $conf->{localStorageOptions} );
$c->Purge();
$c->purge();
exit 0;