ASP4

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

2011-07-09    v1.049
[Bug Fixes]
  - v1.048 broke session cookies.
  - Upgrade to v1.049 (quick).

2011-07-07    v1.048
[Bug Fixes]
  - <% $Response->Status(404); return $Response->End; %> DID NOT WORK.
    Instead it continued processing other ContentPlaceHolders.  Now we check
    to see if $Response->End was called before we process anything else.
  - Still getting some "Content encoding error" messages from FF/Chrome/MSIE but
    we're almost there.

2011-05-19    v1.047
[Bug Fixes]
  - $Response->Expires("30M") wasn't documented.  Now it is.
  - $Response->Expires wasn't working properly.  Now it is. (Always ended up with pre-epoch expiration times).

2011-05-03    v1.046
[Bug Fixes]
  - $Response->Redirect(...) wasn't returning '301' - now it does.

2011-05-03    v1.045
[Bug Fixes]
  - Actually it turned out that setting $Session->is_read_only(1) *DID* prevent
    $Session->save() from working.  This is now fixed to match the documentation.

2011-05-01    v1.044

[Bug Fixes]
  - ASP4::ModPerl now does the Right Thing when a non-200 response is encountered.
    - 500 response does not result in an "encoding error" in firefox.
    - 200 (or 0 response) does the right thing.
    - non-200 (and non-500) response does the right thing (eg: 401)
  - ASP4::SessionStateManager now checks $s->is_changed *before* checking $s->{__lastMod} date
    before deciding whether is should persist its changes in ->save().

[New Features]
  - $Session->is_read_only(1) is new.  Setting it to a true value (eg: 1) will prevent
    the default behavior of calling $Session->save() at the end of each successful request.

2011-04-08    v1.043

Changes  view on Meta::CPAN

2010-03-01    v1.018
  - Updated asphelper script so that the POD on CPAN is not contaminated with POD
    from within one of the modules that asphelper generates.
  - Now asphelper will not create a Class::DBI::Lite model class unless 
    Class::DBI::Lite is installed.

2010-03-01    v1.017
  - Updated asphelper script to only accept options on the command-line, like "normal" scripts.

2010-02-28    v1.016
  - A vestigial "use encoding 'utf8'" was removed from ASP4::Server.
  - It was causing Apache to segfault on ubuntu 9.10.

2010-02-19    v1.015
  - Hostnames like http://myapplication/ were not setting session cookies properly.
  - $Config->data_connections->session->cookie_domain should set to "*" in these cases.
  - $Response->SetCookie accepts the "*" value for domain also.
  - The result is that no "domain=xyz" attribute is given to these cookies.

2010-02-18    v1.014
  - $Response->ContentType now functions correctly.

MANIFEST  view on Meta::CPAN

t/010-basic/050-useragent.t
t/010-basic/060-api.t
t/010-basic/070-memory-leak.t
t/010-basic/080-cleanup-handlers.t
t/010-basic/090-everything.t
t/020-bench/010-hello.t
t/030-filters/010-seo.t
t/040-round2/010-include-missing.t
t/040-round2/020-api-in-handler.t
t/040-round2/030-redirect-after-trapinclude.t
t/050-encoding/010-default.t
t/999-finish/000-cleanup.t
t/conf/asp4-config.json
t/conf/httpd.conf
t/etc/properties.yaml
t/etc/test_fixtures.json
t/etc/test_fixtures.yaml
t/handlers/dev/api_inside_handler.pm
t/handlers/dev/encoding/hello.pm
t/handlers/dev/headers.pm
t/handlers/dev/redirect_after_trapinclude.pm
t/handlers/dev/seo_handler.pm
t/handlers/dev/simple.pm
t/handlers/dev/speed.pm
t/htdocs/404.asp
t/htdocs/child-returns-404.asp
t/htdocs/everything/master.asp
t/htdocs/everything/step01.asp
t/htdocs/form.pm

README.markdown  view on Meta::CPAN

    );

To send an HTML email do the following:

    use MIME::Base64;
    $Server->Mail(
      from                        => 'foo@bar.com',
      to                          => 'bar@foo.com',
      subject                     => 'Hello, world!',
      'content-type'              => 'text/html',
      'content-transfer-encoding' => 'base64',
      message => encode_base64(<<"HTML")
    <html>
    <body>
      <p>This is an html email.</p>
      <p>You can see that <b>this text is bold</b>.</p>
    </body>
    </html>
    HTML
    );

lib/ASP4.pm  view on Meta::CPAN

  );

To send an HTML email do the following:

  use MIME::Base64;
  $Server->Mail(
    from                        => 'foo@bar.com',
    to                          => 'bar@foo.com',
    subject                     => 'Hello, world!',
    'content-type'              => 'text/html',
    'content-transfer-encoding' => 'base64',
    message => encode_base64(<<"HTML")
  <html>
  <body>
    <p>This is an html email.</p>
    <p>You can see that <b>this text is bold</b>.</p>
  </body>
  </html>
  HTML
  );

lib/ASP4/ErrorHandler.pm  view on Meta::CPAN


sub send_error
{
  my ($s, $error) = @_;
  
  $Server->Mail(
    To                          => $Config->errors->mail_errors_to,
    From                        => $Config->errors->mail_errors_from,
    Subject                     => "ASP4: Error in @{[ $ENV{HTTP_HOST} ]}@{[ $ENV{REQUEST_URI} ]}",
    'content-type'              => 'text/html',
    'content-transfer-encoding' => 'base64',
    Message                     => encode_base64( $s->error_html($error) ),
    smtp                        => $Config->errors->smtp_server,
  );
}# end send_error()


sub error_html
{
  my ($s, $error) = @_;
  

t/050-encoding/010-default.t  view on Meta::CPAN

  },
  foo => {
    original  => 'Bjòrknù',
  }
};

my $api = ASP4::API->new;

for my $lang (qw( arabic chinese_simplified armenian foo ))
{
  ok( my $res = $api->ua->get("/handlers/dev.encoding.hello?lang=$lang"), "GET /handlers/dev.encoding.hello?lang=$lang" );
  is $res->decoded_content, $hellos->{$lang}->{original};
}# end for()

t/handlers/dev/encoding/hello.pm  view on Meta::CPAN


package dev::encoding::hello;

use strict;
use warnings 'all';
use base 'ASP4::FormHandler';
use vars __PACKAGE__->VARS;
use MIME::Base64;
use Encode;
use utf8;

# TODO: Encoding tests to make sure we get round-trip encoding integrity.
sub run
{
  my ($s, $context) = @_;
  
  my $hellos = {
    arabic  => {
      original  => 'مرحبا ، العالم!',
      encoded => 'JiMxNjA1OyYjMTU4NTsmIzE1ODE7JiMxNTc2OyYjMTU3NTsgJiMxNTQ4OyAmIzE1NzU7JiMxNjA0
OyYjMTU5MzsmIzE1NzU7JiMxNjA0OyYjMTYwNTsh'
    },



( run in 0.276 second using v1.01-cache-2.11-cpan-4d50c553e7e )