PaxHeader/Catalyst-Plugin-Session-Store-DBIC-0.14000755 777777 777777 00000000214 12175020013 024030 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214657 19 SCHILY.nlink=11 Catalyst-Plugin-Session-Store-DBIC-0.14/000755 €;Ðâp€tzÕß00000000000 12175020013 023607 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/.gitignore000644 777777 777777 00000000213 12174702714 026107 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374913996 23 SCHILY.dev=16777218 22 SCHILY.ino=3911184 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/.gitignore000644 €;Ðâp€tzÕß00000000246 12174702714 025617 0ustar00tdoranAD\Domain Users000000 000000 .* !.gitignore Makefile* !Makefile.PL MYMETA.yml META.yml blib build inc pm_to_blib MANIFEST* !MANIFEST.SKIP Debian* README Catalyst-Plugin-Session-Store-DBIC-* *.bs Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/Changes000644 777777 777777 00000000213 12175017655 025416 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953457 23 SCHILY.dev=16777218 22 SCHILY.ino=4214237 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/Changes000644 €;Ðâp€tzÕß00000004722 12175017655 025131 0ustar00tdoranAD\Domain Users000000 000000 Revision history for Catalyst-Plugin-Session-Store-DBIC 0.14 Sat Jul 27 12:29:00 PST 2013 - Fix repository metadaa. RT#87249 0.13 Fri Jun 14 17:30:00 BST 2013 - Don't use %ENV for passing data structures to tests. This fixes the tests on Perl 5.18, which stringifies %ENV values immediately. RT#86148 0.12 Thu Aug 4 23:56:00 BST 2011 - Changed a test case to be less picky about the actual text captured from warnings. This was done to support some changes introduced by the Catalyst -> PSGI port. 0.11 Fri Oct 16 15:04:07 CEST 2009 - Convert to new session config key. 0.10 Tue Jul 7 13:00:27 CEST 2009 - Depend on a recent Store::Delegate for the NEXT -> MRO::Compat switch. 0.09 Wed Mar 31 16:35:52 CEST 2009 - Port from NEXT to MRO::Compat (Florian Ragwitz). - Remove tests relying on the deprecated DBIx::Class::DB (Florian Ragwitz). 0.08 Wed Nov 26 10:02:52 EST 2008 - Workaround possible errors with Storable::thaw and empty strings (thanks to kevin montuori for suggesting a fix) 0.07 Wed Sep 24 17:08:34 EDT 2008 - Code was silently truncating storage to MySQL, rendering the session unreadable. Patched to check DBIx::Class size from column_info (if available) - Wrap find_or_create calls in a transaction to (hopefully) avoid issues with duplicate flash rows 0.06 Sat Sep 16 15:42:50 EDT 2006 - Convert to Catalyst::Plugin::Session::Store::Delegate (with help from nothingmuch) 0.05 Mon Jul 31 16:58:32 EDT 2006 - Bump Catalyst::Plugin::Session dependency (tests use session_is_valid) - Fix a possible bug with passing an empty string to Storable::thaw 0.04 Sat Jul 29 23:02:27 EDT 2006 - Catalyst::Plugin::Session 0.06 saves the session expiration before the sesssion, so make sure the session row is created then - Minor cleanup to get_session_data and store_session_data methods - Use delete instead of delete_all to avoid object inflation penalty in delete_session_data and delete_expired_sessions - Use 'select' to fetch only the desired field from the database 0.03 Mon Mar 6 21:17:38 EST 2006 - Check the configuration earlier for a dbic_class value 0.02 Sat Mar 4 15:55:30 EST 2006 - Minor documentation update 0.01 Sat Mar 4 13:02:28 EST 2006 - Initial revision Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/lib000755 777777 777777 00000000213 12175020013 024575 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214666 18 SCHILY.nlink=3 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/000755 €;Ðâp€tzÕß00000000000 12175020013 024355 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/Makefile.PL000644 777777 777777 00000000213 12175017573 026074 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953482 23 SCHILY.dev=16777218 22 SCHILY.ino=4214158 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/Makefile.PL000644 €;Ðâp€tzÕß00000003366 12175017573 025612 0ustar00tdoranAD\Domain Users000000 000000 use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Catalyst::Plugin::Session::Store::DBIC', AUTHOR => 'Daniel Westermann-Clark ', VERSION_FROM => 'lib/Catalyst/Plugin/Session/Store/DBIC.pm', ABSTRACT_FROM => 'lib/Catalyst/Plugin/Session/Store/DBIC.pm', PREREQ_PM => { 'Carp' => 0, 'Catalyst' => '5.65', # For setup_finished 'Catalyst::Exception' => 0, 'Catalyst::Plugin::Session::Store::Delegate' => '0.05', 'Class::Accessor::Fast' => 0, 'DBIx::Class' => '0.07000', # For find with unique constraints 'MIME::Base64' => 0, 'MRO::Compat' => 0, 'Scalar::Util' => 0, 'Storable' => 0, 'FindBin' => 0, 'Test::More' => 0, 'Test::Warn' => '0.20', # so we get warnings_exist }, META_MERGE => { resources => { repository => 'http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Plugin-Session-Store-DBIC/', }, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Catalyst-Plugin-Session-Store-DBIC-* MANIFEST META.yml README' }, ); package MY; sub postamble { return <<"..."; cover:: cover -delete HARNESS_PERL_SWITCHES=-MDevel::Cover \$(MAKE) test cover readme:: perldoc -o text -d README \$(NAME) ... } 1; Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/MANIFEST000644 777777 777777 00000000261 12175020013 025235 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 38 LIBARCHIVE.creationtime=1374953472 23 SCHILY.dev=16777218 22 SCHILY.ino=4214680 18 SCHILY.nlink=1 Catalyst-Plugin-Session-Store-DBIC-0.14/MANIFEST000644 €;Ðâp€tzÕß00000001110 12175020013 024731 0ustar00tdoranAD\Domain Users000000 000000 .gitignore Changes lib/Catalyst/Plugin/Session/Store/DBIC.pm lib/Catalyst/Plugin/Session/Store/DBIC/Delegate.pm Makefile.PL MANIFEST This list of files MYMETA.json t/01use.t t/02pod.t t/03podcoverage.t t/05dbic-schema.t t/lib/SetupDB.pm t/lib/TestApp.pm t/lib/TestApp/Controller/Flash.pm t/lib/TestApp/Controller/Session.pm t/lib/TestApp/Model/DBICSchema.pm t/lib/TestApp/Schema.pm t/lib/TestApp/Schema/Session.pm META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/META.json000644 777777 777777 00000000213 12175020013 025522 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214689 18 SCHILY.nlink=1 Catalyst-Plugin-Session-Store-DBIC-0.14/META.json000644 €;Ðâp€tzÕß00000002755 12175020013 025241 0ustar00tdoranAD\Domain Users000000 000000 { "abstract" : "Store your sessions via DBIx::Class", "author" : [ "Daniel Westermann-Clark " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.131560", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Catalyst-Plugin-Session-Store-DBIC", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Carp" : "0", "Catalyst" : "5.65", "Catalyst::Exception" : "0", "Catalyst::Plugin::Session::Store::Delegate" : "0.05", "Class::Accessor::Fast" : "0", "DBIx::Class" : "0.07000", "FindBin" : "0", "MIME::Base64" : "0", "MRO::Compat" : "0", "Scalar::Util" : "0", "Storable" : "0", "Test::More" : "0", "Test::Warn" : "0.20" } } }, "release_status" : "stable", "resources" : { "repository" : { "url" : "http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Plugin-Session-Store-DBIC/" } }, "version" : "0.14" } Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/META.yml000644 777777 777777 00000000213 12175020013 025352 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214688 18 SCHILY.nlink=1 Catalyst-Plugin-Session-Store-DBIC-0.14/META.yml000644 €;Ðâp€tzÕß00000001571 12175020013 025064 0ustar00tdoranAD\Domain Users000000 000000 --- abstract: 'Store your sessions via DBIx::Class' author: - 'Daniel Westermann-Clark ' build_requires: ExtUtils::MakeMaker: 0 configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.131560' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 name: Catalyst-Plugin-Session-Store-DBIC no_index: directory: - t - inc requires: Carp: 0 Catalyst: 5.65 Catalyst::Exception: 0 Catalyst::Plugin::Session::Store::Delegate: 0.05 Class::Accessor::Fast: 0 DBIx::Class: 0.07000 FindBin: 0 MIME::Base64: 0 MRO::Compat: 0 Scalar::Util: 0 Storable: 0 Test::More: 0 Test::Warn: 0.20 resources: repository: http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Plugin-Session-Store-DBIC/ version: 0.14 Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/MYMETA.json000644 777777 777777 00000000261 12175020012 025772 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953444 38 LIBARCHIVE.creationtime=1374953444 23 SCHILY.dev=16777218 22 SCHILY.ino=4214484 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/MYMETA.json000644 €;Ðâp€tzÕß00000002755 12175020012 025506 0ustar00tdoranAD\Domain Users000000 000000 { "abstract" : "Store your sessions via DBIx::Class", "author" : [ "Daniel Westermann-Clark " ], "dynamic_config" : 0, "generated_by" : "ExtUtils::MakeMaker version 6.68, CPAN::Meta::Converter version 2.131560", "license" : [ "unknown" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Catalyst-Plugin-Session-Store-DBIC", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Carp" : "0", "Catalyst" : "5.65", "Catalyst::Exception" : "0", "Catalyst::Plugin::Session::Store::Delegate" : "0.05", "Class::Accessor::Fast" : "0", "DBIx::Class" : "0.07000", "FindBin" : "0", "MIME::Base64" : "0", "MRO::Compat" : "0", "Scalar::Util" : "0", "Storable" : "0", "Test::More" : "0", "Test::Warn" : "0.20" } } }, "release_status" : "stable", "resources" : { "repository" : { "url" : "http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Plugin-Session-Store-DBIC/" } }, "version" : "0.14" } Catalyst-Plugin-Session-Store-DBIC-0.14/PaxHeader/t000755 777777 777777 00000000213 12175020013 024272 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214659 18 SCHILY.nlink=7 Catalyst-Plugin-Session-Store-DBIC-0.14/t/000755 €;Ðâp€tzÕß00000000000 12175020013 024052 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/t/PaxHeader/01use.t000644 777777 777777 00000000213 12174702714 025504 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=3911064 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/01use.t000644 €;Ðâp€tzÕß00000000116 12174702714 025210 0ustar00tdoranAD\Domain Users000000 000000 use Test::More tests => 1; use_ok('Catalyst::Plugin::Session::Store::DBIC'); Catalyst-Plugin-Session-Store-DBIC-0.14/t/PaxHeader/02pod.t000644 777777 777777 00000000213 12174702714 025473 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=3911066 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/02pod.t000644 €;Ðâp€tzÕß00000000276 12174702714 025206 0ustar00tdoranAD\Domain Users000000 000000 use Test::More; eval "use Test::Pod 1.14"; plan skip_all => 'Test::Pod 1.14 required' if $@; plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; all_pod_files_ok(); Catalyst-Plugin-Session-Store-DBIC-0.14/t/PaxHeader/03podcoverage.t000644 777777 777777 00000000213 12174702714 027210 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=3911065 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/03podcoverage.t000644 €;Ðâp€tzÕß00000000325 12174702714 026716 0ustar00tdoranAD\Domain Users000000 000000 use Test::More; eval "use Test::Pod::Coverage 1.04"; plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; all_pod_coverage_ok(); Catalyst-Plugin-Session-Store-DBIC-0.14/t/PaxHeader/05dbic-schema.t000644 777777 777777 00000000213 12174702714 027053 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=3911067 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/05dbic-schema.t000644 €;Ðâp€tzÕß00000005041 12174702714 026561 0ustar00tdoranAD\Domain Users000000 000000 #!perl use strict; use warnings; use FindBin; use Test::More; use Test::Warn; use lib "$FindBin::Bin/lib"; BEGIN { eval { require DBD::SQLite } or plan skip_all => "DBD::SQLite is required for this test"; eval { require Catalyst::Plugin::Session::State::Cookie } or plan skip_all => "Catalyst::Plugin::Session::State::Cookie is required for this test"; eval { require Test::WWW::Mechanize::Catalyst } or plan skip_all => "Test::WWW::Mechanize::Catalyst is required for this test"; eval { require Catalyst::Model::DBIC::Schema } or plan skip_all => "Catalyst::Model::DBIC::Schema is required for this test"; plan tests => 14; $TestApp::DB_FILE = "$FindBin::Bin/session.db"; $TestApp::CONFIG = { name => 'TestApp', session => { dbic_class => 'DBICSchema::Session', data_field => 'data', }, }; $TestApp::PLUGINS = [qw/ Session Session::State::Cookie Session::Store::DBIC /]; } use SetupDB; use Test::WWW::Mechanize::Catalyst 'TestApp'; my $mech = Test::WWW::Mechanize::Catalyst->new; my $key = 'schema'; my $value = scalar localtime; # Setup session $mech->get_ok("http://localhost/session/setup?key=$key&value=$value", 'request to set session value'); $mech->content_is('ok', 'set session value'); # Setup flash $mech->get_ok("http://localhost/flash/setup?key=$key&value=$value", 'request to set flash value'); $mech->content_is('ok', 'set session value'); # Check flash $mech->get_ok("http://localhost/flash/output?key=$key", 'request to get flash value'); $mech->content_is($value, 'got session value back'); # Check session $mech->get_ok("http://localhost/session/output?key=$key", 'request to get session value'); $mech->content_is($value, 'got session value back'); # Exceed our session storage capactity $value = "blah" x 200; warnings_exist { $mech->get_ok("http://localhost/session/setup?key=$key&value=$value", 'exceeding storage capacity'); } qr/This session requires \d+ bytes of storage, but your database column 'data' can only store 200 bytes. Storing this session may not be reliable; increase the size of your data field/, 'warning thrown as expected'; # Delete session $mech->get_ok('http://localhost/session/delete', 'request to delete session'); $mech->content_is('ok', 'deleted session'); # Delete expired sessions $mech->get_ok('http://localhost/session/delete_expired', 'request to delete expired sessions'); $mech->content_is('ok', 'deleted expired sessions'); # Clean up unlink $TestApp::DB_FILE; Catalyst-Plugin-Session-Store-DBIC-0.14/t/PaxHeader/lib000755 777777 777777 00000000213 12175020013 025040 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214660 18 SCHILY.nlink=5 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/000755 €;Ðâp€tzÕß00000000000 12175020013 024620 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/PaxHeader/SetupDB.pm000644 777777 777777 00000000213 12174702714 026774 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374913996 23 SCHILY.dev=16777218 22 SCHILY.ino=3911058 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/SetupDB.pm000644 €;Ðâp€tzÕß00000000607 12174702714 026505 0ustar00tdoranAD\Domain Users000000 000000 package SetupDB; use strict; use warnings; # Create the database my $db_file = $TestApp::DB_FILE; unlink $db_file if -e $db_file; my $dbh = DBI->connect("dbi:SQLite:$db_file") or die $DBI::errstr; my $sql = q{ CREATE TABLE sessions ( id CHAR(72) PRIMARY KEY, data TEXT, expires INTEGER ); }; $dbh->do($_) for split /;/, $sql; $dbh->disconnect; 1; Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/PaxHeader/TestApp000755 777777 777777 00000000213 12175020013 026420 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214661 18 SCHILY.nlink=6 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/000755 €;Ðâp€tzÕß00000000000 12175020013 026200 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/PaxHeader/TestApp.pm000644 777777 777777 00000000213 12174702714 027046 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374913996 23 SCHILY.dev=16777218 22 SCHILY.ino=3911059 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp.pm000644 €;Ðâp€tzÕß00000000222 12174702714 026550 0ustar00tdoranAD\Domain Users000000 000000 package TestApp; use strict; use warnings; use Catalyst; __PACKAGE__->config($TestApp::CONFIG); __PACKAGE__->setup(@{ $TestApp::PLUGINS }); 1; Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/PaxHeader/Controller000755 777777 777777 00000000213 12175020013 030543 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214662 18 SCHILY.nlink=4 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Controller/000755 €;Ðâp€tzÕß00000000000 12175020013 030323 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/PaxHeader/Model000755 777777 777777 00000000213 12175020013 027460 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214677 18 SCHILY.nlink=3 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Model/000755 €;Ðâp€tzÕß00000000000 12175020013 027240 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/PaxHeader/Schema000755 777777 777777 00000000213 12175020013 027620 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214685 18 SCHILY.nlink=3 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Schema/000755 €;Ðâp€tzÕß00000000000 12175020013 027400 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/PaxHeader/Schema.pm000644 777777 777777 00000000213 12174702714 030246 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374913996 23 SCHILY.dev=16777218 22 SCHILY.ino=3911051 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Schema.pm000644 €;Ðâp€tzÕß00000000201 12174702714 027745 0ustar00tdoranAD\Domain Users000000 000000 package TestApp::Schema; use strict; use warnings; use base qw/DBIx::Class::Schema/; __PACKAGE__->load_classes('Session'); 1; Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Schema/PaxHeader/Session.pm000644 777777 777777 00000000213 12174702714 031671 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374913996 23 SCHILY.dev=16777218 22 SCHILY.ino=3911024 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Schema/Session.pm000644 €;Ðâp€tzÕß00000000473 12174702714 031403 0ustar00tdoranAD\Domain Users000000 000000 package TestApp::Schema::Session; use strict; use warnings; use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/Core/); __PACKAGE__->table('sessions'); __PACKAGE__->add_columns( id => { }, data => { size => 200, }, expires => { }, ); __PACKAGE__->set_primary_key('id'); 1; Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Model/PaxHeader/DBICSchema.pm000644 777777 777777 00000000213 12174702714 031730 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953482 23 SCHILY.dev=16777218 22 SCHILY.ino=3911005 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Model/DBICSchema.pm000644 €;Ðâp€tzÕß00000000602 12174702714 031434 0ustar00tdoranAD\Domain Users000000 000000 package TestApp::Model::DBICSchema; eval { require Catalyst::Model::DBIC::Schema }; return 1 if $@; @ISA = qw/Catalyst::Model::DBIC::Schema/; use strict; use warnings; our $db_file = $TestApp::DB_FILE; __PACKAGE__->config( schema_class => 'TestApp::Schema', connect_info => [ "dbi:SQLite:$db_file", '', '', { AutoCommit => 1 }, ], ); 1; Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Controller/PaxHeader/Flash.pm000644 777777 777777 00000000213 12174702714 032226 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374913996 23 SCHILY.dev=16777218 22 SCHILY.ino=3911044 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Controller/Flash.pm000644 €;Ðâp€tzÕß00000000670 12174702714 031737 0ustar00tdoranAD\Domain Users000000 000000 package TestApp::Controller::Flash; use strict; use warnings; use base qw/Catalyst::Controller/; sub setup : Local { my ($self, $c) = @_; my $key = $c->req->param('key') || 'key'; my $value = $c->req->param('value') || 1; $c->flash->{$key} = $value; $c->res->body('ok'); } sub output : Local { my ($self, $c) = @_; my $key = $c->req->param('key') || 'key'; $c->res->body($c->flash->{$key}); } 1; Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Controller/PaxHeader/Session.pm000644 777777 777777 00000000213 12174702714 032614 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374913996 23 SCHILY.dev=16777218 22 SCHILY.ino=3911045 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/t/lib/TestApp/Controller/Session.pm000644 €;Ðâp€tzÕß00000001267 12174702714 032330 0ustar00tdoranAD\Domain Users000000 000000 package TestApp::Controller::Session; use strict; use warnings; use base qw/Catalyst::Controller/; sub setup : Local { my ($self, $c) = @_; my $key = $c->req->param('key') || 'key'; my $value = $c->req->param('value') || 1; $c->session->{$key} = $value; $c->res->body('ok'); } sub output : Local { my ($self, $c) = @_; my $key = $c->req->param('key') || 'key'; $c->res->body($c->session->{$key}); } sub delete : Local { my ($self, $c) = @_; $c->delete_session; $c->res->body($c->session_is_valid ? 'not ok' : 'ok'); } sub delete_expired : Local { my ($self, $c) = @_; $c->delete_expired_sessions; $c->res->body('ok'); } 1; Catalyst-Plugin-Session-Store-DBIC-0.14/lib/PaxHeader/Catalyst000755 777777 777777 00000000213 12175020013 026361 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214667 18 SCHILY.nlink=3 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/000755 €;Ðâp€tzÕß00000000000 12175020013 026141 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/PaxHeader/Plugin000755 777777 777777 00000000213 12175020013 027617 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214668 18 SCHILY.nlink=3 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/000755 €;Ðâp€tzÕß00000000000 12175020013 027377 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/PaxHeader/Session000755 777777 777777 00000000213 12175020013 031242 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214669 18 SCHILY.nlink=3 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/000755 €;Ðâp€tzÕß00000000000 12175020013 031022 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/PaxHeader/Store000755 777777 777777 00000000213 12175020013 032336 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214670 18 SCHILY.nlink=4 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/Store/000755 €;Ðâp€tzÕß00000000000 12175020013 032116 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/Store/PaxHeader/DBIC000755 777777 777777 00000000213 12175020013 033037 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953483 23 SCHILY.dev=16777218 22 SCHILY.ino=4214673 18 SCHILY.nlink=3 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/Store/DBIC/000755 €;Ðâp€tzÕß00000000000 12175020013 032617 5ustar00tdoranAD\Domain Users000000 000000 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/Store/PaxHeader/DBIC.pm000644 777777 777777 00000000213 12175017732 033465 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953482 23 SCHILY.dev=16777218 22 SCHILY.ino=4214478 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/Store/DBIC.pm000644 €;Ðâp€tzÕß00000022106 12175017732 033174 0ustar00tdoranAD\Domain Users000000 000000 package Catalyst::Plugin::Session::Store::DBIC; use strict; use warnings; use base qw/Catalyst::Plugin::Session::Store::Delegate/; use Catalyst::Exception; use Catalyst::Plugin::Session::Store::DBIC::Delegate; use MIME::Base64 (); use MRO::Compat; use Storable (); our $VERSION = '0.14'; =head1 NAME Catalyst::Plugin::Session::Store::DBIC - Store your sessions via DBIx::Class =head1 SYNOPSIS # Create a table in your database for sessions CREATE TABLE sessions ( id CHAR(72) PRIMARY KEY, session_data TEXT, expires INTEGER ); # Create the corresponding table class package MyApp::Schema::Session; use base qw/DBIx::Class/; __PACKAGE__->load_components(qw/Core/); __PACKAGE__->table('sessions'); __PACKAGE__->add_columns(qw/id session_data expires/); __PACKAGE__->set_primary_key('id'); 1; # In your application use Catalyst qw/Session Session::Store::DBIC Session::State::Cookie/; __PACKAGE__->config( # ... other items ... 'Plugin::Session' => { dbic_class => 'DBIC::Session', # Assuming MyApp::Model::DBIC expires => 3600, }, ); # Later, in a controller action $c->session->{foo} = 'bar'; =head1 DESCRIPTION This L storage module saves session data in your database via L. It's actually just a wrapper around L; if you need complete control over how your sessions are stored, you probably want to use that instead. =head1 METHODS =head2 setup_finished Hook into the configured session class. =cut sub setup_finished { my $c = shift; return $c->next::method unless @_; # Try to determine id_field if it isn't set unless ($c->_session_plugin_config->{id_field}) { my $model = $c->session_store_model; my $rs = ref $model ? $model : $model->can('resultset_instance') ? $model->resultset_instance : $model; my @primary_columns = $rs->result_source->primary_columns; Catalyst::Exception->throw( message => __PACKAGE__ . qq/: Primary key consists of more than one column; please set id_field manually/ ) if @primary_columns > 1; $c->_session_plugin_config->{id_field} = $primary_columns[0]; } $c->next::method(@_); } =head2 session_store_dbic_class Return the L class name to be passed to C<< $c->model >>. Defaults to C. =cut sub session_store_dbic_class { shift->_session_plugin_config->{dbic_class} || 'DBIC::Session'; } =head2 session_store_dbic_id_field Return the configured ID field name. Defaults to C. =cut sub session_store_dbic_id_field { shift->_session_plugin_config->{id_field} || 'id'; } =head2 session_store_dbic_data_field Return the configured data field name. Defaults to C. =cut sub session_store_dbic_data_field { shift->_session_plugin_config->{data_field} || 'session_data'; } =head2 session_store_dbic_expires_field Return the configured expires field name. Defaults to C. =cut sub session_store_dbic_expires_field { shift->_session_plugin_config->{expires_field} || 'expires'; } =head2 session_store_model Return the model used to find a session. =cut sub session_store_model { my ($c, $id) = @_; my $dbic_class = $c->session_store_dbic_class; $c->model($dbic_class, $id) or die "Couldn't find a model named $dbic_class"; } =head2 get_session_store_delegate Load the row corresponding to the specified session ID. If none is found, one is automatically created. =cut sub get_session_store_delegate { my ($c, $id) = @_; Catalyst::Plugin::Session::Store::DBIC::Delegate->new({ model => $c->session_store_model($id), id_field => $c->session_store_dbic_id_field, data_field => $c->session_store_dbic_data_field, }); } =head2 session_store_delegate_key_to_accessor Match the specified key and operation to the session ID and field name. =cut sub session_store_delegate_key_to_accessor { my $c = shift; my $key = $_[0]; my ($field, @args) = $c->next::method(@_); my ($type) = ($key =~ /^(\w+):/); $field = $c->session_store_dbic_id_field if $field eq 'id'; $field = $c->session_store_dbic_expires_field if $field eq 'expires'; $field = $c->session_store_dbic_data_field if $field eq 'session' or $field eq 'flash'; my $accessor = sub { shift->$type($key)->$field(@_) }; if ($field eq $c->session_store_dbic_data_field) { @args = map { MIME::Base64::encode(Storable::nfreeze($_ || '')) } @args; $accessor = sub { my $value = shift->$type($key)->$field(@_); return unless $value; return Storable::thaw(MIME::Base64::decode($value)); }; } return ($accessor, @args); } =head2 delete_session_data Delete the specified session from the backend store. =cut sub delete_session_data { my ($c, $key) = @_; # expires is stored on the session row for compatibility with Store::DBI return if $key =~ /^expires/; $c->session_store_model->search({ $c->session_store_dbic_id_field => $key, })->delete; } =head2 delete_expired_sessions Delete all expired sessions. =cut sub delete_expired_sessions { my $c = shift; $c->session_store_model->search({ $c->session_store_dbic_expires_field => { '<', time() }, })->delete; } =head1 CONFIGURATION The following parameters should be placed in your application configuration under the C key. =head2 dbic_class (Required) The name of the L that represents a session in the database. It is recommended that you provide only the part after C, e.g. C. If you are using L, the following layout is recommended: =over 4 =item * C - your L class =item * C - your session table class =item * C - your L class =back This module will then use C<< $c->model >> to access the appropriate result source from the composed schema matching the C name. For more information, please see L. =head2 expires Number of seconds for which sessions are active. Note that no automatic cleanup is done on your session data. To delete expired sessions, you can use the L method with L. =head2 id_field The name of the field on your sessions table which stores the session ID. Defaults to C. =head2 data_field The name of the field on your sessions table which stores session data. Defaults to C for compatibility with L. =head2 expires_field The name of the field on your sessions table which stores the expiration time of the session. Defaults to C. =head1 SCHEMA Your sessions table should contain the following columns: id CHAR(72) PRIMARY KEY session_data TEXT expires INTEGER The C column should probably be 72 characters. It needs to handle the longest string that can be returned by L, plus another eight characters for internal use. This is less than 72 characters when SHA-1 or MD5 is used, but SHA-256 will need all 72 characters. The C column should be a long text field. Session data is encoded using L before being stored in the database. Note that MySQL C fields only store 64 kB, so if your session data will exceed that size you'll want to use C, C, or larger. If you configure your L to include the size of the column, you will receive warnings for this problem: This session requires 1180 bytes of storage, but your database column 'session_data' can only store 200 bytes. Storing this session may not be reliable; increase the size of your data field See L for more information. The C column stores the future expiration time of the session. This may be null for per-user and flash sessions. Note that you can change the column names using the L, L, and L configuration parameters. However, the column types must match the above. =head1 AUTHOR Daniel Westermann-Clark Edanieltwc@cpan.orgE =head1 ACKNOWLEDGMENTS =over 4 =item * Andy Grundman, for L =item * David Kamholz, for most of the testing code (from L) =item * Yuval Kogman, for assistance in converting to L =item * Jay Hannah, for tests and warning when session size exceeds DBIx::Class storage size. =back =head1 COPYRIGHT Copyright (c) 2006 - 2009 the Catalyst::Plugin::Session::Store::DBIC L as listed above. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1; Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/Store/DBIC/PaxHeader/Delegate.pm000644 777777 777777 00000000213 12174702714 035177 xustar00tdoranAD\Domain Users000000 000000 18 gid=1954207199 18 uid=1003545200 20 ctime=1374953483 20 atime=1374953482 23 SCHILY.dev=16777218 22 SCHILY.ino=3911153 18 SCHILY.nlink=2 Catalyst-Plugin-Session-Store-DBIC-0.14/lib/Catalyst/Plugin/Session/Store/DBIC/Delegate.pm000644 €;Ðâp€tzÕß00000006335 12174702714 034714 0ustar00tdoranAD\Domain Users000000 000000 package Catalyst::Plugin::Session::Store::DBIC::Delegate; use strict; use warnings; use base qw/Class::Accessor::Fast/; use Carp qw/carp/; use Scalar::Util qw/blessed/; __PACKAGE__->mk_accessors(qw/model id_field data_field _session_row _flash_row/); =head1 NAME Catalyst::Plugin::Session::Store::DBIC::Delegate - Delegates between the session and flash rows =head1 DESCRIPTION This class delegates between two rows in your sessions table for a given session (session and flash). This is done for compatibility with L. =head1 METHODS =head2 session Return the session row for this delegate. =cut sub session { my ($self, $key) = @_; my $row = $self->_session_row; unless ($row) { $row = $self->_load_row($key); $self->_session_row($row); } return $row; } =head2 flash Return the flash row for this delegate. =cut sub flash { my ($self, $key) = @_; my $row = $self->_flash_row; unless ($row) { $row = $self->_load_row($key); $self->_flash_row($row); } return $row; } =head2 _load_row Load the specified session or flash row from the database. This is a wrapper around L to add support for transactions. =cut sub _load_row { my ($self, $key) = @_; my $load_sub = sub { return $self->model->find_or_create({ $self->id_field => $key }) }; my $row; if (blessed $self->model and $self->model->can('result_source')) { $row = $self->model->result_source->schema->txn_do($load_sub); } else { # Fallback for DBIx::Class::DB $row = $load_sub->(); } return $row; } =head2 expires Return the expires row for this delegate. As with L, this maps to the L row. =cut sub expires { my ($self, $key) = @_; $key =~ s/^expires/session/; $self->session($key); } =head2 flush Update the session and flash data in the backend store. =cut sub flush { my ($self) = @_; for (qw/_session_row _flash_row/) { my $row = $self->$_; next unless $row; # Check the size if available to avoid silent trucation on e.g. MySQL my $data_field = $self->data_field; if (my $size = $row->result_source->column_info($data_field)->{size}) { my $total_size = length($row->$data_field); carp "This session requires $total_size bytes of storage, but your database column '$data_field' can only store $size bytes. Storing this session may not be reliable; increase the size of your data field" if $total_size > $size; } $row->update if $row->in_storage; } $self->_clear_instance_data; } =head2 _clear_instance_data Remove any references held by the delegate. =cut sub _clear_instance_data { my ($self) = @_; $self->id_field(undef); $self->model(undef); $self->_session_row(undef); $self->_flash_row(undef); } =head1 AUTHOR Daniel Westermann-Clark Edanieltwc@cpan.orgE =head1 COPYRIGHT Copyright 2006-2008 Daniel Westermann-Clark, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut 1;