From: Tomas Doran Date: Fri, 20 Nov 2009 01:09:14 +0000 (+0000) Subject: Merge 'trunk' into 'better_scripts' X-Git-Tag: 5.80014_02~39 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=3d8f8cd53cb78fbf4d492377e39da6b0148515b4;hp=-c Merge 'trunk' into 'better_scripts' r11361@tomas-dorans-macbook-pro (orig r11331): t0m | 2009-09-07 15:45:01 +0100 Fix hash key name back to what it used to be for compat, keeping renamed accessor where it was. Tests for this breakage to follow r11363@tomas-dorans-macbook-pro (orig r11333): t0m | 2009-09-07 21:19:40 +0100 Test for r11331 + fix to only report each action name once from get_action_methods r11364@tomas-dorans-macbook-pro (orig r11334): t0m | 2009-09-07 21:21:52 +0100 I'm an idiot, that totally doesn't work. remove. r11365@tomas-dorans-macbook-pro (orig r11335): t0m | 2009-09-07 21:25:53 +0100 AGH. Too tired to be doing this, fucked it up again r11366@tomas-dorans-macbook-pro (orig r11336): t0m | 2009-09-07 21:33:31 +0100 Fix duplicate results from get_action_methods. Q. Why didn't I just do that first time round? A: Am idiot. r11369@tomas-dorans-macbook-pro (orig r11339): marcus | 2009-09-09 18:05:32 +0100 un-TODO passing TODO tests r11370@tomas-dorans-macbook-pro (orig r11340): marcus | 2009-09-09 18:08:03 +0100 Prepare for release r11374@tomas-dorans-macbook-pro (orig r11344): groditi | 2009-09-09 22:06:59 +0100 add myself to contributors r11375@tomas-dorans-macbook-pro (orig r11345): t0m | 2009-09-10 01:13:56 +0100 Fix warnings in upcoming moose r11377@tomas-dorans-macbook-pro (orig r11347): t0m | 2009-09-10 02:14:13 +0100 r11046@t0mlaptop (orig r11045): yousef | 2009-08-07 00:07:07 +0100 Moved action methods from t/lib/TestApp.pm to t/lib/Test/Controller/Root.pm. Uncommented the if statement in lib/Catalyst/Controller.pm that checks for actions in the appclass. r11378@tomas-dorans-macbook-pro (orig r11348): t0m | 2009-09-10 02:20:55 +0100 Eat the merge mark, svk hates me. r11379@tomas-dorans-macbook-pro (orig r11349): t0m | 2009-09-10 03:13:04 +0100 Blargh. Merge branch deprecate_appclass_actions manually, with svn merge http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/5.80/trunk http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/5.80/branches/deprecate_appclass_actions . after I forgot -l on svk push, but ctrl-C after the first rev meant svk had already committed a merge mark and re-merging did nothing, and removing it didn't do the right thing. Fail cake.. r11380@tomas-dorans-macbook-pro (orig r11350): hobbs | 2009-09-10 08:20:31 +0100 Rework the C<< $c->go >> documentation a little, hopefully it's more clear. r11382@tomas-dorans-macbook-pro (orig r11352): autarch | 2009-09-11 03:48:29 +0100 Preserve immutable_options when temporarily making a class mutable r11383@tomas-dorans-macbook-pro (orig r11353): t0m | 2009-09-11 09:18:09 +0100 Work with old and new Moose r11393@tomas-dorans-macbook-pro (orig r11363): autarch | 2009-09-14 19:37:25 +0100 The warning about a class having mutable ancestors has been removed (and was never in a non-dev Moose release) r11396@tomas-dorans-macbook-pro (orig r11366): t0m | 2009-09-15 21:48:19 +0100 Remove what is now lies from Changes. Bump all the deps which need to be bumped to not crap warnings everywhere r11399@tomas-dorans-macbook-pro (orig r11369): t0m | 2009-09-16 18:14:29 +0100 Changelog r11400@tomas-dorans-macbook-pro (orig r11370): t0m | 2009-09-16 18:15:52 +0100 Now we depend on latest Moose we are certain to have immutable options r11401@tomas-dorans-macbook-pro (orig r11371): t0m | 2009-09-17 09:52:34 +0100 -short is dead, RT#49771 r11402@tomas-dorans-macbook-pro (orig r11372): t0m | 2009-09-17 09:52:52 +0100 Add note about actions in appclass being deprecated r11403@tomas-dorans-macbook-pro (orig r11373): t0m | 2009-09-17 09:54:45 +0100 Add note about ::[MVC]:: warnings r11404@tomas-dorans-macbook-pro (orig r11374): t0m | 2009-09-17 09:58:15 +0100 Re-space current release changelog to align with the rest. Move -short changelog to the right place. r11405@tomas-dorans-macbook-pro (orig r11375): rafl | 2009-09-17 10:33:28 +0100 Version 5.80013. r11407@tomas-dorans-macbook-pro (orig r11377): t0m | 2009-09-17 14:32:16 +0100 Well, that got forgotten, oops r11426@tomas-dorans-macbook-pro (orig r11396): rafl | 2009-09-20 15:01:45 +0100 Fix a syntax error in the ContextClosure pod. r11427@tomas-dorans-macbook-pro (orig r11397): rafl | 2009-09-20 15:01:51 +0100 Use clean instead of autoclean in the ContextClosure synopsis until we've fixed the issues with that and MXMA. r11428@tomas-dorans-macbook-pro (orig r11398): gbjk | 2009-09-21 15:05:17 +0100 - Fix go / visit expecting captures and arguments in reverse order. r11429@tomas-dorans-macbook-pro (orig r11399): mateu | 2009-09-21 19:57:14 +0100 Update $c->forward and $c->state documentation to address scalar context. r11430@tomas-dorans-macbook-pro (orig r11400): t0m | 2009-09-23 15:48:06 +0100 Dep bump r11452@tomas-dorans-macbook-pro (orig r11422): t0m | 2009-09-25 13:03:50 +0100 Remove warnings for using Catalyst::Dispatcher->dispatch_types r11459@tomas-dorans-macbook-pro (orig r11429): t0m | 2009-09-27 13:27:41 +0100 Optional test not optional for authors r11460@tomas-dorans-macbook-pro (orig r11430): t0m | 2009-09-27 13:33:05 +0100 Make r11422 not break stuff - idiot :( r11487@tomas-dorans-macbook-pro (orig r11457): t0m | 2009-10-05 22:59:47 +0100 r11483@t0mlaptop (orig r11453): abraxxa | 2009-10-05 12:57:34 +0100 Improved the suggested fix warning when component resolution uses regex fallback for fully qualified component names. Added disable_component_resolution_regex_fallback config option to switch off regex fallback for component resolution. r11488@tomas-dorans-macbook-pro (orig r11458): t0m | 2009-10-05 22:59:52 +0100 r11486@t0mlaptop (orig r11456): t0m | 2009-10-05 22:59:01 +0100 Tidy up changelog/attribution r11503@tomas-dorans-macbook-pro (orig r11468): ilmari | 2009-10-06 16:30:41 +0100 Set ->request on the response object i Catalyst::Test::local_request--This line, and those below, will be ignored-- M t/unit_load_catalyst_test.t M lib/Catalyst/Test.pm M Changes r11519@tomas-dorans-macbook-pro (orig r11484): phaylon | 2009-10-07 18:21:47 +0100 added stub config section (incl TODO) to Cat.pm for things like 'current_view' r11548@tomas-dorans-macbook-pro (orig r11513): caelum | 2009-10-12 17:18:22 +0100 fix uninitialized warning in ACL r11549@tomas-dorans-macbook-pro (orig r11514): caelum | 2009-10-12 17:22:08 +0100 better fix for uninitialized warning r11550@tomas-dorans-macbook-pro (orig r11515): t0m | 2009-10-12 18:10:32 +0100 Less cargo cult madness r11554@tomas-dorans-macbook-pro (orig r11519): caelum | 2009-10-13 15:37:02 +0100 more correct fix for uninitialized warning from ACL r11556@tomas-dorans-macbook-pro (orig r11521): dhoss | 2009-10-14 01:14:42 +0100 Snow Leopard uses COPYFILE_DISABLE r11557@tomas-dorans-macbook-pro (orig r11522): dhoss | 2009-10-14 01:20:06 +0100 fixed regex for next mac codename/version, will have to actually figure out what the 10.7 codename is when it arrives r11558@tomas-dorans-macbook-pro (orig r11523): dhoss | 2009-10-14 01:23:45 +0100 Attempted to make the error message more obvious r11561@tomas-dorans-macbook-pro (orig r11526): dhoss | 2009-10-14 01:50:26 +0100 fixed error message for mac osx 10.7 r11568@tomas-dorans-macbook-pro (orig r11533): hobbs | 2009-10-15 03:32:28 +0100 Give people a pointer to chase if they're looking for info on $c->req->user r11574@tomas-dorans-macbook-pro (orig r11539): t0m | 2009-10-15 22:19:26 +0100 Add docs I promised for r11484 r11622@tomas-dorans-macbook-pro (orig r11587): jshirley | 2009-10-16 21:06:19 +0100 The longawaited nginx patch to support non-root apps, and some pod r11623@tomas-dorans-macbook-pro (orig r11588): jshirley | 2009-10-16 21:07:29 +0100 Changes for nginx patches r11624@tomas-dorans-macbook-pro (orig r11589): jshirley | 2009-10-16 21:08:55 +0100 My favorite color is clear and I like to eat rocks r11670@tomas-dorans-macbook-pro (orig r11635): t0m | 2009-10-19 18:02:59 +0100 Remove warnings from duplicate action declerations r11675@tomas-dorans-macbook-pro (orig r11640): poisonbit | 2009-10-20 21:12:46 +0100 Example added to #Actions_in_your_application_class r11676@tomas-dorans-macbook-pro (orig r11641): poisonbit | 2009-10-20 21:32:41 +0100 Formating (a lost space and line break) r11677@tomas-dorans-macbook-pro (orig r11642): poisonbit | 2009-10-20 21:34:45 +0100 More regresion from 11640, correcting parentheses and endpoint. r11678@tomas-dorans-macbook-pro (orig r11643): poisonbit | 2009-10-20 22:08:47 +0100 Change in actions inside roles. http://bobtfish.livejournal.com/264317.html r11679@tomas-dorans-macbook-pro (orig r11644): poisonbit | 2009-10-20 23:16:03 +0100 Fixes to pass podchecker OK r11714@tomas-dorans-macbook-pro (orig r11679): rafl | 2009-10-28 23:54:56 +0000 Enable Catalyst::Utils::home() to find home within Dist::Zilla built dists. Courtesy of nperez. r11716@tomas-dorans-macbook-pro (orig r11681): t0m | 2009-10-29 00:43:07 +0000 Make URI a link to make it super obvious r11796@tomas-dorans-macbook-pro (orig r11761): t0m | 2009-11-05 00:11:15 +0000 Need newer LWP for tests to pass as suggested on list by Jose Luis Martinez r11811@tomas-dorans-macbook-pro (orig r11776): altreus | 2009-11-06 17:09:51 +0000 Add doc for no-args call to ->uri_for r11813@tomas-dorans-macbook-pro (orig r11778): dhoss | 2009-11-06 17:13:27 +0000 fixed options passed to devel server so that author tests pass r11814@tomas-dorans-macbook-pro (orig r11779): altreus | 2009-11-06 17:14:49 +0000 Amend doc to not mention using undef in ->uri_for r11816@tomas-dorans-macbook-pro (orig r11781): t0m | 2009-11-07 16:50:59 +0000 Back out change from -port to -l - svn merge -r 11778:11777 r11823@tomas-dorans-macbook-pro (orig r11788): rafl | 2009-11-09 22:21:19 +0000 Make request->body fail when used as a writer. r11824@tomas-dorans-macbook-pro (orig r11789): t0m | 2009-11-10 19:51:33 +0000 Fix changelog, me-- r11825@tomas-dorans-macbook-pro (orig r11790): t0m | 2009-11-10 19:56:09 +0000 Warn on case_sensitive being set, remove documentation r11827@tomas-dorans-macbook-pro (orig r11792): t0m | 2009-11-10 21:36:06 +0000 Return 1, only currently works by chance r11828@tomas-dorans-macbook-pro (orig r11793): t0m | 2009-11-10 21:37:26 +0000 Also retarded r11829@tomas-dorans-macbook-pro (orig r11794): t0m | 2009-11-10 21:41:27 +0000 And lets not change behaviour with the log flush change.. r11836@tomas-dorans-macbook-pro (orig r11801): t0m | 2009-11-12 01:12:05 +0000 Bring the changelog up to date. r11839@tomas-dorans-macbook-pro (orig r11804): t0m | 2009-11-12 01:44:46 +0000 r11462@t0mlaptop (orig r11432): rafl | 2009-09-27 16:06:26 +0100 More aggregated tests. r11463@t0mlaptop (orig r11433): rafl | 2009-09-27 16:06:36 +0100 Fix a couple of aggregation warnings. r11464@t0mlaptop (orig r11434): rafl | 2009-09-27 16:06:51 +0100 More aggregation. r11465@t0mlaptop (orig r11435): rafl | 2009-09-27 16:28:04 +0100 Make things run again with aggregation disabled. r11838@t0mlaptop (orig r11803): t0m | 2009-11-12 01:39:56 +0000 Patch up changes to tests into new location. This merges parts of the following commits which were missed by svk: -r11456:11457 http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/5.80/trunk -r11467:11468 http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/5.80/trunk r11841@tomas-dorans-macbook-pro (orig r11806): bricas | 2009-11-12 17:58:02 +0000 remove duplicate changelog entry r11847@tomas-dorans-macbook-pro (orig r11812): t0m | 2009-11-12 23:57:15 +0000 r11668@t0mlaptop (orig r11633): t0m | 2009-10-19 17:53:27 +0100 Branch for uri encoding things in uri_for in some way that means you can round trip path parts like '24/7', but without totally breaking backward compatibility this time hopefully. r11669@t0mlaptop (orig r11634): t0m | 2009-10-19 17:54:08 +0100 Well, this fixes my current issue, and doesn't seem to break any tests.. This likely means that the tests are still shit r11769@t0mlaptop (orig r11734): t0m | 2009-11-04 19:17:33 +0000 Needed for authors to run optional http test r11833@t0mlaptop (orig r11798): t0m | 2009-11-12 00:22:06 +0000 Tests, fix args as well as captureargs and be less violent - only encode / r11840@t0mlaptop (orig r11805): rafl | 2009-11-12 16:08:57 +0000 trailing whitespace r11843@t0mlaptop (orig r11808): t0m | 2009-11-12 23:41:17 +0000 Tidy up a bit r11845@t0mlaptop (orig r11810): t0m | 2009-11-12 23:46:28 +0000 Changelog r11846@t0mlaptop (orig r11811): t0m | 2009-11-12 23:56:36 +0000 Don't fail the live tests by only looking for http://localhost/etc.. r11858@tomas-dorans-macbook-pro (orig r11823): t0m | 2009-11-14 17:26:04 +0000 Pod patch r11860@tomas-dorans-macbook-pro (orig r11825): t0m | 2009-11-14 17:30:26 +0000 Pod fixes re RT#51489 r11914@tomas-dorans-macbook-pro (orig r11879): rafl | 2009-11-17 23:00:32 +0000 Merge branch 'exception_interface' * exception_interface: Use MooseX::Role::WithOverloading. Add Exception::Interface and Exception::Basic. Make ::Base, ::Go and ::Detach use them. Create branch exception_interface r11953@tomas-dorans-macbook-pro (orig r11918): t0m | 2009-11-19 21:58:59 +0000 Add Pod for all the new exception classes r11954@tomas-dorans-macbook-pro (orig r11919): t0m | 2009-11-19 22:00:27 +0000 Rename http server test as it is not optional for authors --- 3d8f8cd53cb78fbf4d492377e39da6b0148515b4 diff --combined Makefile.PL index 1bede30,fe7a723..b98a180 --- a/Makefile.PL +++ b/Makefile.PL @@@ -1,27 -1,29 +1,30 @@@ use strict; use warnings; use inc::Module::Install 0.87; - BEGIN { # Make it easy for newbies - if ($Module::Install::AUTHOR) { - require Module::Install::AuthorRequires; - require Module::Install::CheckConflicts; - require Module::Install::AuthorTests; - } + { # Ensure that these get used - yes, M::I loads them for us, but if you're + # in author mode and don't have them installed, then the error is tres + # cryptic. + no warnings 'redefine'; + use Module::Install::AuthorRequires; + use Module::Install::CheckConflicts; + use Module::Install::AuthorTests; } + perl_version '5.008004'; name 'Catalyst-Runtime'; all_from 'lib/Catalyst/Runtime.pm'; requires 'List::MoreUtils'; - requires 'namespace::autoclean'; + requires 'namespace::autoclean' => '0.09'; requires 'namespace::clean'; +requires 'namespace::autoclean'; requires 'B::Hooks::EndOfScope' => '0.08'; - requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00801'; + requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00903'; requires 'Class::MOP' => '0.83'; - requires 'Moose' => '0.78'; - requires 'MooseX::MethodAttributes::Inheritable' => '0.15'; + requires 'Moose' => '0.90'; + requires 'MooseX::MethodAttributes::Inheritable' => '0.17'; + requires 'MooseX::Role::WithOverloading'; requires 'Carp'; requires 'Class::C3::Adopt::NEXT' => '0.07'; requires 'CGI::Simple::Cookie'; @@@ -29,8 -31,8 +32,8 @@@ requires 'Data::Dump' requires 'HTML::Entities'; requires 'HTTP::Body' => '1.04'; # makes uploadtmp work requires 'HTTP::Headers' => '1.64'; - requires 'HTTP::Request'; - requires 'HTTP::Response'; + requires 'HTTP::Request' => '5.814'; + requires 'HTTP::Response' => '5.813'; requires 'HTTP::Request::AsCGI' => '0.8'; requires 'LWP::UserAgent'; requires 'Module::Pluggable' => '3.9'; @@@ -45,12 -47,13 +48,13 @@@ requires 'URI' => '1.35' requires 'Task::Weaken'; requires 'Text::Balanced'; # core in 5.8.x but mentioned for completeness requires 'MRO::Compat'; +requires 'MooseX::Getopt'; +requires 'MooseX::Types'; requires 'String::RewritePrefix' => '0.004'; # Catalyst::Utils::resolve_namespace -recommends 'B::Hooks::OP::Check::StashChange'; - test_requires 'Class::Data::Inheritable'; test_requires 'Test::Exception'; + test_requires 'Test::More' => '0.88'; # aggregate tests if AGGREGATE_TESTS is set and a recent Test::Aggregate and a Test::Simple it works with is available if ($ENV{AGGREGATE_TESTS} && can_use('Test::Simple', '0.88') && can_use('Test::Aggregate', '0.35_05')) { @@@ -62,6 -65,8 +66,8 @@@ else grep { $_ ne 't/aggregate.t' } map { glob } qw[t/*.t t/aggregate/*.t]; } + author_requires 'CatalystX::LeakChecker', '0.03'; # Skipped if this isn't installed + author_requires 'File::Copy::Recursive'; # For http server test author_tests 't/author'; author_requires(map {; $_ => 0 } qw( @@@ -108,6 -113,7 +114,7 @@@ EO # NOTE - This is the version number of the _incompatible_ code, # not the version number of the fixed version. my %conflicts = ( + 'Catalyst::Model::Akismet' => '0.02', 'Catalyst::Component::ACCEPT_CONTEXT' => '0.06', 'Catalyst::Plugin::ENV' => '9999', # This plugin is just stupid, full stop # should have been a core fix. @@@ -146,8 -152,8 +153,8 @@@ sub darwin_check_no_resource_forks # TAR on 10.4 wants COPY_EXTENDED_ATTRIBUTES_DISABLE # On 10.5 (Leopard) it wants COPYFILE_DISABLE - die("Oh, you got Snow Lepoard, snazzy. Please read the man page for tar to find out if Apple renamed COPYFILE_DISABLE again and fix this Makefile.PL please?\n") if $osx_ver =~ /^10.6/; - my $attr = $osx_ver =~ /^10.5/ ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE'; + die("Oh, you got Ceiling Cat, snazzy. Please read the man page for tar or Google to find out if Apple renamed COPYFILE_DISABLE (it was COPY_EXTENDED_ATTRIBUTES_DISABLE originally) again and fix this Makefile.PL please?\n") if $osx_ver =~ /^10.7/; + my $attr = $osx_ver =~ /^10.(5|6)/ ? 'COPYFILE_DISABLE' : 'COPY_EXTENDED_ATTRIBUTES_DISABLE'; makemaker_args(dist => { PREOP => qq{\@if [ "\$\$$attr" != "true" ]; then}. qq{ echo "You must set the ENV variable $attr to true,"; }. diff --combined lib/Catalyst.pm index 56f0f93,6e74e58..5d8de24 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@@ -79,7 -79,7 +79,7 @@@ __PACKAGE__->stats_class('Catalyst::Sta # Remember to update this in Catalyst::Runtime as well! - our $VERSION = '5.80011'; + our $VERSION = '5.80013'; { my $dev_version = $VERSION =~ /_\d{2}$/; @@@ -349,6 -349,21 +349,21 @@@ Or make sure to always return true valu your code like this: $c->forward('foo') || return; + + Another note is that C<< $c->forward >> always returns a scalar because it + actually returns $c->state which operates in a scalar context. + Thus, something like: + + return @array; + + in an action that is forwarded to is going to return a scalar, + i.e. how many items are in that array, which is probably not what you want. + If you need to return an array then return a reference to it, + or stash it like so: + + $c->stash->{array} = \@array; + + and access it from the stash. =cut @@@ -403,12 -418,15 +418,15 @@@ sub visit { my $c = shift; $c->dispatch =head2 $c->go( $class, $method, [, \@captures, \@arguments ] ) - Almost the same as L<< detach|/"$c->detach( $action [, \@arguments ] )" >>, but does a full dispatch like L, - instead of just calling the new C<$action> / - C<< $class->$method >>. This means that C, C and the - method you visit are called, just like a new request. - - C<< $c->stash >> is kept unchanged. + The relationship between C and + L<< visit|/"$c->visit( $action [, \@captures, \@arguments ] )" >> is the same as + the relationship between + L<< forward|/"$c->forward( $class, $method, [, \@arguments ] )" >> and + L<< detach|/"$c->detach( $action [, \@arguments ] )" >>. Like C<< $c->visit >>, + C<< $c->go >> will perform a full dispatch on the specified action or method, + with localized C<< $c->action >> and C<< $c->namespace >>. Like C, + C escapes the processing of the current request chain on completion, and + does not return to its caller. =cut @@@ -487,7 -505,9 +505,9 @@@ sub error =head2 $c->state - Contains the return value of the last executed action. + Contains the return value of the last executed action. + Note that << $c->state >> operates in a scalar context which means that all + values it returns are scalar. =head2 $c->clear_errors @@@ -532,6 -552,10 +552,10 @@@ sub _comp_names_search_prefixes # if we were given a regexp to search against, we're done. return if ref $name; + # skip regexp fallback if configured + return + if $appclass->config->{disable_component_resolution_regex_fallback}; + # regexp fallback $query = qr/$name/i; @result = grep { $eligible{ $_ } =~ m{$query} } keys %eligible; @@@ -549,7 -573,8 +573,8 @@@ (join '", "', @result) . "'. Relying on regexp fallback behavior for " . "component resolution is unreliable and unsafe."; my $short = $result[0]; - $short =~ s/.*?Model:://; + # remove the component namespace prefix + $short =~ s/.*?(Model|Controller|View):://; my $shortmess = Carp::shortmess(''); if ($shortmess =~ m#Catalyst/Plugin#) { $msg .= " You probably need to set '$short' instead of '${name}' in this " . @@@ -558,7 -583,7 +583,7 @@@ $msg .= " You probably need to set '$short' instead of '${name}' in this " . "component's config"; } else { - $msg .= " You probably meant \$c->${warn_for}('$short') instead of \$c->${warn_for}({'${name}'}), " . + $msg .= " You probably meant \$c->${warn_for}('$short') instead of \$c->${warn_for}('${name}'), " . "but if you really wanted to search, pass in a regexp as the argument " . "like so: \$c->${warn_for}(qr/${name}/)"; } @@@ -775,6 -800,12 +800,12 @@@ should be used instead If C<$name> is a regexp, a list of components matched against the full component name will be returned. + If Catalyst can't find a component by name, it will fallback to regex + matching by default. To disable this behaviour set + disable_component_resolution_regex_fallback to a true value. + + __PACKAGE__->config( disable_component_resolution_regex_fallback => 1 ); + =cut sub component { @@@ -1114,7 -1145,6 +1145,6 @@@ EO my $name = $class->config->{name} || 'Application'; $class->log->info("$name powered by Catalyst $Catalyst::VERSION"); } - $class->log->_flush() if $class->log->can('_flush'); # Make sure that the application class becomes immutable at this point, B::Hooks::EndOfScope::on_scope_end { @@@ -1134,11 -1164,21 +1164,21 @@@ . "Class::Accessor(::Fast)?\nPlease pass " . "(replace_constructor => 1)\nwhen making your class immutable.\n"; } - $meta->make_immutable(replace_constructor => 1) - unless $meta->is_immutable; + $meta->make_immutable( + replace_constructor => 1, + ) unless $meta->is_immutable; }; + if ($class->config->{case_sensitive}) { + $class->log->warn($class . "->config->{case_sensitive} is set."); + $class->log->warn("This setting is deprecated and planned to be removed in Catalyst 5.81."); + } + $class->setup_finalize; + # Should be the last thing we do so that user things hooking + # setup_finalize can log.. + $class->log->_flush() if $class->log->can('_flush'); + return 1; # Explicit return true as people have __PACKAGE__->setup as the last thing in their class. HATE. } @@@ -1166,7 -1206,7 +1206,7 @@@ sub setup_finalize $class->setup_finished(1); } - =head2 $c->uri_for( $path, @args?, \%query_values? ) + =head2 $c->uri_for( $path?, @args?, \%query_values? ) =head2 $c->uri_for( $action, \@captures?, @args?, \%query_values? ) @@@ -1174,6 -1214,10 +1214,10 @@@ Constructs an absolute L object ba provided path, and the additional arguments and query parameters provided. When used as a string, provides a textual URI. + If no arguments are provided, the URI for the current action is returned. + To return the current action and also provide @args, use + C<< $c->uri_for( $c->action, @args ) >>. + 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 @@@ -1215,9 -1259,10 +1259,10 @@@ sub uri_for } if ( blessed($path) ) { # action object - my $captures = ( scalar @args && ref $args[0] eq 'ARRAY' - ? shift(@args) - : [] ); + my $captures = [ map { s|/|%2F|; $_; } + ( scalar @args && ref $args[0] eq 'ARRAY' + ? @{ shift(@args) } + : ()) ]; my $action = $path; $path = $c->dispatcher->uri_for_action($action, $captures); if (not defined $path) { @@@ -1235,6 -1280,7 +1280,7 @@@ carp "uri_for called with undef argument" if grep { ! defined $_ } @args; s/([^$URI::uric])/$URI::Escape::escapes{$1}/go for @args; + s|/|%2F| for @args; unshift(@args, $path); @@@ -1597,9 -1643,10 +1643,10 @@@ sub _stats_start_execute # is this a root-level call or a forwarded call? if ( $callsub =~ /forward$/ ) { + my $parent = $c->stack->[-1]; # forward, locate the caller - if ( my $parent = $c->stack->[-1] ) { + if ( exists $c->counter->{"$parent"} ) { $c->stats->profile( begin => $action, parent => "$parent" . $c->counter->{"$parent"}, @@@ -2631,6 -2678,73 +2678,73 @@@ messages in template systems sub version { return $Catalyst::VERSION } + =head1 CONFIGURATION + + There are a number of 'base' config variables which can be set: + + =over + + =item * + + C - The default model picked if you say C<< $c->model >>. See Lmodel($name)>. + + =item * + + C - The default view to be rendered or returned when C<< $c->view >>. See Lview($name)>. + is called. + + =item * + + C - Turns + off the deprecated component resolution functionality so + that if any of the component methods (e.g. C<< $c->controller('Foo') >>) + are called then regex search will not be attempted on string values and + instead C will be returned. + + =item * + + C - The application home directory. In an uninstalled application, + this is the top level application directory. In an installed application, + this will be the directory containing C<< MyApp.pm >>. + + =item * + + C - See L + + =item * + + C - The name of the application in debug messages and the debug and + welcome screens + + =item * + + C - The request body (for example file uploads) will not be parsed + until it is accessed. This allows you to (for example) check authentication (and reject + the upload) before actually recieving all the data. See L + + =item * + + C - The root directory for templates. Usually this is just a + subdirectory of the home directory, but you can set it to change the + templates to a different directory. + + =item * + + C - Array reference passed to Module::Pluggable to for additional + namespaces from which components will be loaded (and constructed and stored in + C<< $c->components >>). + + =item * + + C - If true, causes internal actions such as C<< _DISPATCH >> + to be shown in hit debug tables in the test server. + + =item * + + C - See L. + + =back + =head1 INTERNAL ACTIONS Catalyst uses internal actions like C<_DISPATCH>, C<_BEGIN>, C<_AUTO>, @@@ -2639,16 -2753,6 +2753,6 @@@ action table, but you can make them vis MyApp->config(show_internal_actions => 1); - =head1 CASE SENSITIVITY - - By default Catalyst is not case sensitive, so C is - mapped to C. You can activate case sensitivity with a config - parameter. - - MyApp->config(case_sensitive => 1); - - This causes C to map to C. - =head1 ON-DEMAND PARSER The request body is usually parsed at the beginning of a request, @@@ -2758,6 -2862,8 +2862,8 @@@ abw: Andy Wardle acme: Leon Brocard + abraxxa: Alexander Hartmaier + Andrew Bramble Andrew Ford EA.Ford@ford-mason.co.ukE @@@ -2786,8 -2892,6 +2892,8 @@@ David Naughton, C + dkubb: Dan Kubb Drew Taylor @@@ -2808,6 -2912,8 +2914,8 @@@ Gavin Henry C + hobbs: Andrew Rodland ilmari: Dagfinn Ilmari Mannsåker