Skip to content

rsrchboy/catalyst-traitfor-context-psgi-findenv

 
 

Repository files navigation

Build Status Kwalitee status

NAME

Catalyst::TraitFor::Context::PSGI::FindEnv - Hunt down our PSGI environment, even in 5.8x

VERSION

This document describes version 0.002 of Catalyst::TraitFor::Context::PSGI::FindEnv - released April 24, 2015 as part of Catalyst-TraitFor-Context-PSGI-FindEnv.

DESCRIPTION

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.

METHODS

psgi_env

This method will attempt to locate and return the PSGI environment hashref. If one is not found, nothing will be returned.

TRAIT APPLICATION

Neither CatalystX::Component::Traits nor CatalystX::RoleApplicator handle applying context class traits at the moment.

Directly in your application class

with 'Catalyst::TraitFor::Context::PSGI::FindEnv';

In your PSGI file

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.

SOURCE

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

BUGS

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.

AUTHOR

Chris Weyl cweyl@alumni.drew.edu

I'm a material boy in a material world

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.

CONTRIBUTOR

stevecaldwell77 steve-github@caldwellhb.com

COPYRIGHT AND LICENSE

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

About

Catalyst::TraitFor::Context::PSGI::FindEnv

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Perl 100.0%