Apache2-Controller
view release on metacpan or search on metacpan
lib/Apache2/Controller/Dispatch.pm view on Meta::CPAN
=head1 WHY A MAP?
Natively, this does not try to figure out the appropriate
module using any complex magic. Instead, you spell out the
uris under the handler location and what controller
modules you want to handle paths under that URL, using a
directive. (L<Apache2::Controller::Directives/A2C_Dispatch_Map>)
The trouble with automatic controller module detectors is
that parsing the URI and doing C<< eval "use lib $blah" >>
up through the URI path is that is computationally expensive.
Maintaining a URI map file is not that difficult and also is
convenient because you can move libraries around, point different
URI's to the same controller library, etc. For example to bring
part of your site off-line and see 'under construction', create
a controller to print the right message, change all the uri's
in the map and bump the server.
(Can I trap a signal so it
t/00-load.t view on Meta::CPAN
use English '-no_match_vars';
my %untestable = map {($_ => 1)} qw(
Apache2::Controller::Directives
Apache2::Controller::Test::Funk
);
use Test::More;
use blib;
my $test_libdir = File::Spec->catfile($FindBin::Bin, 'lib');
eval "use lib '$test_libdir'";
die $EVAL_ERROR if $EVAL_ERROR;
use FindBin;
use File::Find;
use File::Spec;
use YAML::Syck;
my $a2c_libdir = File::Spec->catfile($FindBin::Bin, '..', 'blib', 'lib');
my @libs;
my $wanted = sub {
my $libsubpath = $File::Find::name;
use strict;
use warnings FATAL => 'all';
use FindBin;
use YAML::Syck;
use blib;
use lib "$FindBin::Bin/lib";
use Apache2::Controller::Test::TestRun ();
Apache2::Controller::Test::TestRun->new->run(@ARGV);
use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest 'GET_BODY';
use FindBin;
use lib "$FindBin::Bin/lib";
use Apache2::Controller::Test::Funk qw( diag );
plan tests => 5;
ok 1; # simple load test
my $url = "/simple";
my $data = GET_BODY $url;
t/dbi_connector.t view on Meta::CPAN
use strict;
use warnings FATAL => 'all';
use English '-no_match_vars';
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw( GET_BODY GET_STR );
use FindBin;
use lib "$FindBin::Bin/lib";
use Apache2::Controller::Test::Funk;
use YAML::Syck;
use URI::Escape;
Apache::TestRequest::user_agent(cookie_jar => {});
my @tests = (
working => 'TestApp::DBI::Controller is working.',
handle_available => 'DBI::db is dbh class',
select_1 => 'Query (select 1) works.',
use strict;
use warnings FATAL => 'all';
use English '-no_match_vars';
use FindBin;
use lib "$FindBin::Bin/lib";
use Test::More tests => 1;
SKIP: {
skip 'skip all-- openid does not work for this bugfix release', 1;
ok( 1 == 1, 'foo' );
exit;
}
__END__
use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw( GET_BODY GET_STR );
use FindBin;
use lib "$FindBin::Bin/lib";
use Apache2::Controller::Test::Funk qw( diag );
use YAML::Syck;
plan tests => 5;
my $url = "/render";
diag("GET_BODY $url");
my $data = GET_BODY $url;
t/session.t view on Meta::CPAN
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest qw( GET_BODY GET_STR GET_HEAD );
use FindBin;
use Apache2::Const -compile => qw(
HTTP_OK
);
use lib "$FindBin::Bin/lib";
use Apache2::Controller::Test::Funk qw( diag );
use YAML::Syck;
use URI::Escape;
my $cookie_name = 'testapp_sessid';
my $cookie_path = '/session';
my @CHARS = ('A'..'Z', 'a'..'z', 0 .. 9);
my %TD = (
foo => {
t/unit_dispatch_hashtree.t view on Meta::CPAN
=cut
package main;
use strict;
use warnings;
use English '-no_match_vars';
use Log::Log4perl qw(:easy);
use FindBin;
use lib "$FindBin::Bin/lib";
use Test::More qw( no_plan );
use YAML::Syck;
use Apache2::Controller::Test::Mockr;
use Apache2::Controller::X;
my $tests = Load(q{
foo:
( run in 0.456 second using v1.01-cache-2.11-cpan-87723dcf8b7 )