« Return to Thread: Want cookbook for HTML::Mason -> Mason2
The memory leaks in HTML::Mason (1.35) have finally annoyed my ISP to the point that I had to promise them I would upgrade to Mason2. That said, I'm really having a hard time juggling all the moving parts that seem to be documented as having been changed in the new version.
I looked through most of the archive and couldn't find what I needed.I'm hoping that in getting my own questions answered we can all then have a suitable migration document. I will outline the individual pieces that construct my Mason 1.35 website and then ask what about each piece needs to change./* httpd.conf */PerlModule /path/to/HTML::Mason::ApacheHandlerPerlSetVar MasonDataDir /var/www/masonPerlSetVar MasonCompRoot /var/www/html<LocationMatch "/.*\.html$">SetHandler perl-scriptPerlHandler HTML::Mason::ApacheHandler</LocationMatch>Is there a one-to-one translation in httpd.conf for the above directives?
In the autohandler, I use HTML::Mason to create sessions as follows./* autohandler */
<%init>{ package HTML::Mason::Commands;use vars qw(%session);use CGI::Cookie;use Apache::DBI;use Apache::Session::DBI;use Apache::Session::MySQL;}# Get the incoming cookiesmy %cookies = parse CGI::Cookie($r->headers_in->{Cookie});# Try to re-establish an existing sessioneval {tie %HTML::Mason::Commands::session, 'Apache::Session::MySQL',($cookies{$cookie_name} ? $cookies{$cookie_name}->value() : undef),{Handle => $dbh,LockHandle => $dbh};};...</%init>Is the <%init> block still used the same way?
Could I just change HTML::Mason to Mason2.12 and everything work wrt sessions?
/* general component calls */$m -> call_next(dbh => $dbh)I saw a note to use Moose inner, but without elaboration. How do I translate this?
$m -> comp('/path/to/component.mas:methodname');Does this change at all in Mason 2?
<& /path/to/component.mas, dbh=>$dbh &>Does this change at all in Mason 2?
Just to confirm, $ARGS{name} is now $.args->{name} ?
"<%args>and<%shared>are gone. Use Moose attributes instead." What does this mean practically? What would<%args>$dbh</%args>look like in Moose?
Thanks for everything. I have loved using Mason to build my site which is for a animal rescue organization. The dogs and I thank you!
« Return to Thread: Want cookbook for HTML::Mason -> Mason2
| Free embeddable forum powered by Nabble | Forum Help |