Lines 35-41
use POSIX qw/strftime/;
Link Here
|
35 |
use List::MoreUtils qw/ any /; |
35 |
use List::MoreUtils qw/ any /; |
36 |
|
36 |
|
37 |
# use utf8; |
37 |
# use utf8; |
38 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap $cas $caslogout $servers $memcached); |
38 |
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap $cas $caslogout); |
39 |
|
39 |
|
40 |
BEGIN { |
40 |
BEGIN { |
41 |
sub psgi_env { any { /^psgi\./ } keys %ENV } |
41 |
sub psgi_env { any { /^psgi\./ } keys %ENV } |
Lines 61-76
BEGIN {
Link Here
|
61 |
if ($cas) { |
61 |
if ($cas) { |
62 |
import C4::Auth_with_cas qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url); |
62 |
import C4::Auth_with_cas qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url); |
63 |
} |
63 |
} |
64 |
$servers = C4::Context->config('memcached_servers'); |
64 |
|
65 |
if ($servers) { |
|
|
66 |
require Cache::Memcached; |
67 |
$memcached = Cache::Memcached->new({ |
68 |
servers => [ $servers ], |
69 |
debug => 0, |
70 |
compress_threshold => 10_000, |
71 |
namespace => C4::Context->config('memcached_namespace') || 'koha', |
72 |
}); |
73 |
} |
74 |
} |
65 |
} |
75 |
|
66 |
|
76 |
=head1 NAME |
67 |
=head1 NAME |
Lines 1426-1433
sub get_session {
Link Here
|
1426 |
elsif ($storage_method eq 'Pg') { |
1417 |
elsif ($storage_method eq 'Pg') { |
1427 |
$session = new CGI::Session("driver:PostgreSQL;serializer:yaml;id:md5", $sessionID, {Handle=>$dbh}); |
1418 |
$session = new CGI::Session("driver:PostgreSQL;serializer:yaml;id:md5", $sessionID, {Handle=>$dbh}); |
1428 |
} |
1419 |
} |
1429 |
elsif ($storage_method eq 'memcached' && $servers){ |
1420 |
elsif ($storage_method eq 'memcached' && C4::Context->ismemcached){ |
1430 |
$session = new CGI::Session("driver:memcached;serializer:yaml;id:md5", $sessionID, { Memcached => $memcached } ); |
1421 |
$session = new CGI::Session("driver:memcached;serializer:yaml;id:md5", $sessionID, { Memcached => C4::Context->memcached } ); |
1431 |
} |
1422 |
} |
1432 |
else { |
1423 |
else { |
1433 |
# catch all defaults to tmp should work on all systems |
1424 |
# catch all defaults to tmp should work on all systems |