ASP4

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


[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
  - Documentation overhaul.

2011-03-23    v1.042
  - Fixed sporadic error in master pages that looks like this:
    Can't call method "Write" on an undefined value at /tmp/PAGE_CACHE/BStat/_masters_global_asp.pm line 1.
  - Apparently $s->init_asp_objects($context) was not getting called before the 
    master page's run() method was called, resulting in a call to $Response->Write(...)
    before $Response had been initialized.

2010-11-11    v1.041
  - ASP4::UserAgent calls all cleanup handlers registered via $Server->RegisterCleanup(sub { }, @args)
    at the end of each request, not when the ASP4::Mock::Pool object's DESTROY method is called.
    This fixes a condition which caused conflict when a Class::DBI::Lite ORM is
    used and the ASP4 application is executed via the `asp4` helper script.

MANIFEST  view on Meta::CPAN

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
t/htdocs/GlobalASA.pm
t/htdocs/include-missing.asp
t/htdocs/index.asp
t/htdocs/masters/deep.asp
t/htdocs/masters/global.asp
t/htdocs/masters/submaster.asp
t/htdocs/pageparser/010.asp
t/htdocs/pageparser/01simple.asp
t/htdocs/pageparser/child-inner1.asp
t/htdocs/pageparser/child-inner2.asp
t/htdocs/pageparser/child-outer.asp
t/htdocs/pageparser/does-trapinclude.asp
t/htdocs/pageparser/has-2-includes.asp
t/htdocs/pageparser/has-include.asp
t/htdocs/pageparser/has-nested-include.asp

README.markdown  view on Meta::CPAN

to the `$Session` to be saved to the database.

### $Session->reset()

Call `$Session->reset()` to clear all the data out of the session and save 
it to the database.

## $Config

The ASP4 `$Config` object is stored in a simple JSON format on disk, and accessible
everywhere within your entire ASP4 application as the global `$Config` object.

If ever you find yourself in a place without a `$Config` object, you can get one
like this:

    use ASP4::ConfigLoader;
    my $Config = ASP4::ConfigLoader->load();

See [ASP4::Config](http://search.cpan.org/perldoc?ASP4::Config) for full details on the ASP4 `$Config` object and its usage.

## $Stash

README.markdown  view on Meta::CPAN

      recipient =>
        'App::db::user' =>
          'to_user_id'
    );
    

    1;# return true:

Create your MasterPage like this:

File: `htdocs/masters/global.asp`

    <%@ MasterPage %>
    <!DOCTYPE html>
    <html>
      <head>
        <title><asp:ContentPlaceHolder id="meta_title"></asp:ContentPlaceHolder></title>
        <meta charset="utf-8" />
      </head>
      <body>
        <h1><asp:ContentPlaceHolder id="headline"></asp:ContentPlaceHolder></h1>
        <asp:ContentPlaceHolder id="main_content"></asp:ContentPlaceHolder>
      </body>
    </html>

File: `htdocs/index.asp`

    <%@ Page UseMasterPage="/masters/global.asp" %>
    

    <asp:Content PlaceHolderID="meta_title">Register</asp:Content>
    

    <asp:Content PlaceHolderID="headline">Register</asp:Content>
    

    <asp:Content PlaceHolderID="main_content">
    <%

README.markdown  view on Meta::CPAN


      # Errors or not?:
      keys %$errors ? return $errors : return;
    }
    

    1;# return true:

File: `htdocs/profile.asp`

    <%@ Page UseMasterPage="/masters/global.asp" %>
    

    <asp:Content PlaceHolderID="meta_title">My Profile</asp:Content>
    

    <asp:Content PlaceHolderID="headline">My Profile</asp:Content>
    

    <asp:Content PlaceHolderID="main_content">
    <%

inc/Module/Install.pm  view on Meta::CPAN

	}

	my @exts = @{$self->{extensions}};
	unless ( @exts ) {
		my $admin = $self->{admin};
		@exts = $admin->load_all_extensions;
	}

	my %seen;
	foreach my $obj ( @exts ) {
		while (my ($method, $glob) = each %{ref($obj) . '::'}) {
			next unless $obj->can($method);
			next if $method =~ /^_/;
			next if $method eq uc($method);
			$seen{$method}++;
		}
	}

	my $who = $self->_caller;
	foreach my $name ( sort keys %seen ) {
		*{"${who}::$name"} = sub {

lib/ASP4.pm  view on Meta::CPAN

to the C<$Session> to be saved to the database.

=head3 $Session->reset()

Call C<< $Session->reset() >> to clear all the data out of the session and save 
it to the database.

=head2 $Config

The ASP4 C<$Config> object is stored in a simple JSON format on disk, and accessible
everywhere within your entire ASP4 application as the global C<$Config> object.

If ever you find yourself in a place without a C<$Config> object, you can get one
like this:

  use ASP4::ConfigLoader;
  my $Config = ASP4::ConfigLoader->load();

See L<ASP4::Config> for full details on the ASP4 C<$Config> object and its usage.

=head2 $Stash

lib/ASP4.pm  view on Meta::CPAN

  __PACKAGE__->belongs_to(
    recipient =>
      'App::db::user' =>
        'to_user_id'
  );
  
  1;# return true:

Create your MasterPage like this:

File: C<htdocs/masters/global.asp>

  <%@ MasterPage %>
  <!DOCTYPE html>
  <html>
    <head>
      <title><asp:ContentPlaceHolder id="meta_title"></asp:ContentPlaceHolder></title>
      <meta charset="utf-8" />
    </head>
    <body>
      <h1><asp:ContentPlaceHolder id="headline"></asp:ContentPlaceHolder></h1>
      <asp:ContentPlaceHolder id="main_content"></asp:ContentPlaceHolder>
    </body>
  </html>

File: C<htdocs/index.asp>

  <%@ Page UseMasterPage="/masters/global.asp" %>
  
  <asp:Content PlaceHolderID="meta_title">Register</asp:Content>
  
  <asp:Content PlaceHolderID="headline">Register</asp:Content>
  
  <asp:Content PlaceHolderID="main_content">
  <%
    # Sticky forms work like this:
    if( my $args = $Session->{__lastArgs} ) {
      map { $Form->{$_} = $args->{$_} } keys %$args;

lib/ASP4.pm  view on Meta::CPAN

    }
    
    # Errors or not?:
    keys %$errors ? return $errors : return;
  }
  
  1;# return true:

File: C<htdocs/profile.asp>

  <%@ Page UseMasterPage="/masters/global.asp" %>
  
  <asp:Content PlaceHolderID="meta_title">My Profile</asp:Content>
  
  <asp:Content PlaceHolderID="headline">My Profile</asp:Content>
  
  <asp:Content PlaceHolderID="main_content">
  <%
    if( my $msg = $Session->{msg} ) {
  %>
    <div class="message"><%= $msg %></div>

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

the processing of incoming requests - specifically file uploads and cookies.

=head1 METHODS

=head2 Cookies( [$name] )

Returns a cookie by name, or all cookies if no name is provided.

=head2 ServerVariables( [$name] )

A wrapper around the global C<%ENV> variable.

This means that:

  $Request->ServerVariables('HTTP_HOST')

is the same as:

  $ENV{HTTP_HOST}

=head2 FileUpload( $fieldname )

t/htdocs/child-returns-404.asp  view on Meta::CPAN

<%@ Page UseMasterPage="/masters/global.asp" %>

<asp:Content PlaceHolderID="init"><%
  $Response->Status( 404 );
  return $Response->End;
%></asp:Content>

<asp:Content PlaceHolderID="page_body"><%
  die "Should not get here.";
%></asp:Content>

t/htdocs/masters/submaster.asp  view on Meta::CPAN

<%@ MasterPage %>
<%@ Page UseMasterPage="/masters/global.asp" %>

<asp:Content PlaceHolderID="meta_title">Submaster Title</asp:Content>

<asp:Content PlaceHolderID="meta_keywords">submaster keywords</asp:Content>

<asp:Content PlaceHolderID="meta_description">submaster description</asp:Content>

<asp:Content PlaceHolderID="page_heading">The Submaster Page</asp:Content>

<asp:Content PlaceHolderID="page_body">



( run in 0.697 second using v1.01-cache-2.11-cpan-49f99fa48dc )