CGI-Session-Serialize-yaml-4.26000755001750001750 011354014421 15127 5ustar00ronron000000000000CGI-Session-Serialize-yaml-4.26/README000444001750001750 354211354014421 16150 0ustar00ronron000000000000NAME CGI::Session - persistent session data in CGI applications SYNOPSIS # Object initialization: use CGI::Session; $session = new CGI::Session(); $CGISESSID = $session->id(); # send proper HTTP header with cookies: print $session->header(); # storing data in the session $session->param('f_name', 'Sherzod'); # or $session->param(-name=>'l_name', -value=>'Ruzmetov'); # retrieving data my $f_name = $session->param('f_name'); # or my $l_name = $session->param(-name=>'l_name'); # clearing a certain session parameter $session->clear(["l_name", "f_name"]); # expire '_is_logged_in' flag after 10 idle minutes: $session->expire('is_logged_in', '+10m') # expire the session itself after 1 idle hour $session->expire('+1h'); # delete the session for good $session->delete(); DESCRIPTION CGI-Session is a Perl5 library that provides an easy, reliable and modular session management system across HTTP requests. Persistency is a key feature for such applications as shopping carts, login/authentication routines, and application that need to carry data across HTTP requests. CGI::Session does that and many more. COPYRIGHT Copyright (C) 2001-2005 Sherzod Ruzmetov . All rights reserved. This library is free software. You can modify and or distribute it under the same terms as Perl itself. AUTHOR Sherzod Ruzmetov , http://author.handalak.com/ SEE ALSO * CGI::Session::Tutorial - extended CGI::Session manual * RFC 2965 - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt * CGI - standard CGI library * Apache::Session - another fine alternative to CGI::Session CGI-Session-Serialize-yaml-4.26/Makefile.PL000444001750001750 201111354014421 17230 0ustar00ronron000000000000# $Id: Makefile.PL 336 2006-10-26 02:17:31Z markstos $ use strict; use File::Spec; use lib './t/lib'; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'CGI::Session::Serialize::yaml', VERSION_FROM => 'lib/CGI/Session/Serialize/yaml.pm', PREREQ_PM => { 'CGI::Session' => 4.30, 'CGI::Session::ErrorHandler' => 4.30, 'File::Spec' => 0, 'Test::More' => 0, 'Test::Pod' => 0, }, ABSTRACT => 'Persistent session data in CGI applications', AUTHOR => 'Sherzod Ruzmetov ', clean => { FILES => [ 't/cgisess.*', 't/sessiondata' ] }, ); # # Creating place for test-scripts. Some of the scripts needs this to be present # mkdir(File::Spec->catfile('t', 'sessiondata')); package MY; use strict; sub postamble { return <<'MAKE_TEXT'; prepare_dist :: metafile manifest dist $(NOECHO) $(NOOP) MAKE_TEXT } sub libscan { my ($self, $path) = @_; return '' if $path =~ m/\.svn/; return $path; } CGI-Session-Serialize-yaml-4.26/META.yml000444001750001750 123611354014421 16537 0ustar00ronron000000000000--- abstract: "Add YAML and YAML::Syck support to CGI::Session's serializers" author: - 'Ron Savage ' build_requires: File::Spec: 0 Test::More: 0 Test::Pod: 0 configure_requires: Module::Build: 0.36 generated_by: 'Module::Build version 0.3603' license: artistic meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: CGI-Session-Serialize-yaml provides: CGI::Session::Serialize::yaml: file: lib/CGI/Session/Serialize/yaml.pm version: 4.26 requires: CGI::Session: 4.3 CGI::Session::ErrorHandler: 4.3 resources: license: http://opensource.org/licenses/artistic-license.php version: 4.26 CGI-Session-Serialize-yaml-4.26/Changelog.ini000444001750001750 327211354014421 17660 0ustar00ronron000000000000[Module] Name=CGI::Session::Serialize::yaml Changelog.Creator=Module::Metadata::Changes V 1.06 Changelog.Parser=Config::IniFiles V 2.56 [V 4.26] Date=2010-02-10T13:52:41 Comments=- Add META.yml. Update MANIFEST.SKIP. Add MANIFEST and MYMETA.yml. [V 4.25] Date=2009-11-13T13:20:00 Comments= < install CGI::Session::Serialize::yaml Using Makefile.PL -------------------- % perl Makefile.PL % make % make test % make install If you don't have proper permissions to perform system-wide installations you can install CGI::Session::Serialize::yaml to your private PERL5LIB folder: % perl Makefile.PL LIB=~/perllib % make % make test % make install These commands install CGI::Session::Serialize::yaml to your ~/perllib folder. TESTING ======= See the INSTALL document in the CGI::Session distro. CGI-Session-Serialize-yaml-4.26/MANIFEST000444001750001750 23611354014421 16376 0ustar00ronron000000000000Build.PL Changelog.ini CHANGES INSTALL lib/CGI/Session/Serialize/yaml.pm Makefile.PL MANIFEST This list of files META.yml README t/g4_dbfile_yaml.t t/pod.t CGI-Session-Serialize-yaml-4.26/Build.PL000444001750001750 111311354014421 16554 0ustar00ronron000000000000use File::Spec; use Module::Build; # ./t/sessiondata is needed for testing. mkdir(File::Spec->catfile('t', 'sessiondata')); Module::Build -> new ( module_name => 'CGI::Session::Serialize::yaml', license => 'artistic', dist_abstract => "Add YAML and YAML::Syck support to CGI::Session's serializers", dist_author => 'Ron Savage ', build_requires => { 'File::Spec' => 0, 'Test::More' => 0, 'Test::Pod' => 0, }, requires => { 'CGI::Session' => 4.30, 'CGI::Session::ErrorHandler' => 4.30, }, ) -> create_build_script(); CGI-Session-Serialize-yaml-4.26/lib000755001750001750 011354014421 15675 5ustar00ronron000000000000CGI-Session-Serialize-yaml-4.26/lib/CGI000755001750001750 011354014421 16277 5ustar00ronron000000000000CGI-Session-Serialize-yaml-4.26/lib/CGI/Session000755001750001750 011354014421 17722 5ustar00ronron000000000000CGI-Session-Serialize-yaml-4.26/lib/CGI/Session/Serialize000755001750001750 011354014421 21651 5ustar00ronron000000000000CGI-Session-Serialize-yaml-4.26/lib/CGI/Session/Serialize/yaml.pm000444001750001750 352711354014421 23315 0ustar00ronron000000000000package CGI::Session::Serialize::yaml; use strict; use CGI::Session::ErrorHandler; $CGI::Session::Serialize::yaml::VERSION = '4.26'; @CGI::Session::Serialize::yaml::ISA = ( "CGI::Session::ErrorHandler" ); our $Flavour; unless($Flavour) { my $package = (grep { eval("use $_ (); 1;") } qw(YAML::Syck YAML))[0] or die "Either YAML::Syck or YAML are required to use ", __PACKAGE__; $Flavour = $package; } sub freeze { my ($self, $data) = @_; return $Flavour->can('Dump')->($data); } sub thaw { my ($self, $string) = @_; return ($Flavour->can('Load')->($string))[0]; } 1; __END__; =pod =head1 NAME CGI::Session::Serialize::yaml - serializer for CGI::Session =head1 DESCRIPTION This library can be used by CGI::Session to serialize session data. It uses C, or the faster C implementation, C if it is available. YAML serializers exist not just for Perl but also other dynamic languages, such as PHP, Python, and Ruby, so storing session data in this format makes it easy to share session data across different languages. YAML is made to be friendly for humans to parse as well as other computer languages. It creates a format that is easier to read than the default serializer. =head1 METHODS =over 4 =item freeze($class, \%hash) 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 =item thaw($class, $string) Received two arguments. First is the class name, second is the C data string. Should return thawed data structure on success, undef on failure. Error message should be set using C =back =head1 SEE ALSO C, C, C. =cut CGI-Session-Serialize-yaml-4.26/t000755001750001750 011354014421 15372 5ustar00ronron000000000000CGI-Session-Serialize-yaml-4.26/t/pod.t000444001750001750 20411354014421 16452 0ustar00ronron000000000000use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); CGI-Session-Serialize-yaml-4.26/t/g4_dbfile_yaml.t000444001750001750 222111354014421 20552 0ustar00ronron000000000000# $Id$ use strict; use diagnostics; use Test::More; use File::Spec; use CGI::Session::Test::Default; our %serializers; our %options = ( 'YAML' => { }, 'YAML::Syck' => { skip => [101] }, ); plan skip_all => 'DB_File is NOT available' unless eval { require DB_File }; foreach my $i (keys(%options)) { $serializers{$i}++ if eval "use $i (); 1"; } delete $serializers{YAML} if exists $serializers{YAML} && YAML->VERSION < 0.58; unless(%serializers) { plan skip_all => "Neither YAML or YAML::Syck are available"; } my @test_objects; while(my($k, $v) = each(%serializers)) { push(@test_objects, CGI::Session::Test::Default->new( dsn => "d:DB_File;s:YAML;id:md5", args => { FileName => File::Spec->catfile('t', 'sessiondata', 'cgisess.db'), }, %{$options{$k}}, __testing_serializer => $k, )); } my $tests = 0; $tests += $_->number_of_tests foreach @test_objects; plan tests => $tests; foreach my $to (@test_objects) { $CGI::Session::Serialize::yaml::Flavour = $to->{__testing_serializer}; diag($CGI::Session::Serialize::yaml::Flavour); $to->run(); }