X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=8f4e192128b3f65d50ebd5182ee76c19ffd56197;hb=3a64ecc98bfc0defbba6a510134f87793d059e2d;hp=8dfc175a9e9e22664cc3dce63038eca087009b14;hpb=64d1c3cd4b64ae7018ec3b555cc1a97b589a83ca;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 8dfc175..8f4e192 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -79,7 +79,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.80007'; +our $VERSION = '5.80009'; { my $dev_version = $VERSION =~ /_\d{2}$/; @@ -1175,7 +1175,7 @@ When used as a string, provides a textual URI. If the first argument is a string, it is taken as a public URI path relative to C<< $c->namespace >> (if it doesn't begin with a forward slash) or -relative to the application root (if it does). It is then merged with +relative to the application root (if it does). It is then merged with C<< $c->request->base >>; any C<@args> are appended as additional path components; and any C<%query_values> are appended as C parameters. @@ -1187,13 +1187,13 @@ once the path is resolved, C continues as though a path was provided, appending any arguments or parameters and creating an absolute URI. -The captures for the current request can be found in +The captures for the current request can be found in C<< $c->request->captures >>, and actions can be resolved using C<< Catalyst::Controller->action_for($name) >>. If you have a private action path, use C<< $c->uri_for_action >> instead. # Equivalent to $c->req->uri - $c->uri_for($c->action, $c->req->captures, + $c->uri_for($c->action, $c->req->captures, @{ $c->req->args }, $c->req->params); # For the Foo action in the Bar controller @@ -2154,10 +2154,10 @@ sub setup_components { my @comps = sort { length $a <=> length $b } $class->locate_components($config); - my $deprecated_component_names = grep { /::[CMV]::/ } @comps; + my $deprecatedcatalyst_component_names = grep { /::[CMV]::/ } @comps; $class->log->warn(qq{Your application is using the deprecated ::[MVC]:: type naming scheme.\n}. qq{Please switch your class names to ::Model::, ::View:: and ::Controller: as appropriate.\n} - ) if $deprecated_component_names; + ) if $deprecatedcatalyst_component_names; for my $component ( @comps ) { @@ -2172,9 +2172,12 @@ sub setup_components { $class->_controller_init_base_classes($component); } - for my $component (uniq map { $class->expand_component_module( $_, $config ) } @comps ) { - $class->_controller_init_base_classes($component); # Also cover inner packages + for my $component (@comps) { $class->components->{ $component } = $class->setup_component($component); + for my $component ($class->expand_component_module( $component, $config )) { + $class->_controller_init_base_classes($component); # Also cover inner packages + $class->components->{ $component } = $class->setup_component($component); + } } } @@ -2214,15 +2217,11 @@ sub locate_components { Components found by C will be passed to this method, which is expected to return a list of component (package) names to be set up. -By default, this method will return the component itself as well as any inner -packages found by L. - =cut sub expand_component_module { my ($class, $module) = @_; - my @inner = Devel::InnerPackage::list_packages( $module ); - return ($module, @inner); + Devel::InnerPackage::list_packages( $module ); } =head2 $c->setup_component @@ -2251,10 +2250,10 @@ sub setup_component { my $suffix = Catalyst::Utils::class2classsuffix( $component ); my $config = $class->config->{ $suffix } || {}; - # Stash _component_name in the config here, so that custom COMPONENT + # Stash catalyst_component_name in the config here, so that custom COMPONENT # methods also pass it. local to avoid pointlessly shitting in config # for the debug screen, as $component is already the key name. - local $config->{_component_name} = $component; + local $config->{catalyst_component_name} = $component; my $instance = eval { $component->COMPONENT( $class, $config ); };