From 193575767582376e4a70c5d4af176dab84b2b0ee Mon Sep 17 00:00:00 2001 From: Sebastian Riedel Date: Mon, 20 Sep 2004 23:44:48 +0000 Subject: [PATCH] Accessors for everything git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@203 48953598-375a-da11-a14b-00016c27c3ee --- Changes | 1 + lib/Apache/MVC.pm | 3 ++- lib/Maypole.pm | 20 +++++++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Changes b/Changes index 1e73404..fb0faad 100644 --- a/Changes +++ b/Changes @@ -15,6 +15,7 @@ Revision history for Perl extension Maypole - Removed Maypole::View::Mason as it's distributed separately on CPAN. - Factory templates are now XHTML 1.1 compliant. - made the config hash into -> Maypole::Config + - accessors for everything 1.7 Sat Jul 17 20:15:26 BST 2004 - Emergency release - we lost the "use Maypole::Constants" from diff --git a/lib/Apache/MVC.pm b/lib/Apache/MVC.pm index 7d2114b..5eb1e4d 100644 --- a/lib/Apache/MVC.pm +++ b/lib/Apache/MVC.pm @@ -42,7 +42,8 @@ sub parse_args { sub send_output { my $r = shift; - $r->{ar}->content_type( $r->{content_type} ."; encoding=".$r->{document_encoding} ); + $r->{ar}->content_type( + $r->{content_type} . "; encoding=" . $r->{document_encoding} ); $r->{ar}->headers_out->set( "Content-Length" => length $r->{output} ); APACHE2 || $r->{ar}->send_http_header; $r->{ar}->print( $r->{output} ); diff --git a/lib/Maypole.pm b/lib/Maypole.pm index cce6cd7..dd9ff77 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -5,11 +5,11 @@ use UNIVERSAL::require; use strict; use warnings; use Maypole::Config; -our $VERSION = "1.8"; +our $VERSION = '2.0'; __PACKAGE__->mk_classdata($_) for qw( config init_done view_object ); __PACKAGE__->mk_accessors( - qw( ar params query objects model_class - args action template ) + qw( ar params query objects model_class template_args output path + args action template error document_encoding content_type table) ); __PACKAGE__->config( Maypole::Config->new() ); __PACKAGE__->init_done(0); @@ -45,8 +45,9 @@ sub init { my $config = $class->config; $config->view || $config->view("Maypole::View::TT"); $config->view->require; - die "Couldn't load the view class ".$config->view.": $@" if $@; - $config->display_tables || $config->display_tables([ $class->config->tables ]); + die "Couldn't load the view class " . $config->view . ": $@" if $@; + $config->display_tables + || $config->display_tables( [ $class->config->tables ] ); $class->view_object( $class->config->view->new ); $class->init_done(1); @@ -66,6 +67,7 @@ sub handler { return $status; } +# The root of all evil sub handler_guts { my $r = shift; $r->model_class( $r->config->model->class_of( $r, $r->{table} ) ); @@ -123,8 +125,8 @@ sub handler_guts { sub is_applicable { my $self = shift; my $config = $self->config; - $config->ok_tables || $config->ok_tables($config->display_tables); - $config->ok_tables ({ map { $_ => 1 } @{ $config->ok_tables } }) + $config->ok_tables || $config->ok_tables( $config->display_tables ); + $config->ok_tables( { map { $_ => 1 } @{ $config->ok_tables } } ) if ref $config->ok_tables eq "ARRAY"; warn "We don't have that table ($self->{table})" if $self->debug @@ -342,8 +344,8 @@ Simon Cozens, C =head1 THANK YOU -Jesse Scheidlower, Jody Belka, Marcus Ramberg, Mickael Joanne, Simon Flack, -Veljko Vidovic and all the others who've helped. +Danijel Milicevic, Jesse Scheidlower, Jody Belka, Marcus Ramberg, +Mickael Joanne, Simon Flack, Veljko Vidovic and all the others who've helped. =head1 LICENSE -- 2.39.2