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

(-)a/C4/Auth.pm (-1 / +1 lines)
Lines 1847-1853 will be created. Link Here
1847
1847
1848
sub _get_session_params {
1848
sub _get_session_params {
1849
    my $storage_method = C4::Context->preference('SessionStorage');
1849
    my $storage_method = C4::Context->preference('SessionStorage');
1850
    my $serializer = q{serialize:JSON};
1850
    my $serializer = q{serialize:yamlxs};
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
        # Note that the doc is wrong, type is required, if not provided it default to File
1853
        # Note that the doc is wrong, type is required, if not provided it default to File
(-)a/lib/CGI/Session/Serialize/yamlxs.pm (-22 lines)
Lines 1-22 Link Here
1
package CGI::Session::Serialize::yamlxs;
2
3
use strict;
4
use warnings;
5
6
use CGI::Session::ErrorHandler;
7
use YAML::XS ();
8
9
$CGI::Session::Serialize::yamlxs::VERSION = '0.1';
10
@CGI::Session::Serialize::yamlxs::ISA     = ( "CGI::Session::ErrorHandler" );
11
12
sub freeze {
13
    my ($self, $data) = @_;
14
    return YAML::XS::Dump($data);
15
}
16
17
sub thaw {
18
    my ($self, $string) = @_;
19
    return (YAML::XS::Load($string))[0];
20
}
21
22
1;
(-)a/lib/Data/Session/Serialize/yamlxs.pm (-1 / +27 lines)
Line 0 Link Here
0
- 
1
package Data::Session::Serialize::yamlxs;
2
3
use parent 'Data::Session::Base';
4
no autovivification;
5
use strict;
6
use warnings;
7
8
use YAML::XS;
9
10
our $VERSION = '0.1';
11
12
sub freeze {
13
    my($self, $data) = @_;
14
    return YAML::XS::Dump($data);
15
}
16
17
sub new {
18
    my($class) = @_;
19
    return bless({}, $class);
20
}
21
22
sub thaw {
23
    my ($self, $string) = @_;
24
    return (YAML::XS::Load($string))[0];
25
}
26
27
1;

Return to bug 17427