root/Apache-Session-Serialize-YAML/trunk/lib/Apache/Session/Serialize/YAML.pm

Revision 684 (checked in by miyagawa, 18 years ago)

Makefile.PL

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 package Apache::Session::Serialize::YAML;
2
3 use strict;
4 use vars qw($VERSION);
5 $VERSION = 0.02;
6
7 use YAML ();
8
9 sub serialize {
10     my $session = shift;
11     $session->{serialized} = YAML::Dump($session->{data});
12 }
13
14 sub unserialize {
15     my $session = shift;
16     $session->{data} = YAML::Load($session->{serialized});
17 }
18
19
20 1;
21 __END__
22
23 =head1 NAME
24
25 Apache::Session::Serialize::YAML - use YAML for serialization
26
27 =head1 SYNOPSIS
28
29   use Apache::Session::Flex;
30
31   tie %session, 'Apache::Session::Flex', $id, {
32        Store     => 'MySQL',
33        Lock      => 'Null',
34        Generate  => 'MD5',
35        Serialize => 'YAML',
36   };
37
38
39 =head1 DESCRIPTION
40
41 Apache::Session::Serialize::YAML enables you to use YAML (YAML Ain't
42 Makeup Language [tm]) for Apache::Session serialization format. YAML
43 is a generic data serialization language for scripting languages, so
44 this module can be a good start to share session data with Ruby,
45 Python or PHP etc.
46
47 See http://www.yaml.org/ for details of YAML.
48
49 =head1 AUTHOR
50
51 Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt>
52
53 This library is free software; you can redistribute it and/or modify
54 it under the same terms as Perl itself.
55
56 =head1 SEE ALSO
57
58 L<YAML>, L<Apache::Session>, L<Apache::Session::PHP>
59
60 =cut
Note: See TracBrowser for help on using the browser.