Trustee - An persistance storage specialized on objects
use class::examples::User; use Object::Bouncer; use Data::Dumper; # not visible, but default tiewith is Apache::Session::MySQL my $schatzmeister = new Object::Trustee(); # here an alternative my $schatzmeister = new Object::Trustee( tiewith => 'Apache::Session::File', args => { Directory => 'c:/temp/sessiondata', LockDirectory => 'c:/temp/sessiondata/locks' } ); print 'Session-ID: ', $schatzmeister->id, "\n\n"; my %gruppe = ( toni => new User( firstname => 'toni', email => 'toni@wrong' ), eva => new User( firstname => 'eva', email => 'eva@any.de' ), maren => new User( firstname => 'maren' ) ); print "\n", 'Users:'; print Dumper \%gruppe; $schatzmeister->store( %gruppe ); # bouncer let filled email fields in.... my $emailtester = new Object::Bouncer( ); $emailtester->addtest( new Object::Bouncer::Test( field => 'email', type => 'true' ), ); my $list = $schatzmeister->retrieve( $emailtester ); # now, bouncer only leaves <valid> emails in... print "\n\nUsers with email field filled:"; my $emailchecker = new Object::Bouncer( ); $emailchecker->addtest( new Object::Bouncer::Test( field => 'email', type => 'email' ), ); print Dumper $list; my $list = $schatzmeister->retrieve( $emailchecker ); print "\n\nUsers with valid email:"; print Dumper $list;
A Trustee keeps files for other people about other people. This files can be modified / requested. On the backend the trustee object uses Apache::Sesssion tied hashes. Object::Bouncer's objects are utilized when retrieving selectivly (i.e.filtering).
None by default.
- Apache::Session::* to keep state. - Object::Bouncer to retrieve selectivly
Murat Uenalan, murat.uenalan@gmx.de
Verify, perl
To install Auth, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Auth
CPAN shell
perl -MCPAN -e shell install Auth
For more information on module installation, please visit the detailed CPAN module installation guide.