X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalystX%2FGlobalContext.pm;h=a5dbfd0b21e20d5289e0b6bd64f2bf3e5f60600f;hb=bef5bffc1e2bbd5e907e3e8010aed6de0c3054be;hp=579e08e17ab09bc6955abed0f3326a0b99b1ff7f;hpb=32b32c6209c69a810c2d0b66a8cfc6efcae66d32;p=catagits%2FCatalyst-Controller-WrapCGI.git diff --git a/lib/CatalystX/GlobalContext.pm b/lib/CatalystX/GlobalContext.pm index 579e08e..a5dbfd0 100644 --- a/lib/CatalystX/GlobalContext.pm +++ b/lib/CatalystX/GlobalContext.pm @@ -6,17 +6,16 @@ use parent 'Exporter'; use Scalar::Util 'weaken'; +use vars '$c'; +our @EXPORT_OK = '$c'; + =head1 NAME CatalystX::GlobalContext - Export Catalyst Context -=head1 VERSION - -Version 0.01 - =cut -our $VERSION = '0.01'; +our $VERSION = '0.030'; =head1 SYNOPSIS @@ -24,12 +23,12 @@ our $VERSION = '0.01'; use CatalystX::GlobalContext (); - sub auto { + sub auto : Private { my ($self, $c) = @_; - CatalystX::GlobalContext->set_context($c); + CatalystX::GlobalContext->set_context($c); 1; } - + package Some::Other::Module; use CatalystX::GlobalContext '$c'; @@ -40,16 +39,17 @@ our $VERSION = '0.01'; =head1 DESCRIPTION -This module, in combination with L is for helping -you run legacy mod_perl code in L. +This module, in combination with L or +L is for helping you run legacy mod_perl code in +L. You save a copy of $c somewhere at the beginning of the request cycle, and it is then accessible through an export where you need it. -You can then rip out Apache:: type things, and replace them with things based on -$c. +You can then rip out C type things, and replace them with things based on +C<$c>. -What we really need is a set of Apache:: compatibility classes, but that doesn't +What we really need is a set of C compatibility classes, but that doesn't exist yet. DO NOT USE THIS MODULE IN NEW CODE @@ -68,9 +68,10 @@ sub set_context { weaken $c; } -=head1 AUTHOR +=head1 SEE ALSO -Rafael Kitover, C<< >> +L, L, +L =head1 BUGS @@ -104,9 +105,15 @@ L =back +=head1 AUTHOR + +See L and +L. + =head1 COPYRIGHT & LICENSE -Copyright (c) 2008 Rafael Kitover +Copyright (c) 2008-2009 L and +L. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.