X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FGruntmaster%2FPage%2FBase.pm;fp=lib%2FGruntmaster%2FPage%2FBase.pm;h=99ca432732cfc9d8a9a27ba21e79752a01d2f726;hb=e63eaf407e505337cd02d7bc7ca3010ab6337348;hp=84d74510638108fd11117d166353bb883270dda0;hpb=555ec5d2d7291695ad9b6ea7573709d97670236a;p=plack-app-gruntmaster.git diff --git a/lib/Gruntmaster/Page/Base.pm b/lib/Gruntmaster/Page/Base.pm index 84d7451..99ca432 100644 --- a/lib/Gruntmaster/Page/Base.pm +++ b/lib/Gruntmaster/Page/Base.pm @@ -3,7 +3,7 @@ package Gruntmaster::Page::Base; use 5.014000; use strict; use warnings; -our $VERSION = '0.001'; +our $VERSION = '5999.000_001'; use File::Slurp qw/read_file/; use HTML::Template::Compiled; @@ -32,7 +32,6 @@ sub footer{ ################################################## use POSIX (); -use Gruntmaster::Data (); use List::Util (); use LWP::UserAgent; use Plack::Request (); @@ -50,7 +49,6 @@ sub import_to { feature->import(':5.14'); warnings->import; File::Slurp->export_to_level(1, $caller, qw/read_file/); - Gruntmaster::Data->export_to_level(1, $caller); List::Util->export_to_level(1, $caller, qw/sum/); no strict 'refs'; @@ -61,6 +59,7 @@ sub import_to { local $Log::Log4perl::caller_depth = $Log::Log4perl::caller_depth + 1; $_[0]->{'psgix.logger'}->({qw/level debug message/ => $_[1]}) }; + *{"${caller}::db"} = sub { $_[0]->{'gruntmaster.dbic'} }; *{"${caller}::reply"} = sub { [200, ['Content-Type' => 'text/plain', 'Cache-Control' => 'no-cache'], [ @_ ] ] }; *{"${caller}::purge"} = sub { return unless $ENV{PURGE_HOST}; @@ -89,7 +88,7 @@ sub generate{ my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$self}{$lang}, default_escape => 'HTML', use_perl => 1); $self->_generate($htc, $lang, @args); my $out = $htc->output; - utf8::downgrade($out); + utf8::encode($out); my $vary = 'Accept-Language, ' . $self->vary; [200, ['Content-Type' => 'text/html', 'Content-Language' => $_[1], 'Vary' => $vary, 'X-Forever' => 1, 'Cache-Control' => 'max-age=' . $self->max_age], [ $out ] ] }