[Catalyst-commits] r13419 -
Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib
arcanez at dev.catalyst.perl.org
arcanez at dev.catalyst.perl.org
Sat Jul 24 21:40:41 GMT 2010
Author: arcanez
Date: 2010-07-24 22:40:41 +0100 (Sat, 24 Jul 2010)
New Revision: 13419
Modified:
Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst.pm
Log:
add setup_config method to instantiate the B::B container and get a $config from it
Modified: Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst.pm 2010-07-24 03:39:11 UTC (rev 13418)
+++ Catalyst-Runtime/5.80/branches/gsoc_breadboard/lib/Catalyst.pm 2010-07-24 21:40:41 UTC (rev 13419)
@@ -1087,6 +1087,7 @@
}
}
+ $class->setup_config();
$class->setup_home( delete $flags->{home} );
$class->setup_log( delete $flags->{log} );
@@ -2385,6 +2386,30 @@
sub setup_actions { my $c = shift; $c->dispatcher->setup_actions( $c, @_ ) }
+=head2 $c->setup_config
+
+=cut
+
+sub setup_config {
+ my $class = shift;
+
+ my %args = %{$class->config || {} };
+ my @container_classes = qw/MyApp::Container Catalyst::Container/;
+ unshift @container_classes, delete $args{container_class} if exists $args{container_class};
+
+ my $container_class = Class::MOP::load_first_existing_class(@container_classes);
+
+ my $config = $container_class->new( %args, name => "$class" )->fetch('config')->get;
+ $class->config($config);
+ $class->finalize_config; # back-compat
+}
+
+=head $c->finalize_config
+
+=cut
+
+sub finalize_config { }
+
=head2 $c->setup_components
This method is called internally to set up the application's components.
More information about the Catalyst-commits
mailing list