FAQ
Hi,

Is there a way to access values set in the PSGI "env" store, once
you're operating inside a catalyst controller method?

Catalyst::Engine::PSGI looks like it is passing the $env variable
along, but I haven't worked out how to access it.
I thought $c->request->env would do the trick, but that method (->env)
doesn't exist.

Any hints? Or is this something I should be leaving alone? ;)

Cheers,
Toby


--
Turning and turning in the widening gyre
The falcon cannot hear the falconer
Things fall apart; the center cannot hold
Mere anarchy is loosed upon the world

Search Discussions

  • Toby Corkindale at Oct 21, 2011 at 6:46 am
    Answering my own question here..
    Stuff was hidden in:

    $c->engine->env->{...};

    I know this isn't very portable, but it's for an internal app where
    being able to pass some extra info through from the plack middleware
    will be very helpfu.

    I'm curious though - How would you suggest such stuff is handled?

    cheers,
    Toby
    On 21 October 2011 17:11, Toby Corkindale wrote:
    Hi,

    Is there a way to access values set in the PSGI "env" store, once
    you're operating inside a catalyst controller method?

    Catalyst::Engine::PSGI looks like it is passing the $env variable
    along, but I haven't worked out how to access it.
    I thought $c->request->env would do the trick, but that method (->env)
    doesn't exist.

    Any hints? Or is this something I should be leaving alone? ;)

    Cheers,
    Toby


    --
    Turning and turning in the widening gyre
    The falcon cannot hear the falconer
    Things fall apart; the center cannot hold
    Mere anarchy is loosed upon the world


    --
    Turning and turning in the widening gyre
    The falcon cannot hear the falconer
    Things fall apart; the center cannot hold
    Mere anarchy is loosed upon the world
  • Roberto Henríquez at Oct 21, 2011 at 8:13 am

    On 10/21/11 08:46, Toby Corkindale wrote:
    Answering my own question here..
    Stuff was hidden in:

    $c->engine->env->{...};

    I know this isn't very portable, but it's for an internal app where
    being able to pass some extra info through from the plack middleware
    will be very helpfu.

    I'm curious though - How would you suggest such stuff is handled?

    cheers,
    Toby

    On 21 October 2011 17:11, Toby Corkindalewrote:
    Hi,

    I guess the "right" way to deal with this would be to wrap that code in
    a component which you'd later use from your Catalyst app, thus
    decoupling them and keeping your code portable.

    For example, that's what Catalyst::Plugin::Session::PSGI aims to do. You
    access the session as usual and the "dirty" details are handled by the
    plugin and its config.

    cheers,

    --
    Roberto Henr?quez
    roberto@freekeylabs.com
  • Chisel at Oct 22, 2011 at 12:15 pm

    On Fri, Oct 21, 2011 at 9:14 AM, Roberto Henriquez wrote:


    For example, that's what Catalyst::Plugin::Session::PSGI aims to do. You
    access the session as usual and the "dirty" details are handled by the
    plugin and its config.
    Catalyst::Plugin::Session::PSGI has worked in the cases I've tried, which
    shouldn't be surprising as I wrote the module to meet my own requirements.
    :)

    I've flagged this module as experimental because I know there are a couple
    of places where I've probably abused or misunderstood the best way to solve
    the problem I had. I'm worried that there are sharp edges and stupid bugs in
    places I simply haven't considered yet.

    I'm always happy to receive feedback, constructive criticism and patches on
    my modules and I'd really like to get some feedback, better solutions and
    tests so that I feel more comfortable dropping the experimental warning in
    the future.

    Chiz
    --
    Chisel
    e: chisel@chizography.net
    w: http://chizography.net
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20111022/399d0be8/attachment.htm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedOct 21, '11 at 6:11a
activeOct 22, '11 at 12:15p
posts4
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2021 Grokbase