Stephen Adkins > App-Context-0.968 > App::Context::Cmd

Download:
App-Context-0.968.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  3
Open  0
View/Report Bugs
Module Version: 6300   Source  

NAME ^

App::Context::Cmd - context in which we are currently running

SYNOPSIS ^

   # ... official way to get a Context object ...
   use App;
   $context = App->context();
   $config = $context->config();   # get the configuration
   $config->dispatch_events();     # dispatch events

   # ... alternative way (used internally) ...
   use App::Context::Cmd;
   $context = App::Context::Cmd->new();

DESCRIPTION ^

A Context class models the environment (aka "context) in which the current process is running. For the App::Context::Cmd class, this models any of the web application runtime environments which employ the Cmd protocol and produce HTML pages as output. This includes CGI, mod_perl, FastCGI, etc. The difference between these environments is not in the Context but in the implementation of the Request and Response objects.

Methods: ^

user()

The user() method returns the username of the authenticated user. The special name, "guest", refers to the unauthenticated (anonymous) user.

    * Signature: $username = $context->user();
    * Param:  void
    * Return: string
    * Throws: <none>
    * Since:  0.01

    Sample Usage: 

    $username = $context->user();
syntax highlighting: