~kosova/+junk/tuxfamily-twiki

« back to all changes in this revision

Viewing changes to foswiki/lib/CPAN/lib/CGI/Session/Serialize/freezethaw.pm

  • Committer: James Michael DuPont
  • Date: 2009-07-18 19:58:49 UTC
  • Revision ID: jamesmikedupont@gmail.com-20090718195849-vgbmaht2ys791uo2
added foswiki

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package CGI::Session::Serialize::freezethaw;
 
2
 
 
3
# $Id: freezethaw.pm 447 2008-11-01 03:46:08Z markstos $ 
 
4
 
 
5
use strict;
 
6
use FreezeThaw;
 
7
use CGI::Session::ErrorHandler;
 
8
 
 
9
$CGI::Session::Serialize::freezethaw::VERSION = 4.38;
 
10
@CGI::Session::Serialize::freezethaw::ISA     = ( "CGI::Session::ErrorHandler" );
 
11
 
 
12
sub freeze {
 
13
    my ($self, $data) = @_;
 
14
    return FreezeThaw::freeze($data);
 
15
}
 
16
 
 
17
 
 
18
sub thaw {
 
19
    my ($self, $string) = @_;
 
20
    return (FreezeThaw::thaw($string))[0];
 
21
}
 
22
 
 
23
1;
 
24
 
 
25
__END__;
 
26
 
 
27
=pod
 
28
 
 
29
=head1 NAME
 
30
 
 
31
CGI::Session::Serialize::freezethaw - serializer for CGI::Session
 
32
 
 
33
=head1 DESCRIPTION
 
34
 
 
35
This library can be used by CGI::Session to serialize session data. Uses L<FreezeThaw|FreezeThaw>.
 
36
 
 
37
=head1 METHODS
 
38
 
 
39
=over 4
 
40
 
 
41
=item freeze($class, \%hash)
 
42
 
 
43
Receives two arguments. First is the class name, the second is the data to be serialized. Should return serialized string on success, undef on failure. Error message should be set using C<set_error()|CGI::Session::ErrorHandler/"set_error()">
 
44
 
 
45
=item thaw($class, $string)
 
46
 
 
47
Received two arguments. First is the class name, second is the I<frozen> data string. Should return thawed data structure on success, undef on failure. Error message should be set using C<set_error()|CGI::Session::ErrorHandler/"set_error()">
 
48
 
 
49
=back
 
50
 
 
51
=head1 LICENSING
 
52
 
 
53
For support and licensing see L<CGI::Session|CGI::Session>
 
54
 
 
55
=cut