From: Tomas Doran Date: Wed, 8 Jul 2009 22:12:29 +0000 (+0000) Subject: More ->config fixes + Changelog X-Git-Tag: 5.80008~68 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=9779c885c17ff277c42aea35bd95f48284ae502f More ->config fixes + Changelog --- diff --git a/Changes b/Changes index 3007774..1f7df0a 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,8 @@ Bug fixes: - Fix replace_constructor warning to actually work if you make your application class immutable without that option. + - Fix POD to refer to ->config(key => $val), rather than + ->config->{key} = $val, as the latter form is deprecated. Refactoring / cleanups: - Deleted the Restarter engine and its Watcher code. Use the diff --git a/lib/Catalyst/Component.pm b/lib/Catalyst/Component.pm index f0a6d60..2decf10 100644 --- a/lib/Catalyst/Component.pm +++ b/lib/Catalyst/Component.pm @@ -157,9 +157,10 @@ If this method is present (as it is on all Catalyst::Component subclasses, it is called by Catalyst during setup_components with the application class as $c and any config entry on the application for this component (for example, in the case of MyApp::Controller::Foo this would be -MyApp->config->{'Controller::Foo'}). The arguments are expected to be a -hashref and are merged with the __PACKAGE__->config hashref before calling -->new to instantiate the component. +C<< MyApp->config('Controller::Foo' => \%conf >>). +The arguments are expected to be a hashref and are merged with the +C<< __PACKAGE__->config >> hashref before calling C<< ->new >> +to instantiate the component. You can override it in your components to do custom instantiation, using something like this: diff --git a/lib/Catalyst/Request.pm b/lib/Catalyst/Request.pm index b16e59a..643a298 100644 --- a/lib/Catalyst/Request.pm +++ b/lib/Catalyst/Request.pm @@ -473,7 +473,7 @@ Reads a chunk of data from the request body. This method is intended to be used in a while loop, reading $maxlength bytes on every call. $maxlength defaults to the size of the request if not specified. -You have to set MyApp->config->{parse_on_demand} to use this directly. +You have to set MyApp->config(parse_on_demand => 1) to use this directly. =head2 $req->referer @@ -649,7 +649,7 @@ You may also pass an optional second parameter that puts C into append mode: $req->uri_with( { key => 'value' }, { mode => 'append' } ); - + See C for an explanation of this behavior. =cut