Subject: | [PATCH] fix for accessing $c->engine->env->{VARNAME} |
Date: | Thu, 21 May 2009 17:12:17 +0200 |
To: | bug-Catalyst-Runtime [...] rt.cpan.org |
From: | kmx <kmx [...] volny.cz> |
Hi,
I have found out that accessing env vars through
$c->engine->env->{VARNAME} does not work despite the fact that many
people on IRC was sure it does. After some investigation I have found
out that line "has env => (is => 'rw');" was probably by mistake added
to Catalyst::Engine::CGI not to its parent Catalyst::Engine.
I am sending patch for this. It could be also fine to drop a line in doc
that something like $c->engine->env->{VARNAME} is available.
--
kmx
--- Catalyst/Engine/CGI.orig
+++ Catalyst/Engine/CGI.pm
@@ -3,7 +3,6 @@
use Moose;
extends 'Catalyst::Engine';
-has env => (is => 'rw');
has _header_buf => (is => 'rw', clearer => '_clear_header_buf',
predicate => '_has_header_buf');
=head1 NAME
--- Catalyst/Engine.orig
+++ Catalyst/Engine.pm
@@ -13,6 +13,8 @@
use namespace::clean -except => 'meta';
+has env => (is => 'rw');
+
# input position and length
has read_length => (is => 'rw');
has read_position => (is => 'rw');