Catalyst::TraitFor::Context::PSGI::FindEnv - Hunt down our PSGI environment, even in 5.8x
This document describes version 0.002 of Catalyst::TraitFor::Context::PSGI::FindEnv - released April 24, 2015 as part of Catalyst-TraitFor-Context-PSGI-FindEnv.
This is a Catalyst context trait that aids in finding a PSGI environment, if one is available, even in a 5.8x environment.
Note the key part about "if one is available" :) This is not always the case under 5.8x.
This method will attempt to locate and return the PSGI environment hashref. If one is not found, nothing will be returned.
Neither CatalystX::Component::Traits nor CatalystX::RoleApplicator handle applying context class traits at the moment.
with 'Catalyst::TraitFor::Context::PSGI::FindEnv';
If you're only enabling this for debug purposes, it might be better to
conditionalize this in your app.psgi
, with something like:
Catalyst::TraitFor::Context::PSGI::FindEnv
->meta
->apply(Class::MOP::class_of('MyApp'))
;
...or, as that's a bit of a mouthful:
use Moose::Util 'ensure_all_roles';
ensure_all_roles MyApp => 'Catalyst::TraitFor::Context::PSGI::FindEnv';
Both do the same thing (for generally indistinguishable values of "same thing").
Note that your application class will need to be mutable (that is, not immutable) for these approaches to work.
The development version is on github at http://https://github.com/RsrchBoy/catalyst-traitfor-context-psgi-findenv and may be cloned from git://https://github.com/RsrchBoy/catalyst-traitfor-context-psgi-findenv.git
Please report any bugs or feature requests on the bugtracker website https://github.com/RsrchBoy/catalyst-traitfor-context-psgi-findenv/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Chris Weyl [email protected]
Please note I do not expect to be gittip'ed or flattr'ed for this work, rather it is simply a very pleasant surprise. I largely create and release works like this because I need them or I find it enjoyable; however, don't let that stop you if you feel like it ;)
Flattr this, gittip me, or indulge my Amazon Wishlist... If you so desire.
stevecaldwell77 [email protected]
This software is Copyright (c) 2012 by Campus Explorer, Inc.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999