Apache2-API

 view release on metacpan or  search on metacpan

lib/Apache2/API/Query.pm  view on Meta::CPAN

    if( CORE::ref( $self ) )
    {
        foreach( CORE::keys( %$hash ) )
        {
            $self->{ $_ } = CORE::delete( $hash->{ $_ } );
        }
        $new = $self;
    }
    else
    {
        $new = bless( $hash => $class );
    }
    CORE::return( $new );
}

1;
# NOTE: POD
__END__

=encoding utf8

t/lib/Test/Apache2/Common.pm  view on Meta::CPAN

    my( $class, $r ) = @_;
    my $debug = $r->dir_config( 'API_DEBUG' );
    $r->log_error( "${class}: Received request for uri \"", $r->uri, "\" matching file \"", $r->filename, "\": ", $r->as_string );
    my $uri = APR::URI->parse( $r->pool, $r->uri );
    my $path = [split( '/', $uri->path )]->[-1];
    my $api = Apache2::API->new( $r, debug => $debug, compression_threshold => 102400 ) || do
    {
        $r->log_error( "$class: Error instantiating Apache2::API object: ", Apache2::API->error );
        return( Apache2::Const::HTTP_INTERNAL_SERVER_ERROR );
    };
    my $self = bless( { request => $r, api => $api, debug => int( $r->dir_config( 'API_DEBUG' ) ) } => $class );
    my $code = $self->can( $path );
    if( !defined( $code ) )
    {
        $r->log_error( "No method \"$path\" for testing." );
        return( Apache2::Const::DECLINED );
    }
    $r->err_headers_out->set( 'Test-No' => $path );
    my $rc = $code->( $self );
    $r->log_error( "$class: Returning HTTP code '$rc' for method '$path'" );
    if( $rc == Apache2::Const::HTTP_OK )

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.783 second using v1.00-cache-2.02-grep-82fe00e-cpan-9e6bc14194b )