X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=4f92467f6a164e17e2e87be49d250d34da09cf3d;hb=23c63a175ede6c6e335987707a6358f47549bdbc;hp=4255eecb273243c9e77ba36e267ff0516dc372e7;hpb=bb33cb06497384cec8ca0baf49f793cd36cebfe4;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 4255eec..4f92467 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1,9 +1,5 @@ package Catalyst; -# we don't need really need this, but if we load it before MRO::Compat gets -# loaded (via Moose and Class::MOP), we can avoid some nasty warnings -use Class::C3; - use Moose; extends 'Catalyst::Component'; use bytes; @@ -25,7 +21,7 @@ use Time::HiRes qw/gettimeofday tv_interval/; use URI (); use URI::http; use URI::https; -use Scalar::Util qw/weaken blessed/; +use Scalar::Util qw/weaken/; use Tree::Simple qw/use_weak_refs/; use Tree::Simple::Visitor::FindByUID; use attributes; @@ -361,6 +357,13 @@ Almost the same as C, but does a full dispatch, instead of just calling the new C<$action> / C<$class-E$method>. This means that C, C and the method you go to are called, just like a new request. +In addition both C<< $c->action >> and C<< $c->namespace >> are localized. +This means, for example, that $c->action methods such as C, C and +C return information for the visited action when they are invoked +within the visited action. This is different from the behavior of C +which continues to use the $c->action object from the caller action even when +invoked from the callee. + C<$c-Estash> is kept unchanged. In effect, C allows you to "wrap" another action, just as it @@ -1049,8 +1052,33 @@ EOF Scope::Upper::reap(sub { my $meta = Class::MOP::get_metaclass_by_name($class); $meta->make_immutable unless $meta->is_immutable; - }, 1); + }, Scope::Upper::SCOPE(1)); + + $class->setup_finalize; +} + + +=head2 $app->setup_finalize + +A hook to attach modifiers to. +Using C< after setup => sub{}; > doesn't work, because of quirky things done for plugin setup. +Also better than C< setup_finished(); >, as that is a getter method. + + sub setup_finalize { + + my $app = shift; + + ## do stuff, i.e., determine a primary key column for sessions stored in a DB + + $app->next::method(@_); + + + } + +=cut +sub setup_finalize { + my ($class) = @_; $class->setup_finished(1); }