File Coverage

lib/Plack/App/WebMySQL.pm
Criterion Covered Total %
statement 29 37 78.3
branch n/a
condition n/a
subroutine 10 10 100.0
pod 0 1 0.0
total 39 48 81.2


line stmt bran cond sub pod time code
1             #the dumb terminal webmysql module
2             #mt 16/11/2003 2.4 moved version into this module
3             package Plack::App::WebMySQL;
4 2     2   13520 use strict;
  2         2  
  2         43  
5 2     2   6 use warnings;
  2         2  
  2         33  
6 2     2   753 use CGI::Compile;
  2         34982  
  2         45  
7 2     2   727 use CGI::Emulate::PSGI;
  2         53486  
  2         51  
8 2     2   801 use Plack::Builder;
  2         13112  
  2         116  
9 2     2   1039 use Plack::App::MCCS;
  2         39739  
  2         56  
10 2     2   10 use Exporter();
  2         4  
  2         30  
11 2     2   1060 use File::Share ':all';
  2         10780  
  2         278  
12 2     2   13 use File::Spec;
  2         2  
  2         280  
13             our %form; #data from the previous page
14             our $error = ""; #error flag
15             our $VERSION ="3.02"; #version of this software
16             our @ISA = qw(Exporter);
17             our @EXPORT = qw(%form $error $VERSION);
18             ###############################################################################
19             sub new{
20 1     1 0 114 my $script = dist_file('Plack-App-WebMySQL', 'cgi-bin/webmysql/webmysql.cgi');
21 1         111 my $sub = CGI::Compile->compile($script);
22 0           my $app = CGI::Emulate::PSGI->handler($sub);
23              
24 0           my $staticDir = dist_dir('Plack-App-WebMySQL');
25 0           $staticDir = File::Spec->catdir($staticDir, 'htdocs');
26 0           my $staticApp = Plack::App::MCCS->new(root => $staticDir)->to_app;
27            
28 0           my $builder = Plack::Builder->new();
29 0           $builder->mount("/app" => $app);
30 0           $builder->mount("/" => $staticApp);
31 0           return $builder;
32             }
33             ###############################################################################
34             return 1;