Apache-ASP

 view release on metacpan or  search on metacpan

ASP.pm  view on Meta::CPAN

    # directory will become one of the fundamental underpinings of the project
    # People will need to rely on being able to load shared includes, and not have
    # to discover the lack of loading Share:: at runtime, rather this is a compile
    # time error.
    -d $share_path || die("Apache::ASP::Share directory not found.  ".
			  "Please make sure to install all the modules that make up the Apache::ASP installation."
			 );
    $ShareDir = $share_path;

    # once we find the $ShareDir, we can truncate the library path
    # and push it onto @INC with use lib... this is to help with loading
    # future Apache::ASP::* modules when the lib path it was found at is 
    # relative to some directory.  This was needed to have the "make test"
    # test suite to work which loads libraries from "blib/lib", but Apache::ASP
    # will chdir() into the script directory so that can ruin this
    # library lookup.
    #
    my $lib_path = $share_path;
    $lib_path =~ s/Apache.ASP.Share.?$//s;
    -d $lib_path || die("\%INC library path $lib_path not found.");
    $INCDir = $lib_path;
    
    # clear taint, for some reason, tr/// or s/^(.*)$/ did not work on perl 5.6.1
    $INCDir =~ /^(.*)$/s;
    $INCDir = $1;

    # make sure this gets on @INC at startup, can't hurt
    eval "use lib qw($INCDir);";

    1;
}

sub FileId {
    my($self, $file, $abs_file, $no_compile_checksum) = @_;
    $file || die("no file passed to FileId()");
    my $id;

    # calculate compile checksum for file id

ASP.pm  view on Meta::CPAN

  Script: index.asp
  $Server->Config('PATH') eq '/SomeCategory'

 INPUT URI /index.asp
 OUTPUT
  Script: index.asp
  $Server->Config('PATH') eq ''

 # httpd.conf
 PerlTransHandler My::Init
 use lib qw( $custom_perllib );

 # $custom_perllib/My/Init.pm
 package My::Init;
 use strict;
 use Apache::Constants qw(:common);
 sub handler {
    my $r = shift;

    my $uri = $r->uri || '/';
    unless($uri =~ m|^(.*)(/([^/.]+\.[\w]+)?)$|i) {

README  view on Meta::CPAN

      Script: index.asp
      $Server->Config('PATH') eq '/SomeCategory'

     INPUT URI /index.asp
     OUTPUT
      Script: index.asp
      $Server->Config('PATH') eq ''

     # httpd.conf
     PerlTransHandler My::Init
     use lib qw( $custom_perllib );

     # $custom_perllib/My/Init.pm
     package My::Init;
     use strict;
     use Apache::Constants qw(:common);
     sub handler {
        my $r = shift;

        my $uri = $r->uri || '/';
        unless($uri =~ m|^(.*)(/([^/.]+\.[\w]+)?)$|i) {

lib/Apache/ASP/GlobalASA.pm  view on Meta::CPAN


    if($code =~ s/\<script[^>]*\>((.*)\s+sub\s+($match_events).*)\<\/script\>/$1/isg) {
	$asp->Debug("script tags removed from $filename for IIS PerlScript compatibility");
    }
    $code = (
	     "\n#line 1 $filename\n".
	     join(" ;; ",
		  "package $self->{'package'};",
		  $strict,
		  "use vars qw(\$".join(" \$",@Apache::ASP::Objects).');',
		  "use lib qw($self->{asp}->{global});",
		  $code,
		  'sub exit { $main::Response->End(); } ',
		  "no lib qw($self->{asp}->{global});",
		  '1;',
		 )
	     );

    $asp->{dbg} && $asp->Debug("compiling global.asa $self->{'package'} $id exists $exists", $self, '---', $compiled);
    $code =~ /^(.*)$/s;
    $code = $1;

site/apps/search/global.asa  view on Meta::CPAN

use lib qw(../../eg);

use File::stat;
use File::Basename;
use MLDBM::Sync;
use File::Find qw(find);
use DemoASP;
use Fcntl qw(O_RDWR O_CREAT);
use Cwd qw(cwd);

use vars qw(%CONF %SDB $title %TEMP_SDB);

site/events.html  view on Meta::CPAN

  Script: index.asp
  $Server-&gt;Config(&#39;PATH&#39;) eq &#39;/SomeCategory&#39;

 INPUT URI /index.asp
 OUTPUT
  Script: index.asp
  $Server-&gt;Config(&#39;PATH&#39;) eq &#39;&#39;

 # httpd.conf
 PerlTransHandler My::Init
 use lib qw( $custom_perllib );

 # $custom_perllib/My/Init.pm
 package My::Init;
 use strict;
 use Apache::Constants qw(:common);
 sub handler {
    my $r = shift;

    my $uri = $r-&gt;uri || &#39;/&#39;;
    unless($uri =~ m|^(.*)(/([^/.]+\.[\w]+)?)$|i) {

t/asp-perl1.t  view on Meta::CPAN

use Carp qw(cluck);

#$SIG{__WARN__} = \&cluck;

my $dirname = dirname($0);
if($dirname) {
    chdir($dirname) || die("can't chdir to $dirname: $!");
}		     

@ARGV = ('-b', '-f', 'asp-perl/asp.conf', 'asp-perl/ok.inc');
use lib qw(../blib/lib ../lib);
do "../asp-perl";

t/asp-perl2.t  view on Meta::CPAN


use File::Basename qw(dirname);
my $dirname = dirname($0);
if($dirname) {
    chdir($dirname) || die("can't chdir to $dirname: $!");
}		     
chdir('asp-perl') || die("can't chdir to asp-perl");

@ARGV = ('-b', 'ok.inc');
use lib qw(../../blib/lib ../../lib);
do "../../asp-perl";

t/asp_object.t  view on Meta::CPAN

use Apache::ASP::CGI;
use lib qw(t .);
use T;
use strict;

$SIG{__DIE__} = \&Carp::confess;

chdir('t');
my $r = Apache::ASP::CGI->init('asp_object.t');
my %config = (
#	      Debug => -3,
	      NoState => 0,

t/cgi_headers.t  view on Meta::CPAN

use Apache::ASP::CGI::Test;
use lib qw(t ../t);
use T;

my $r = Apache::ASP::CGI::Test->do_self(NoState => 1, CgiHeaders => 1, Debug => 0);

my $t = T->new;
my $ok;

$t->eok($ok = $r->test_header_out =~ /Status: 200\n/s, "response header");
$t->eok($ok = $r->test_body_out =~ /^1..1\nok\s+$/s, "response body");
$t->done;

t/cookies.t  view on Meta::CPAN

use Apache::ASP::CGI::Test;

use lib qw(t . ..);
use T;
use strict;

my $t = T->new;
my $r = Apache::ASP::CGI::Test->do_self(
					UseStrict => 1, 
					CookieDomain => 'apache-asp.com', 
					SecureSession => 1,
					CookiePath => '/eg/'
					);

t/global.asa  view on Meta::CPAN


# script tag not needed, just in for IIS Compat test
<script runat=server>

use lib '.';	
use T;	
use strict;
use vars qw($Application $Session $t $Deep);
use Carp qw(confess);

$SIG{__DIE__} = \&confess;

sub Application_OnStart {
    $Application->{Start} = 1;
}

t/global_event_end/global.asa  view on Meta::CPAN


use vars qw($t);
use lib qw(.);
use T;

sub Script_OnStart {
    $t = T->new;
    $t->ok;
    $Response->End;
    $t->not_ok;
}

sub Script_OnEnd {

t/include.t  view on Meta::CPAN

use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self('NoState' => 1, Debug => 0);

__END__

<% use lib '.';	use T;	$t =T->new(); %>
<!--#include file="include_asp.inc"-->
<% $Response->Include("include_asp.inc"); %>
<%
# normal shape of include command
if('<!--#include file="include.inc"-->' =~ /^1/) {
	$t->ok();
} else {
	$t->not_ok;
}
#$Response->Debug($Server->{asp});

t/include_change.t  view on Meta::CPAN

use Apache::ASP::CGI;

$SIG{__WARN__} = \&Carp::cluck;
local $^W = 1;
&Apache::ASP::CGI::do_self('NoState' => 1, Debug => 0, UseStrict => 0);

__END__

<% use lib '.';	use T;	$t =T->new(); %>

<% for my $temp ( 1..2 ) { %>
  <% 
    $Response->Debug("writing temp include piece of $temp");
    open(PIECE, ">include_change_piece.inc_temp");
    print PIECE $temp;
    close PIECE;
    sleep 1;
     
    for my $type ( qw( inline dynamic inline dynamic ) ) {  

t/include_runtime.t  view on Meta::CPAN

use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self('NoState' => 1);

__END__

<% use lib '.';	use T;	$t =T->new(); %>

<% 

use vars qw($ok);

$ok = 0;
my $script = "<\% \$ok++; %\>";
$Response->Include(\$script);
$t->eok($ok == 1, "Could not increment \$ok");

t/load.t  view on Meta::CPAN

use Apache::ASP::CGI;
use lib '.'; use lib qw(t); use T; my $t = T->new();

use Carp;
chdir('t');

$SIG{__DIE__} = \&Carp::confess;
$main::TestLoad = 0;
Apache::ASP->Loader('load.inc', undef, Debug => 1, Execute => 1);
$t->eok($main::TestLoad, "failed to execute load.inc while loading");

my $error_mark;

t/loops.t  view on Meta::CPAN

use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self(NoState => 1);

__END__

<% use lib '.';	use T;	$t =T->new(); %>

<% 
my $count = 0;	
for(1..3) {
	$count++;
}
if($count == 3) {
	$t->ok;
} else {
	$t->not_ok("for loop didn't work");

t/reload_global_asa.t  view on Meta::CPAN


use Apache::ASP::CGI;
use lib qw(t .);
use T;
use strict;

$SIG{__DIE__} = \&Carp::confess;

chdir('t');
my $r = Apache::ASP::CGI->init('reload_global_asa.t');
my %config = (
	      UseStrict => 1,
#	      Debug => -3,

t/req_params_none.t  view on Meta::CPAN

use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self( NoState => 1);

__END__

<% use lib '.';	use T;	$t =T->new(); %>
<% 
eval { my $Params = $Request->Params(); };
$t->eok($@ && ( $@ =~ /Request.*Params does not exist/i ), "Error message for NULL \$Request->Params");
%>
<% $t->done; %>

t/request.t  view on Meta::CPAN

use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self( NoState => 1 );

__END__

<% use lib '.';	use T;	$t =T->new(); %>

<% 
if(%{$Request->ServerVariables()}) {
	$t->ok();
} else {
	$t->not_ok('could not get the environment / server variables');
}

# $Request->{Method}, defaults to GET
$t->eok($Request->{Method} eq 'GET', "\$Request->{Method} eq 'GET'");

t/response.t  view on Meta::CPAN

use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self(NoState => 1);

__END__

<% use lib '.';	use T;	$t =T->new();

# IsClientConnected Tests
$t->eok($Response->{IsClientConnected}, "\$Response->{IsClientConnected}");
$t->eok($Response->IsClientConnected, "\$Response->IsClientConnected");
$Server->{asp}{r}->connection->aborted(1);
$Response->Flush; # updates {IsClientConnected}
$t->eok(! $Response->{IsClientConnected}, "\$Response->{IsClientConnected} after aborted/Flush()");
$t->eok(! $Response->IsClientConnected, "\$Response->IsClientConnected after aborted");

# AddHeader() member setting

t/same_name.t  view on Meta::CPAN

use Apache::ASP::CGI::Test;
use lib qw(t .);
use T;
use strict;
use Cwd qw(cwd);

$SIG{__DIE__} = \&Carp::confess;

my $t = T->new;
my $cwd = cwd();

for my $test_num (1..2) {

t/server.t  view on Meta::CPAN

use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self(NoState => 1, Debug => 0);
$SIG{__DIE__} = \&Carp::confess;

__END__

<% use lib '.';	use T;	$t =T->new(); %>

<% 
my $encode = $Server->URLEncode("test data");
if($encode eq 'test%20data') {
	$t->ok();
} else {
	$t->not_ok('URLEncode not working');
}

$Server->Config('Global', '.');

t/server_mail.t  view on Meta::CPAN

&Apache::ASP::CGI::do_self(NoState => 1, 
			   Debug => 3, 
			   # defaults to localhost for mail relay
			   # but will lookup in Net::Config too for
			   # other hosts
			   MailHost => '127.0.0.1',
			   );

__END__

<% use lib '.';	use T;	$t =T->new(); %>
<% 

# test for Net::SMTP, and skip if not installed
eval "use Net::SMTP";
if($@) {
    return;
} else {
    my $smtp = Net::SMTP->new('127.0.0.1');
    unless($smtp) {
	return;

t/server_transfer.t  view on Meta::CPAN

use Apache::ASP::CGI;
&Apache::ASP::CGI::do_self(NoState => 1, Debug => 0, UseStrict=>1);
$SIG{__DIE__} = \&Carp::confess;

__END__

<% use lib '.';	use T;	$t =T->new(); %>
<% $Server->Transfer('server_transfer.inc', 'TEST'); %>

t/session_events.t  view on Meta::CPAN

#!/usr/local/bin/perl

use lib qw(. .. t);
use Apache::ASP::CGI;
use T;

use strict;
use File::Basename qw(dirname basename);
#$SIG{__DIE__} = \&Carp::confess;
#$SIG{__WARN__} = \&Carp::cluck;
$SIG{__WARN__} = sub { };

$0 =~ /^(.*)$/;

t/session_query_parse.t  view on Meta::CPAN

#!/usr/bin/perl

use Apache::ASP::CGI::Test;

use lib qw(t . ..);
use T;
use strict;

my $t = T->new;
my $r = Apache::ASP::CGI::Test->do_self
    (
     UseStrict => 1, 
     SessionQueryParse => 1,
     Global => 'null',
     );

t/share.t  view on Meta::CPAN

#!/usr/local/bin/perl

use Apache::ASP::CGI;
#use lib qw(. ..);
#use ASP;

&Apache::ASP::CGI::do_self(
#	Debug => -1
			   NoState => 1,
);

__END__

<% 

t/stat_inc.t  view on Meta::CPAN

use Apache::ASP::CGI;

# only run test if Devel::Symdump is installed
eval "use Devel::Symdump;";
my $stat_inc = $@ ? 0 : 1;

&Apache::ASP::CGI::do_self(StatINC => $stat_inc);

__END__

<% use lib '.';	use T;	$t =T->new(); %>
<% 
  return unless $Server->Config('StatINC');
  $t->eok($Apache::ASP::StatINCReady, 'Apache::ASP StatINC Startup'); 
%>
<% $t->done; %>

t/taint_check.t  view on Meta::CPAN

#!/usr/local/bin/perl -T

# for some reason on my Solaris 5.00551 perl, doing
# use Apache::ASP as opposed to use lib qw(.); use ASP
# would make a difference between having an error and
# not having one during "make test", really odd
#
# use Apache::ASP;
#

use lib qw(blib/lib lib);
use Apache::ASP::CGI;

use strict;
#$SIG{__DIE__} = \&Carp::confess;

#    print STDERR $^]." $^V $PERL_VERSION --- \n";
&Apache::ASP::CGI::do_self();

__END__



( run in 0.547 second using v1.01-cache-2.11-cpan-87723dcf8b7 )