lib/CPAN/lib/CGI/Session/Serialize/freezethaw.pm
changeset 0 414e01d06fd5
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lib/CPAN/lib/CGI/Session/Serialize/freezethaw.pm	Sat Jan 26 15:50:53 2008 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +package CGI::Session::Serialize::freezethaw;
     1.5 +
     1.6 +# $Id: freezethaw.pm 351 2006-11-24 14:16:50Z markstos $ 
     1.7 +
     1.8 +use strict;
     1.9 +use FreezeThaw;
    1.10 +use CGI::Session::ErrorHandler;
    1.11 +
    1.12 +$CGI::Session::Serialize::freezethaw::VERSION = 4.2;
    1.13 +@CGI::Session::Serialize::freezethaw::ISA     = ( "CGI::Session::ErrorHandler" );
    1.14 +
    1.15 +sub freeze {
    1.16 +    my ($self, $data) = @_;
    1.17 +    return FreezeThaw::freeze($data);
    1.18 +}
    1.19 +
    1.20 +
    1.21 +sub thaw {
    1.22 +    my ($self, $string) = @_;
    1.23 +    return (FreezeThaw::thaw($string))[0];
    1.24 +}
    1.25 +
    1.26 +1;
    1.27 +
    1.28 +__END__;
    1.29 +
    1.30 +=pod
    1.31 +
    1.32 +=head1 NAME
    1.33 +
    1.34 +CGI::Session::Serialize::freezethaw - serializer for CGI::Session
    1.35 +
    1.36 +=head1 DESCRIPTION
    1.37 +
    1.38 +This library can be used by CGI::Session to serialize session data. Uses L<FreezeThaw|FreezeThaw>.
    1.39 +
    1.40 +=head1 METHODS
    1.41 +
    1.42 +=over 4
    1.43 +
    1.44 +=item freeze($class, \%hash)
    1.45 +
    1.46 +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()">
    1.47 +
    1.48 +=item thaw($class, $string)
    1.49 +
    1.50 +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()">
    1.51 +
    1.52 +=back
    1.53 +
    1.54 +=head1 LICENSING
    1.55 +
    1.56 +For support and licensing see L<CGI::Session|CGI::Session>
    1.57 +
    1.58 +=cut