<<

NAME

MT::Request - Movable Type request cache

SYNOPSIS

    use MT::Request;
    my $r = MT::Request->instance;
    $r->cache('foo', $foo);

    ## Later and elsewhere...
    my $foo = $r->cache('foo');

DESCRIPTION

MT::Request is a very simple singleton object which lasts only for one particular request to the application, and thus can be used for caching data that you would like to disappear after the application request exists (and not for the lifetime of the application).

USAGE

MT::Request->instance

Returns the MT::Request singleton.

new

This is an internal method used by MT::Request->instance.

$r->cache($key [, $value ])

Given a key $key, returns the cached value of the key in the cache held by the object $r. Given a value $value and a key $key, sets the value of the key $key in the cache. $value can be a simple scalar, a reference, an object, etc.

$r->stash($key [, $value ])

stash is an alias to cache.

$r->finish()

This method sets the given request ($r) to undef.

$r->reset()

This method sets the request object's __stash attribute to {} (nothing).

AUTHOR & COPYRIGHT

Please see "AUTHOR & COPYRIGHT" in MT.

<<