Amon2::LocalContext - (EXPERIMENTAL)Make context as project local
package MyApp; use parent qw(Amon2::Web); use Amon2::LocalContext; # 'import' method makes something
Normally, Amon2's context is stored in global variable.
This module makes the context to project local.
It means, normally context class using Amon2 use $Amon2::CONTEXT in each project, but context class using Amon2::LocalContext use $MyApp::CONTEXT.
$Amon2::CONTEXT
$MyApp::CONTEXT
This module inserts 3 methods to your context class.
Shorthand for $MyApp::CONTEXT
It's same as:
$MyApp::CONTEXT = $context
Create new context guard class.
Amon2::ContextGuard->new(shift, \$MyApp::CONTEXT);
Some plugin and your code are depended on <Amon2-context>>.
<Amon2-
This behavior will be default at Amon3. (It mean I don't introduce this incompatible behavior to Amon2)
To install Amon2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Amon2
CPAN shell
perl -MCPAN -e shell install Amon2
For more information on module installation, please visit the detailed CPAN module installation guide.