<<

NAME

MT::Memcached - Handy wrapper class for Cache::Memcached

SYNOPSIS

    my $cache = MT::Memcached->instance;
    my $data = $cache->get($key);
    $cache->set($key => $value);

DESCRIPTION

MT::Memcached provides a singleton wrapper interface around Cache::Memcached. It automatically loads up the Cache::Memcached object with the server information defined in the Movable Type configuration file, in the MemcachedServers variable.

If your server environment doesn't have Cache::Memcached installed, or if no MemcachedServers are defined in your configuration, all of the methods on this class are essentially no-ops. This is handy from the perspective of the calling code, because it can act the same way whether or not there's a cache defined.

USAGE

See the Cache::Memcached documentation for information on the available methods.

In addition, this class defines the following:

MT::Memcached->instance

Returns the singleton object (a MT::Memcached object).

MT::Memcached->is_available

Returns true if there are memcached servers defined in your Movable Type configuration and if the Cache::Memcached module can be loaded.

MT::Memcached->cleanup

Removes the singleton instance of the class, and disconnects any open connections to memcached.

AUTHOR & COPYRIGHT

Please see "AUTHOR & COPYRIGHT" in MT.

<<