View | Details | Raw Unified | Return to bug 11921
Collapse All | Expand All

(-)a/C4/Context.pm (-11 / +7 lines)
Lines 246-263 sub new { Link Here
246
    my $conf_cache = Koha::Caches->get_instance('config');
246
    my $conf_cache = Koha::Caches->get_instance('config');
247
    my $config_from_cache;
247
    my $config_from_cache;
248
    if ( $conf_cache->cache ) {
248
    if ( $conf_cache->cache ) {
249
        $config_from_cache = $conf_cache->get_from_cache('koha_conf');
249
        $self = $conf_cache->get_from_cache('koha_conf');
250
    }
250
    }
251
    unless ( %$self ) {
251
    unless ( $self and %$self ) {
252
        $self = Koha::Config->read_from_file($conf_fname);
252
        $self = Koha::Config->read_from_file($conf_fname);
253
    }
253
        if ( $conf_cache->memcached_cache ) {
254
254
            # FIXME it may be better to use the memcached servers from the config file
255
    if ( $config_from_cache ) {
255
            # to cache it
256
        $self = $config_from_cache;
256
            $conf_cache->set_in_cache('koha_conf', $self)
257
    } elsif ( $conf_cache->memcached_cache ) {
257
        }
258
        # FIXME it may be better to use the memcached servers from the config file
259
        # to cache it
260
        $conf_cache->set_in_cache('koha_conf', $self)
261
    }
258
    }
262
    unless ( exists $self->{config} or defined $self->{config} ) {
259
    unless ( exists $self->{config} or defined $self->{config} ) {
263
        warn "The config file ($conf_fname) has not been parsed correctly";
260
        warn "The config file ($conf_fname) has not been parsed correctly";
264
- 

Return to bug 11921