Lines 1850-1870
sub _get_session_params {
Link Here
|
1850 |
my $storage_method = C4::Context->preference('SessionStorage'); |
1850 |
my $storage_method = C4::Context->preference('SessionStorage'); |
1851 |
if ( $storage_method eq 'mysql' ) { |
1851 |
if ( $storage_method eq 'mysql' ) { |
1852 |
my $dbh = C4::Context->dbh; |
1852 |
my $dbh = C4::Context->dbh; |
1853 |
return { dsn => "driver:MySQL;serializer:yaml;id:md5", dsn_args => { Handle => $dbh } }; |
1853 |
return { dsn => "driver:MySQL;id:md5", dsn_args => { Handle => $dbh } }; |
1854 |
} |
1854 |
} |
1855 |
elsif ( $storage_method eq 'Pg' ) { |
1855 |
elsif ( $storage_method eq 'Pg' ) { |
1856 |
my $dbh = C4::Context->dbh; |
1856 |
my $dbh = C4::Context->dbh; |
1857 |
return { dsn => "driver:PostgreSQL;serializer:yaml;id:md5", dsn_args => { Handle => $dbh } }; |
1857 |
return { dsn => "driver:PostgreSQL;id:md5", dsn_args => { Handle => $dbh } }; |
1858 |
} |
1858 |
} |
1859 |
elsif ( $storage_method eq 'memcached' && Koha::Caches->get_instance->memcached_cache ) { |
1859 |
elsif ( $storage_method eq 'memcached' && Koha::Caches->get_instance->memcached_cache ) { |
1860 |
my $memcached = Koha::Caches->get_instance()->memcached_cache; |
1860 |
my $memcached = Koha::Caches->get_instance()->memcached_cache; |
1861 |
return { dsn => "driver:memcached;serializer:yaml;id:md5", dsn_args => { Memcached => $memcached } }; |
1861 |
return { dsn => "driver:memcached;id:md5", dsn_args => { Memcached => $memcached } }; |
1862 |
} |
1862 |
} |
1863 |
else { |
1863 |
else { |
1864 |
# catch all defaults to tmp should work on all systems |
1864 |
# catch all defaults to tmp should work on all systems |
1865 |
my $dir = C4::Context::temporary_directory; |
1865 |
my $dir = C4::Context::temporary_directory; |
1866 |
my $instance = C4::Context->config( 'database' ); #actually for packages not exactly the instance name, but generally safer to leave it as it is |
1866 |
my $instance = C4::Context->config( 'database' ); #actually for packages not exactly the instance name, but generally safer to leave it as it is |
1867 |
return { dsn => "driver:File;serializer:yaml;id:md5", dsn_args => { Directory => "$dir/cgisess_$instance" } }; |
1867 |
return { dsn => "driver:File;id:md5", dsn_args => { Directory => "$dir/cgisess_$instance" } }; |
1868 |
} |
1868 |
} |
1869 |
} |
1869 |
} |
1870 |
|
1870 |
|