Apache2-ASP

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

2.45    2009-11-20
  - Fixed* a bug that caused deeeeeeeeply nested Master/Child page scenarios to cause
    the MasterPage's ASP objects ($Response, $Request, etc) to not get initialized.
    This fixes the dreaded "Cannot call 'Write' on an undefined value - line 1" error.
    * Involves deleting your page cache before the udpate will take full effect!

2.44    2009-11-17
  - Got rid of annoying "Software caused connection abort" errors.

2.43    2009-11-16
  - Requests to handlers that don't exist will now result in a 404 error, not a 500 error.

2.42    2009-11-11
  - You can now test multiple websites at the same time (eg: Public and Admin websites)
    from within the same test script.  Example given in POD for Apache2::ASP::API

2.41    2009-10-14
  - Bugfix: Errors will now appear on-screen, rather than the default Apache error.

2.40    2009-10-14
  - Enhancement: multipart/form-data posts to MediaManagers no longer require

Changes  view on Meta::CPAN

2.32  2009-03-01
  - Added Apache2::ASP::HTTPContext::SubContext
  - Added t/htdocs/subcontext/*.asp
  - Added t/handlers/simple.pm
  - Re-worked the way Response.Include and Response.TrapInclude work on the inside.
  - No external changes were made.

2.31  2009-02-19
  - Apache2::ASP::HTTPContext order of operations during setup_request was updated.
  - Apache2::ASP::ModPerl returns proper error HTTP codes when errors occur.
  - Requests for non-existent *.asp scripts returns a proper 404.
  - Apache2::ASP::HTTPContext copes better with syntax errors in handlers.
  - Missing handlers are coped with better now.

2.30  2009-02-19
  - Apache2::ASP::ASPPage was misreporting line numbers.

2.29  2009-02-15
  - Added Apache2::ASP::SessionStateManager::Memcached
  - Added Apache2::ASP::ApplicationStateManager::Memcached
  - Both Memcached state managers require Cache::Memcached.

Changes  view on Meta::CPAN

  - Added built-in "sticky forms" for all ASP scripts, exclusive of UploadHandler subclasses.
  - Began new offline test framework.
  - Added Apache2::ASP::Test::UserAgent.
  - Added Apache2::ASP::Test::MockRequest.
  - Updated Apache2::ASP::Request to work within the new test framework.
  - Removed some tests that need to be rewritten with the new test framework.
  - Updated some other tests to work with the new test framework as they are.
  - Added dependencies HTTP::Request::AsCGI, HTML::FillInForm and CGI::Simple.

1.07 2007-06-23
  - Fixed a bug that caused 404 errors to return a blank page instead of the standard
    '404 Not Found' message.
  - Adjusted POD so that Apache2::ASP::Manual::Intro shows up correctly.

1.06 2007-06-23
  - Fixed a bug in Apache2::ASP::PageHandler that caused a bug in which changed ASP
    scripts would not be reloaded by other Apache processes after the first Apache
    process had recompiled the *.pm file as a result of the ASP script being changed.

1.05 2007-06-23
  - $Application->save() is now called at the end of each (non-error) request.

lib/Apache2/ASP/ASPHandler.pm  view on Meta::CPAN

      return $context->response->Status == 200 ? 0 : $context->response->Status;
#    };
    if( $@ )
    {
      $context->response->Status( 500 );
      confess $@;
    }# end if()
  }
  else
  {
    return $context->response->Status( 404 );
  }# end if()
}# end run()

1;# return true:

=pod

=head1 NAME

Apache2::ASP::ASPHandler - handler for all *.asp requests

lib/Apache2/ASP/HTTPContext.pm  view on Meta::CPAN

}# end do_disable_application_state()


#==============================================================================
sub execute
{
  my ($s, $args) = @_;

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

  return 404 unless $s->handler;
  
  if( defined(my $preinit_res = $s->do_preinit) )
  {
    return $preinit_res;
  }# end if()
  
  # Set up and execute any matching request filters:
  my $resolver = $s->config->web->filter_resolver;
  $s->_load_class( $resolver );
  foreach my $filter ( $resolver->new()->resolve_request_filters( $s->r->uri ) )

lib/Apache2/ASP/MediaManager.pm  view on Meta::CPAN

    }
    elsif( defined(my $handler = $s->modes( $mode )) )
    {
      return $handler->( $s, $context );
    }# end if()
  }# end if()
  
  # Get the readable filehandle:
  unless( -f $filename )
  {
    $context->response->Status( 404 );
    return;
  }# end unless()
  
  # Call our before- hook:
  $s->before_download( $context, $filename )
    or return;
  
  # Wait until "before_download" has cleared before we open a filehandle:
  my $ifh = $s->open_file_for_reading( $context, $filename );
  

lib/Apache2/ASP/ModPerl.pm  view on Meta::CPAN

    my $handler_class = eval {
      $context->config->web->handler_resolver->new()->resolve_request_handler( $r->uri )
    };
    if( $@ )
    {
      warn $@;
      $r->status( 500 );
      return $r->status;
    }# end if()
    
    return 404 unless $handler_class;
    
    eval {
      $context->_load_class( $handler_class );
      
      my $cgi = CGI->new( $r );
      my %args = map { my ($k,$v) = split /\=/, $_; ( $k => $v ) } split /&/, $ENV{QUERY_STRING};
      map { $cgi->param($_ => $args{$_}) } keys %args;
      $context->setup_request( $r, $cgi);
      $handler_class->init_asp_objects( $context );
      

lib/Apache2/ASP/Response.pm  view on Meta::CPAN

=head1 SYNOPSIS

  return $Response->Redirect("/another.asp");
  
  return $Response->Declined;
  
  $Response->End;
  
  $Response->ContentType("text/xml");
  
  $Response->Status( 404 );
  
  # Make this response expire 30 minutes ago:
  $Response->Expires( -30 );
  
  $Response->Include( $Server->MapPath("/inc/top.asp"), { foo => 'bar' } );
  
  my $html = $Response->TrapInclude( $Server->MapPath("/inc/top.asp"), { foo => 'bar' } );
  
  $Response->AddHeader("content-disposition: attachment;filename=report.csv");
  

lib/Apache2/ASP/Response.pm  view on Meta::CPAN

=head1 PUBLIC PROPERTIES

=head2 ContentType( [$type] )

Sets/gets the content-type response header (i.e. text/html, image/gif, etc).

Default: text/html

=head2 Status( [$status] )

Sets/gets the status response header (i.e. 200, 404, etc).

Default: 200

=head2 Expires( [$minutes] )

Default 0

=head2 ExpiresAbsolute( [$http_date] )

=head2 Declined( )

t/010-coverage/050-mediamanager.t  view on Meta::CPAN

  my $res1 = $api->ua->get('/handlers/upload01?file=asp-upload-test.txt&mode=delete&do_fail_before_delete=1');
  
  my $res = $api->ua->get('/handlers/upload01?file=asp-upload-test.txt&mode=delete');
  is( $res->is_success => 1 );
}


# Now try downloading that file again...should fail:
{
  my $res = $api->ua->get('/handlers/upload01?file=asp-upload-test.txt');
  is( $res->status_line => '404 Not Found' );
}


# Upload a file and then download it:
{
  my $upload_filename = '/tmp/test-file.pdf';
  open my $ofh, '>', $upload_filename
    or die "Cannot open '$upload_filename' for writing: $!";
  for( 1...1000 )
  {

t/900-old-tests/04.01-syntax-errors.t  view on Meta::CPAN



# Request a page that doesn't exist.  This should *not* produce an error:
{
  my $res = eval { $s->ua->get("/non-existent-page.asp") };

  ok( (! $res) || ( ! $res->is_success ), 'request failed' );
  if( $res )
  {
    ok( ! $res->is_success, "unsuccessful" );
    ok( $res->status_line =~ m/404\s+/, "status code of 404: '" . $res->status_line . "'" );
  }# end if()

  ok(
    ! $s->ua->context->server->GetLastError,
    "No error"
  );
}

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

394: This is a line of text
395: This is a line of text
396: This is a line of text
397: This is a line of text
398: This is a line of text
399: This is a line of text
400: This is a line of text
401: This is a line of text
402: This is a line of text
403: This is a line of text
404: This is a line of text
405: This is a line of text
406: This is a line of text
407: This is a line of text
408: This is a line of text
409: This is a line of text
410: This is a line of text
411: This is a line of text
412: This is a line of text
413: This is a line of text
414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

1394: This is a line of text
1395: This is a line of text
1396: This is a line of text
1397: This is a line of text
1398: This is a line of text
1399: This is a line of text
1400: This is a line of text
1401: This is a line of text
1402: This is a line of text
1403: This is a line of text
1404: This is a line of text
1405: This is a line of text
1406: This is a line of text
1407: This is a line of text
1408: This is a line of text
1409: This is a line of text
1410: This is a line of text
1411: This is a line of text
1412: This is a line of text
1413: This is a line of text
1414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

2394: This is a line of text
2395: This is a line of text
2396: This is a line of text
2397: This is a line of text
2398: This is a line of text
2399: This is a line of text
2400: This is a line of text
2401: This is a line of text
2402: This is a line of text
2403: This is a line of text
2404: This is a line of text
2405: This is a line of text
2406: This is a line of text
2407: This is a line of text
2408: This is a line of text
2409: This is a line of text
2410: This is a line of text
2411: This is a line of text
2412: This is a line of text
2413: This is a line of text
2414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

3394: This is a line of text
3395: This is a line of text
3396: This is a line of text
3397: This is a line of text
3398: This is a line of text
3399: This is a line of text
3400: This is a line of text
3401: This is a line of text
3402: This is a line of text
3403: This is a line of text
3404: This is a line of text
3405: This is a line of text
3406: This is a line of text
3407: This is a line of text
3408: This is a line of text
3409: This is a line of text
3410: This is a line of text
3411: This is a line of text
3412: This is a line of text
3413: This is a line of text
3414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

4030: This is a line of text
4031: This is a line of text
4032: This is a line of text
4033: This is a line of text
4034: This is a line of text
4035: This is a line of text
4036: This is a line of text
4037: This is a line of text
4038: This is a line of text
4039: This is a line of text
4040: This is a line of text
4041: This is a line of text
4042: This is a line of text
4043: This is a line of text
4044: This is a line of text
4045: This is a line of text
4046: This is a line of text
4047: This is a line of text
4048: This is a line of text
4049: This is a line of text
4050: This is a line of text
4051: This is a line of text
4052: This is a line of text
4053: This is a line of text
4054: This is a line of text
4055: This is a line of text
4056: This is a line of text
4057: This is a line of text
4058: This is a line of text
4059: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

4394: This is a line of text
4395: This is a line of text
4396: This is a line of text
4397: This is a line of text
4398: This is a line of text
4399: This is a line of text
4400: This is a line of text
4401: This is a line of text
4402: This is a line of text
4403: This is a line of text
4404: This is a line of text
4405: This is a line of text
4406: This is a line of text
4407: This is a line of text
4408: This is a line of text
4409: This is a line of text
4410: This is a line of text
4411: This is a line of text
4412: This is a line of text
4413: This is a line of text
4414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

5394: This is a line of text
5395: This is a line of text
5396: This is a line of text
5397: This is a line of text
5398: This is a line of text
5399: This is a line of text
5400: This is a line of text
5401: This is a line of text
5402: This is a line of text
5403: This is a line of text
5404: This is a line of text
5405: This is a line of text
5406: This is a line of text
5407: This is a line of text
5408: This is a line of text
5409: This is a line of text
5410: This is a line of text
5411: This is a line of text
5412: This is a line of text
5413: This is a line of text
5414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

6394: This is a line of text
6395: This is a line of text
6396: This is a line of text
6397: This is a line of text
6398: This is a line of text
6399: This is a line of text
6400: This is a line of text
6401: This is a line of text
6402: This is a line of text
6403: This is a line of text
6404: This is a line of text
6405: This is a line of text
6406: This is a line of text
6407: This is a line of text
6408: This is a line of text
6409: This is a line of text
6410: This is a line of text
6411: This is a line of text
6412: This is a line of text
6413: This is a line of text
6414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

7394: This is a line of text
7395: This is a line of text
7396: This is a line of text
7397: This is a line of text
7398: This is a line of text
7399: This is a line of text
7400: This is a line of text
7401: This is a line of text
7402: This is a line of text
7403: This is a line of text
7404: This is a line of text
7405: This is a line of text
7406: This is a line of text
7407: This is a line of text
7408: This is a line of text
7409: This is a line of text
7410: This is a line of text
7411: This is a line of text
7412: This is a line of text
7413: This is a line of text
7414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

8394: This is a line of text
8395: This is a line of text
8396: This is a line of text
8397: This is a line of text
8398: This is a line of text
8399: This is a line of text
8400: This is a line of text
8401: This is a line of text
8402: This is a line of text
8403: This is a line of text
8404: This is a line of text
8405: This is a line of text
8406: This is a line of text
8407: This is a line of text
8408: This is a line of text
8409: This is a line of text
8410: This is a line of text
8411: This is a line of text
8412: This is a line of text
8413: This is a line of text
8414: This is a line of text

t/MEDIA/asp-upload-test.txt  view on Meta::CPAN

9394: This is a line of text
9395: This is a line of text
9396: This is a line of text
9397: This is a line of text
9398: This is a line of text
9399: This is a line of text
9400: This is a line of text
9401: This is a line of text
9402: This is a line of text
9403: This is a line of text
9404: This is a line of text
9405: This is a line of text
9406: This is a line of text
9407: This is a line of text
9408: This is a line of text
9409: This is a line of text
9410: This is a line of text
9411: This is a line of text
9412: This is a line of text
9413: This is a line of text
9414: This is a line of text



( run in 1.946 second using v1.01-cache-2.11-cpan-39bf76dae61 )