lib/CPAN/lib/CGI/Session/Serialize/freezethaw.pm
changeset 0 414e01d06fd5
equal deleted inserted replaced
-1:000000000000 0:414e01d06fd5
       
     1 package CGI::Session::Serialize::freezethaw;
       
     2 
       
     3 # $Id: freezethaw.pm 351 2006-11-24 14:16:50Z markstos $ 
       
     4 
       
     5 use strict;
       
     6 use FreezeThaw;
       
     7 use CGI::Session::ErrorHandler;
       
     8 
       
     9 $CGI::Session::Serialize::freezethaw::VERSION = 4.2;
       
    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