[Catalyst-commits] r11239 - Catalyst-Runtime/5.80/trunk/lib
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Tue Aug 25 11:26:15 GMT 2009
Author: t0m
Date: 2009-08-25 11:26:15 +0000 (Tue, 25 Aug 2009)
New Revision: 11239
Modified:
Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
Log:
Fix duplicate components
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-08-25 11:25:54 UTC (rev 11238)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-08-25 11:26:15 UTC (rev 11239)
@@ -2153,6 +2153,7 @@
my @comps = sort { length $a <=> length $b }
$class->locate_components($config);
+ my %comps = map { $_ => 1 } @comps;
my $deprecatedcatalyst_component_names = grep { /::[CMV]::/ } @comps;
$class->log->warn(qq{Your application is using the deprecated ::[MVC]:: type naming scheme.\n}.
@@ -2175,6 +2176,7 @@
for my $component (@comps) {
$class->components->{ $component } = $class->setup_component($component);
for my $component ($class->expand_component_module( $component, $config )) {
+ next if $comps{$component};
$class->_controller_init_base_classes($component); # Also cover inner packages
$class->components->{ $component } = $class->setup_component($component);
}
@@ -2221,7 +2223,7 @@
sub expand_component_module {
my ($class, $module) = @_;
- Devel::InnerPackage::list_packages( $module );
+ return Devel::InnerPackage::list_packages( $module );
}
=head2 $c->setup_component
More information about the Catalyst-commits
mailing list