NAME

OpenInteract2::Setup::InitializeCache - Initialize the cache

SYNOPSIS

my $setup = OpenInteract2::Setup->new( 'initialize cache' );
$setup->run();

my $cache = CTX->cache;
$cache->set({ key => 'foo', data => { bar => 'baz' } });

DESCRIPTION

This setup action first checks the 'cache.use' server configuration key. If set to anything but 'yes' the action does nothing, since you don't want to use a cache.

Otherwise it:

  • Brings in the class referenced in 'cache.class'.

  • Instantiates a new cache object by passing in the 'cache' configuration to new() on that class.

  • If the key 'cache.cleanup' is set to 'yes' it calls purge() on the just-created cache object.

  • Finally, it assigns the cache object to the context with the cache() method.

Setup Metadata

name - 'initialize cache'

dependencies - default

SEE ALSO

OpenInteract2::Setup

OpenInteract2::Cache

COPYRIGHT

Copyright (c) 2005 Chris Winters. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Chris Winters <chris@cwinters.com>