X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=c51640905f65de227ea92fed9b3fcb8a6615d27c;hb=3c9b6867515767b70b7771dd0c32a532f23e876b;hp=b0b5243fe320080628844cfb615d397d818b478e;hpb=0f56bbcf00b69a018aa6be442200b917b3e9f9a2;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index b0b5243..c516409 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -10,7 +10,10 @@ use HTML::Entities; use HTTP::Body; use HTTP::Headers; use URI::QueryParam; -use Scalar::Util (); + +use namespace::clean -except => 'meta'; + +has env => (is => 'rw'); # input position and length has read_length => (is => 'rw'); @@ -18,8 +21,6 @@ has read_position => (is => 'rw'); has _prepared_write => (is => 'rw'); -no Moose; - # Amount of data to read from input on each pass our $CHUNKSIZE = 64 * 1024; @@ -46,7 +47,7 @@ sub finalize_body { my ( $self, $c ) = @_; my $body = $c->response->body; no warnings 'uninitialized'; - if ( Scalar::Util::blessed($body) && $body->can('read') or ref($body) eq 'GLOB' ) { + if ( blessed($body) && $body->can('read') or ref($body) eq 'GLOB' ) { while ( !eof $body ) { read $body, my ($buffer), $CHUNKSIZE; last unless $self->write( $c, $buffer ); @@ -76,7 +77,7 @@ sub finalize_cookies { my $val = $response->cookies->{$name}; my $cookie = ( - Scalar::Util::blessed($val) + blessed($val) ? $val : CGI::Simple::Cookie->new( -name => $name, @@ -84,7 +85,8 @@ sub finalize_cookies { -expires => $val->{expires}, -domain => $val->{domain}, -path => $val->{path}, - -secure => $val->{secure} || 0 + -secure => $val->{secure} || 0, + -httponly => $val->{httponly} || 0, ) ); @@ -159,6 +161,8 @@ EOF (dk) Venligst prov igen senere (pl) Prosze sprobowac pozniej (pt) Por favor volte mais tarde +(ru) Попробуйте еще раз позже +(ua) Спробуйте ще раз пізніше $name = ''; @@ -587,7 +591,7 @@ sub read { =head2 $self->read_chunk($c, $buffer, $length) -Each engine inplements read_chunk as its preferred way of reading a chunk +Each engine implements read_chunk as its preferred way of reading a chunk of data. =cut @@ -673,6 +677,18 @@ sub unescape_uri { , see finalize_body +=head2 $self->env + +Hash containing enviroment variables including many special variables inserted +by WWW server - like SERVER_*, REMOTE_*, HTTP_* ... + +Before accesing enviroment variables consider whether the same information is +not directly available via Catalyst objects $c->request, $c->engine ... + +BEWARE: If you really need to access some enviroment variable from your Catalyst +application you should use $c->engine->env->{VARNAME} instead of $ENV{VARNAME}, +as in some enviroments the %ENV hash does not contain what you would expect. + =head1 AUTHORS Catalyst Contributors, see Catalyst.pm