Bugzilla – Attachment 121659 Details for
Bug 17427
Replace CGI::Session with Data::Session
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17427: Use our own YAML::XS serializer
Bug-17427-Use-our-own-YAMLXS-serializer.patch (text/plain), 2.33 KB, created by
Jonathan Druart
on 2021-06-07 12:14:27 UTC
(
hide
)
Description:
Bug 17427: Use our own YAML::XS serializer
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-06-07 12:14:27 UTC
Size:
2.33 KB
patch
obsolete
>From 2af11ccb92d31f6304b7450d2d8a35dae5a13398 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 7 Jun 2021 13:53:05 +0200 >Subject: [PATCH] Bug 17427: Use our own YAML::XS serializer > >--- > C4/Auth.pm | 2 +- > lib/CGI/Session/Serialize/yamlxs.pm | 22 ---------------------- > lib/Data/Session/Serialize/yamlxs.pm | 27 +++++++++++++++++++++++++++ > 3 files changed, 28 insertions(+), 23 deletions(-) > delete mode 100644 lib/CGI/Session/Serialize/yamlxs.pm > create mode 100644 lib/Data/Session/Serialize/yamlxs.pm > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 5063754ff00..8976afc866d 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1847,7 +1847,7 @@ will be created. > > sub _get_session_params { > my $storage_method = C4::Context->preference('SessionStorage'); >- my $serializer = q{serialize:JSON}; >+ my $serializer = q{serialize:yamlxs}; > if ( $storage_method eq 'mysql' ) { > my $dbh = C4::Context->dbh; > # Note that the doc is wrong, type is required, if not provided it default to File >diff --git a/lib/CGI/Session/Serialize/yamlxs.pm b/lib/CGI/Session/Serialize/yamlxs.pm >deleted file mode 100644 >index 77d2a8d51a2..00000000000 >--- a/lib/CGI/Session/Serialize/yamlxs.pm >+++ /dev/null >@@ -1,22 +0,0 @@ >-package CGI::Session::Serialize::yamlxs; >- >-use strict; >-use warnings; >- >-use CGI::Session::ErrorHandler; >-use YAML::XS (); >- >-$CGI::Session::Serialize::yamlxs::VERSION = '0.1'; >-@CGI::Session::Serialize::yamlxs::ISA = ( "CGI::Session::ErrorHandler" ); >- >-sub freeze { >- my ($self, $data) = @_; >- return YAML::XS::Dump($data); >-} >- >-sub thaw { >- my ($self, $string) = @_; >- return (YAML::XS::Load($string))[0]; >-} >- >-1; >diff --git a/lib/Data/Session/Serialize/yamlxs.pm b/lib/Data/Session/Serialize/yamlxs.pm >new file mode 100644 >index 00000000000..8adbaba8a88 >--- /dev/null >+++ b/lib/Data/Session/Serialize/yamlxs.pm >@@ -0,0 +1,27 @@ >+package Data::Session::Serialize::yamlxs; >+ >+use parent 'Data::Session::Base'; >+no autovivification; >+use strict; >+use warnings; >+ >+use YAML::XS; >+ >+our $VERSION = '0.1'; >+ >+sub freeze { >+ my($self, $data) = @_; >+ return YAML::XS::Dump($data); >+} >+ >+sub new { >+ my($class) = @_; >+ return bless({}, $class); >+} >+ >+sub thaw { >+ my ($self, $string) = @_; >+ return (YAML::XS::Load($string))[0]; >+} >+ >+1; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 17427
:
56185
|
56504
|
56572
|
57067
|
60355
|
121337
|
121633
|
121657
|
121658
|
121659
|
150569
|
150570
|
150571
|
150603
|
150604
|
150605
|
150606
|
150633
|
150634
|
150635
|
150636
|
150637
|
150638
|
150639
|
150926
|
150927
|
150928
|
150929
|
150930
|
150931
|
153030
|
153031
|
153032
|
153033
|
153034
|
153035
|
153036
|
153037
|
153038
|
153039
|
153040