Apache2-ASP

 view release on metacpan or  search on metacpan

lib/Apache2/ASP/ASPDOM/Node.pm  view on Meta::CPAN


package Apache2::ASP::ASPDOM::Node;

use strict;
use warnings 'all';
use Carp 'confess';
use Scalar::Util 'weaken';


#==============================================================================
sub new
{
  my ($class, %args) = @_;
  
  my $s = bless {
    %args,
    childNodes          => [ ],
    events => {
      before_appendChild  => [ ],
      after_appendChild   => [ ],
    },
  }, $class;
  weaken($s->{parentNode}) if $s->{parentNode};
  return $s;
}# end new()


#==============================================================================
sub id { $_[0]->{id} }
sub tagName { $_[0]->{tagName} }


#==============================================================================

lib/Apache2/ASP/ASPDOM/Node.pm  view on Meta::CPAN

  @{$_[0]->{childNodes}} or return;
  @{$_[0]->{childNodes}}
}# end childNodes()


#==============================================================================
sub parentNode
{
  my $s = shift;
  
  @_ ? weaken($s->{parentNode} = shift) : $s->{parentNode};
}# end parentNode()


#==============================================================================
sub appendChild
{
  my ($s, $child) = @_;
  
  # Call "before" handlers?
  foreach( @{$s->{events}->{before_appendChild}} )

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

package Apache2::ASP::ASPPage;

use strict;
use warnings 'all';
use Carp 'confess';
use base 'Apache2::ASP::HTTPHandler';
use vars __PACKAGE__->VARS;
use Apache2::ASP::ASPDOM::Node;
use Apache2::ASP::ASPDOM::Document;
use HTTP::Date 'time2iso';
use Scalar::Util 'weaken';

use Data::Dumper;


#==============================================================================
sub new
{
  my ($class, %args) = @_;
  
  $class->init_asp_objects( $class->context );

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


package Apache2::ASP::ApplicationStateManager;

use strict;
use warnings 'all';
use Storable qw( freeze thaw );
use DBI;
use Scalar::Util 'weaken';
use base 'Ima::DBI';
use Digest::MD5 'md5_hex';

#==============================================================================
sub new
{
  my ($class, %args) = @_;
  
  my $s = bless { }, $class;

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


package Apache2::ASP::HTTPContext;

use strict;
use warnings 'all';
use Apache2::ASP::ConfigLoader;
use Apache2::ASP::Response;
use Apache2::ASP::Request;
use Apache2::ASP::Server;
use Carp qw( cluck confess );
use Scalar::Util 'weaken';
use HTTP::Headers;

use Apache2::ASP::SessionStateManager::NonPersisted;
use Apache2::ASP::ApplicationStateManager::NonPersisted;

our $instance;
our $ClassName = __PACKAGE__;
our %StartedServers = ( );

#==============================================================================

lib/Apache2/ASP/Mock/ClientSocket.pm  view on Meta::CPAN


package Apache2::ASP::Mock::ClientSocket;

use strict;
use warnings 'all';
use Scalar::Util 'weaken';


#==============================================================================
sub new
{
  my ($class, %args) = @_;
  
  my $s = bless \%args, $class;
  
  weaken($s->{connection});
  return $s;
}# end new()


#==============================================================================
sub close
{
  my $s = shift;
  
  $s->{connection}->aborted( 1 );

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


package Apache2::ASP::SessionStateManager;

use strict;
use warnings 'all';
use base 'Ima::DBI';
use Digest::MD5 'md5_hex';
use Storable qw( freeze thaw );
use HTTP::Date qw( time2iso str2time );
use Scalar::Util 'weaken';


#==============================================================================
sub new
{
  my ($class, %args) = @_;
  
  my $s = bless {}, $class;
  my $conn = $s->context->config->data_connections->session;
  

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

    UPDATE asp_sessions SET
      modified_on = ?
    WHERE session_id = ?

    $sth->execute( time2iso(), $id );
    $sth->finish();
  }# end if()
  
  undef(%$s);
  $s = bless $data, ref($s);
  weaken($s);
  
  no warnings 'uninitialized';
  
  my @keys = sort keys(%$s);
  
  my $sig = md5_hex(
    join ":",
      map { "$_:$s->{$_}" } 
        grep { $_ ne '__signature' } @keys
  );

lib/Apache2/ASP/Test/UserAgent.pm  view on Meta::CPAN

use warnings 'all';
use HTTP::Request::Common;
use HTTP::Response;
use HTTP::Request::AsCGI;
use HTTP::Body;
use Apache2::ASP::HTTPContext;
use Apache2::ASP::SimpleCGI;
use Apache2::ASP::Mock::RequestRec;
use Carp 'confess';
use IO::File;
use Scalar::Util 'weaken';
use Cwd 'cwd';

our $ContextClass = 'Apache2::ASP::HTTPContext';


#==============================================================================
sub new
{
  my ($class, %args) = @_;
  

lib/Apache2/ASP/Test/UserAgent.pm  view on Meta::CPAN

  }# end foreach()
  
  if( $s->context->session && $s->context->session->{SessionID} )
  {
    $s->add_cookie(
      $s->context->config->data_connections->session->cookie_name => $s->context->session->{SessionID}
    );
  }# end if()
  
  $s->context->r->pool->call_cleanup_handlers();
  weaken($s->context->{cgi});
  
  return $response;
}# end _setup_response()


#==============================================================================
sub _setup_cgi
{
  my ($s, $req) = @_;
  



( run in 0.620 second using v1.01-cache-2.11-cpan-a9ef4e587e4 )