| Authen-Quiz documentation | Contained in the Authen-Quiz distribution. |
Authen::Quiz::FW - Framework for Authen::Quiz.
use Authen::Quiz::FW qw/ JS Memcached /;
my $q= Authen::Quiz::FW->new(
data_folder => '/path/to/authen_quiz',
memcached => { ...... },
);
my $js_source= $q->question2js('boxid');
The framework for Authen::Quiz makes the plugin available.
If use passes the list of the plugin at the time of reading Authen::Quiz::FW, it becomes available.
use Authen::Quiz::FW qw/ JS Memcached /;
Authen::Quiz::Plugin::JS and Authen::Quiz::Plugin::Memcached was enclosed as a standard plugin.
The list of the read plug-in is returned.
Masatoshi Mizuno <lushe&64;cpan.org>
Copyright (C) 2008 by Bee Flag, Corp. <http://egg.bomcity.com/>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
| Authen-Quiz documentation | Contained in the Authen-Quiz distribution. |
package Authen::Quiz::FW; # # Masatoshi Mizuno E<lt>lusheE<64>cpan.orgE<gt> # # $Id: FW.pm 362 2008-08-18 18:34:11Z lushe $ # use strict; use warnings; use Class::C3; use UNIVERSAL::require; use Authen::Quiz; our $VERSION= '0.01'; our @ISA; my @plugins; sub plugins { \@plugins } sub import { my $class= shift; for (@_) { my $pkg= /^\+(.+)/ ? $1: "Authen::Quiz::Plugin::$_"; push @plugins, $pkg; push @ISA, $pkg; } push @ISA, 'Authen::Quiz'; push @ISA, 'Authen::Quiz::FW::Base'; for my $load (@plugins) { $load->require || die __PACKAGE__. " - $@" } $class->_setup; } package Authen::Quiz::FW::Base; use strict; sub _setup { @_ } 1; __END__