From 880ee820093a922454fb3aeffc07eadc76eeee51 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 24 Sep 2009 23:51:29 -0500 Subject: [PATCH] continuing new cache integration --- docs/gotcha.txt | 12 ++++++++++++ docs/migration.txt | 9 +++++++++ lib/WebGUI/Session.pm | 22 ++++++++++++++++++++++ sbin/testEnvironment.pl | 1 + 4 files changed, 44 insertions(+) diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 90487d3fd..5f71ad524 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -7,6 +7,18 @@ upgrading from one version to the next, or even between multiple versions. Be sure to heed the warnings contained herein as they will save you many hours of grief. +8.0.0 +-------------------------------------------------------------------- + * WebGUI 8 is not API compatible with WebGUI 7. If you have custom + code, chances are you'll need to update it to make it work with + WebGUI 8. + + * WebGUI now requires memcached. + + * WebGUI now requires the following Perl Modules: + - Memcached::libmemcached (0.3102) + + 7.8.0 -------------------------------------------------------------------- diff --git a/docs/migration.txt b/docs/migration.txt index 5e63c0766..c1aafab6a 100644 --- a/docs/migration.txt +++ b/docs/migration.txt @@ -4,3 +4,12 @@ WebGUI 8 Migration Guide The information contained herein documents the API changes that have occurred in the WebGUI 8 development effort and how to migrate your code to accomodate the new APIs. +WebGUI::Cache +============= +WebGUI::Cache has been completely rewritten. If you were using the cache API in the past, you'll need to update your code to reflect the changes. NOTE: you can get a cached reference to the cache object from WebGUI::Session, which will be substantially faster than instantiating the object yourself. + +my $cache = $session->cache; + + + + diff --git a/lib/WebGUI/Session.pm b/lib/WebGUI/Session.pm index 1ffcd69a5..4e0f6ad92 100644 --- a/lib/WebGUI/Session.pm +++ b/lib/WebGUI/Session.pm @@ -109,6 +109,28 @@ sub asset { #------------------------------------------------------------------- +=head2 cache ( ) + +Returns a WebGUI::Cache object, which is connected to the WebGUI memcached server. + +=cut + +sub cache { + my $self = shift; + unless (exists $self->{_cache}) { + my $cache = WebGUI::Cache->new($self); + if (defined $cache) { + $self->{_cache} = $cache; + } + else { + $self->log->fatal("Couldn't connect to WebGUI memcached server, and can't continue without it."); + } + } + return $self->{_cache}; +} + +#------------------------------------------------------------------- + =head2 close Cleans up a WebGUI session information from memory and disconnects from any resources opened by the session. diff --git a/sbin/testEnvironment.pl b/sbin/testEnvironment.pl index 90d0aa07a..8e581afa8 100755 --- a/sbin/testEnvironment.pl +++ b/sbin/testEnvironment.pl @@ -133,6 +133,7 @@ checkModule('Digest::SHA', '5.47' ); checkModule("CSS::Minifier::XS", "0.03" ); checkModule("JavaScript::Minifier::XS", "0.05" ); checkModule("Readonly", "1.03" ); +checkModule("Memcached::libmemcached", "0.3102" ); failAndExit("Required modules are missing, running no more checks.") if $missingModule;