[Catalyst-commits] r11802 - in Catalyst-Runtime/5.80/branches/aggregate_more: . lib lib/Catalyst lib/Catalyst/Engine t/lib t/lib/TestApp/Controller t/lib/TestApp/Controller/Action

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Thu Nov 12 01:19:46 GMT 2009


Author: t0m
Date: 2009-11-12 01:19:45 +0000 (Thu, 12 Nov 2009)
New Revision: 11802

Modified:
   Catalyst-Runtime/5.80/branches/aggregate_more/
   Catalyst-Runtime/5.80/branches/aggregate_more/Changes
   Catalyst-Runtime/5.80/branches/aggregate_more/Makefile.PL
   Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst.pm
   Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Engine/FastCGI.pm
   Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Request.pm
   Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Test.pm
   Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Upgrading.pod
   Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Utils.pm
   Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestApp/Controller/Action/Private.pm
   Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestApp/Controller/Dump.pm
   Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestAppDoubleAutoBug.pm
   Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestAppStats.pm
Log:
 r11487 at t0mlaptop (orig r11457):  t0m | 2009-10-05 22:59:47 +0100
  r11483 at 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 at t0mlaptop (orig r11458):  t0m | 2009-10-05 22:59:52 +0100
  r11486 at t0mlaptop (orig r11456):  t0m | 2009-10-05 22:59:01 +0100
  Tidy up changelog/attribution
 
 r11503 at t0mlaptop (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 at t0mlaptop (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 at t0mlaptop (orig r11513):  caelum | 2009-10-12 17:18:22 +0100
 fix uninitialized warning in ACL
 r11549 at t0mlaptop (orig r11514):  caelum | 2009-10-12 17:22:08 +0100
 better fix for uninitialized warning
 r11550 at t0mlaptop (orig r11515):  t0m | 2009-10-12 18:10:32 +0100
 Less cargo cult madness
 r11554 at t0mlaptop (orig r11519):  caelum | 2009-10-13 15:37:02 +0100
 more correct fix for uninitialized warning from ACL
 r11556 at t0mlaptop (orig r11521):  dhoss | 2009-10-14 01:14:42 +0100
 Snow Leopard uses COPYFILE_DISABLE
 r11557 at t0mlaptop (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 at t0mlaptop (orig r11523):  dhoss | 2009-10-14 01:23:45 +0100
 Attempted to make the error message more obvious
 r11561 at t0mlaptop (orig r11526):  dhoss | 2009-10-14 01:50:26 +0100
 fixed error message for mac osx 10.7
 r11568 at t0mlaptop (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 at t0mlaptop (orig r11539):  t0m | 2009-10-15 22:19:26 +0100
 Add docs I promised for  r11484
 r11622 at t0mlaptop (orig r11587):  jshirley | 2009-10-16 21:06:19 +0100
 The longawaited nginx patch to support non-root apps, and some pod
 r11623 at t0mlaptop (orig r11588):  jshirley | 2009-10-16 21:07:29 +0100
 Changes for nginx patches
 r11624 at t0mlaptop (orig r11589):  jshirley | 2009-10-16 21:08:55 +0100
 My favorite color is clear and I like to eat rocks
 r11670 at t0mlaptop (orig r11635):  t0m | 2009-10-19 18:02:59 +0100
 Remove warnings from duplicate action declerations
 r11675 at t0mlaptop (orig r11640):  poisonbit | 2009-10-20 21:12:46 +0100
 Example added to #Actions_in_your_application_class
 
 
 r11676 at t0mlaptop (orig r11641):  poisonbit | 2009-10-20 21:32:41 +0100
 Formating (a lost space and line break)
 
 
 r11677 at t0mlaptop (orig r11642):  poisonbit | 2009-10-20 21:34:45 +0100
 More regresion from 11640, correcting parentheses and endpoint.
 
 
 r11678 at t0mlaptop (orig r11643):  poisonbit | 2009-10-20 22:08:47 +0100
 Change in actions inside roles.
 http://bobtfish.livejournal.com/264317.html
 
 
 r11679 at t0mlaptop (orig r11644):  poisonbit | 2009-10-20 23:16:03 +0100
 Fixes to pass podchecker OK
 
 
 r11714 at t0mlaptop (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 at t0mlaptop (orig r11681):  t0m | 2009-10-29 00:43:07 +0000
 Make URI a link to make it super obvious
 r11796 at t0mlaptop (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 at t0mlaptop (orig r11776):  altreus | 2009-11-06 17:09:51 +0000
 Add doc for no-args call to ->uri_for
 r11813 at t0mlaptop (orig r11778):  dhoss | 2009-11-06 17:13:27 +0000
 fixed options passed to devel server so that author tests pass
 r11814 at t0mlaptop (orig r11779):  altreus | 2009-11-06 17:14:49 +0000
 Amend doc to not mention using undef in ->uri_for
 r11816 at t0mlaptop (orig r11781):  t0m | 2009-11-07 16:50:59 +0000
 Back out change from -port to -l - svn merge -r 11778:11777
 r11823 at t0mlaptop (orig r11788):  rafl | 2009-11-09 22:21:19 +0000
 Make request->body fail when used as a writer.
 r11824 at t0mlaptop (orig r11789):  t0m | 2009-11-10 19:51:33 +0000
 Fix changelog, me--
 r11825 at t0mlaptop (orig r11790):  t0m | 2009-11-10 19:56:09 +0000
 Warn on case_sensitive being set, remove documentation
 r11827 at t0mlaptop (orig r11792):  t0m | 2009-11-10 21:36:06 +0000
 Return 1, only currently works by chance
 r11828 at t0mlaptop (orig r11793):  t0m | 2009-11-10 21:37:26 +0000
 Also retarded
 r11829 at t0mlaptop (orig r11794):  t0m | 2009-11-10 21:41:27 +0000
 And lets not change behaviour with the log flush change..
 r11836 at t0mlaptop (orig r11801):  t0m | 2009-11-12 01:12:05 +0000
 Bring the changelog up to date.



Property changes on: Catalyst-Runtime/5.80/branches/aggregate_more
___________________________________________________________________
Name: svk:merge
   - 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/trunk:11345
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
   + 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/disable_regex_fallback:11456
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/trunk:11801
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/Changes
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/Changes	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/Changes	2009-11-12 01:19:45 UTC (rev 11802)
@@ -6,7 +6,49 @@
       role combination of roles containing attributed methods.
     - Catalyst::Dispatcher::dispatch_types no longer throws deprecated warnings
       as there is no recommended alternative.
+    - Improved the suggested fix warning when component resolution uses regex
+      fallback for fully qualified component names.
+    - Catalyst::Test::local_request sets ->request on the response.
+    - Require HTTP::Request 5.814 and HTTP::Response 5.813 from LWP 5.814
+      to avoid test fails.
+    - Log flush moved to the end of setup so that roles and plugins which
+      hook setup_finalize can log things and have them appear in application
+      startup, rather than with the first hit.
+    - Require a newer version of LWP to avoid failing tests.
+    - Stop warnings when actions are forwarded to during dispatch.
+    - Remove warnings for using Catalyst::Dispatcher->dispatch_types as this is a
+      valid method to publicly call on the dispatcher.
 
+  Documentation:
+    - Document no-args call to $c->uri_for.
+    - Document all top level application configuration parameters.
+    - Clarify how to fix actions in your application class (which is
+      deprecated and causes warnings).
+    - Pod fixes for ContextClosure.
+    - Fix documentation for go/visit to reference captures and arguments
+      in the correct order.
+    - Update $c->forward and $c->state documentation to address scalar
+      context.
+
+  New features:
+    - Added disable_component_resolution_regex_fallback config option to
+      switch off (deprecated) regex fallback for component resolution.
+    - Added an nginx-specific behavior to the FastCGI engine to allow
+      proper PATH_INFO and SCRIPT_NAME processing for non-root applications
+    - Enable Catalyst::Utils::home() to find home within Dist::Zilla built
+      distributions
+    - Enable Catalyst::Utils::home() to find home within Dist::Zilla built
+      dists
+
+  Refactoring / cleanups:
+    - Remove documentation for the case_sensitive setting
+    - Warning is now emitted at application startup if the case_sensitive
+      setting is turned on. This setting is not used by anyone, not
+      believed to be useful and adds unnecessary complexity to controllers
+      and the dispatcher. If you are using this setting and have good reasons
+      why it should stay then you need to be shouting, now.
+    - Writing to $c->req->body now fails as doing this never makes sense.
+
 5.80013 2009-09-17 11:07:04
 
    Bug fixes:

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/Makefile.PL
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/Makefile.PL	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/Makefile.PL	2009-11-12 01:19:45 UTC (rev 11802)
@@ -1,13 +1,15 @@
 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';
@@ -28,8 +30,8 @@
 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';
@@ -147,8 +149,8 @@
 
         # 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,"; }.

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Engine/FastCGI.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Engine/FastCGI.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Engine/FastCGI.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -234,7 +234,12 @@
     if ( $env->{SERVER_SOFTWARE} =~ /lighttpd/ ) {
         $env->{PATH_INFO} ||= delete $env->{SCRIPT_NAME};
     }
-    # Fix the environment variables PATH_INFO and SCRIPT_NAME when running under IIS
+    elsif ( $env->{SERVER_SOFTWARE} =~ /^nginx/ ) {
+        my $script_name = $env->{SCRIPT_NAME};
+        $env->{PATH_INFO} =~ s/^$script_name//g;
+    }
+    # Fix the environment variables PATH_INFO and SCRIPT_NAME when running 
+    # under IIS
     elsif ( $env->{SERVER_SOFTWARE} =~ /IIS\/[6-9]\.[0-9]/ ) {
         my @script_name = split(m!/!, $env->{PATH_INFO});
         my @path_translated = split(m!/|\\\\?!, $env->{PATH_TRANSLATED});
@@ -433,6 +438,76 @@
 For more information on using FastCGI under Lighttpd, visit
 L<http://www.lighttpd.net/documentation/fastcgi.html>
 
+=head2 nginx
+
+Catalyst runs under nginx via FastCGI in a similar fashion as the lighttpd
+standalone server as described above.
+
+nginx does not have its own internal FastCGI process manager, so you must run
+the FastCGI service separately.
+
+=head3 Configuration
+
+To configure nginx, you must configure the FastCGI parameters and also the
+socket your FastCGI daemon is listening on.  It can be either a TCP socket
+or a Unix file socket.
+
+The server configuration block should look roughly like:
+
+    server {
+        listen $port;
+
+        location / {
+            fastcgi_param  QUERY_STRING       $query_string;
+            fastcgi_param  REQUEST_METHOD     $request_method;
+            fastcgi_param  CONTENT_TYPE       $content_type;
+            fastcgi_param  CONTENT_LENGTH     $content_length;
+
+            fastcgi_param  PATH_INFO          $fastcgi_script_name;
+            fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
+            fastcgi_param  REQUEST_URI        $request_uri;
+            fastcgi_param  DOCUMENT_URI       $document_uri;
+            fastcgi_param  DOCUMENT_ROOT      $document_root;
+            fastcgi_param  SERVER_PROTOCOL    $server_protocol;
+
+            fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
+            fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;
+
+            fastcgi_param  REMOTE_ADDR        $remote_addr;
+            fastcgi_param  REMOTE_PORT        $remote_port;
+            fastcgi_param  SERVER_ADDR        $server_addr;
+            fastcgi_param  SERVER_PORT        $server_port;
+            fastcgi_param  SERVER_NAME        $server_name;
+        
+            # Adjust the socket for your applications!
+            fastcgi_pass   unix:$docroot/myapp.socket;
+        }
+    }
+
+It is the standard convention of nginx to include the fastcgi_params in a
+separate file (usually something like C</etc/nginx/fastcgi_params>) and
+simply include that file.
+
+=head3  Non-root configuration
+
+If you properly specify the PATH_INFO and SCRIPT_NAME parameters your 
+application will be accessible at any path.  The SCRIPT_NAME variable is the
+prefix of your application, and PATH_INFO would be everything in addition.
+
+As an example, if your application is rooted at /myapp, you would configure:
+
+    fastcgi_param  PATH_INFO /myapp/;
+    fastcgi_param  SCRIPT_NAME $fastcgi_script_name;
+
+C<$fastcgi_script_name> would be "/myapp/path/of/the/action".  Catalyst will
+process this accordingly and setup the application base as expected.
+
+This behavior is somewhat different than Apache and Lighttpd, but is still
+functional.
+
+For more information on nginx, visit:
+L<http://nginx.net>
+
 =head2 Microsoft IIS
 
 It is possible to run Catalyst under IIS with FastCGI, but only on IIS 6.0

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Request.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Request.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Request.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -110,7 +110,7 @@
 sub body {
   my $self = shift;
   $self->_context->prepare_body();
-  $self->_body(@_) if scalar @_;
+  croak 'body is a reader' if scalar @_;
   return blessed $self->_body ? $self->_body->body : $self->_body;
 }
 
@@ -570,7 +570,7 @@
 
 =head2 $req->uri
 
-Returns a URI object for the current request. Stringifies to the URI text.
+Returns a L<URI> object for the current request. Stringifies to the URI text.
 
 =head2 $req->mangle_params( { key => 'value' }, $appendmode);
 
@@ -676,7 +676,10 @@
 =head2 $req->user
 
 Returns the currently logged in user. B<Highly deprecated>, do not call,
-this will be removed in version 5.81.
+this will be removed in version 5.81. To retrieve the currently authenticated
+user, see C<< $c->user >> and C<< $c->user_exists >> in
+L<Catalyst::Plugin::Authentication>. For the C<REMOTE_USER> provided by the
+webserver, see C<< $req->remote_user >> below.
 
 =head2 $req->remote_user
 

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Test.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Test.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Test.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -228,7 +228,9 @@
 
     $class->handle_request( env => \%ENV );
 
-    return $cgi->restore->response;
+    my $response = $cgi->restore->response;
+    $response->request( $request );
+    return $response;
 }
 
 my $agent;

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Upgrading.pod
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Upgrading.pod	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Upgrading.pod	2009-11-12 01:19:45 UTC (rev 11802)
@@ -32,7 +32,8 @@
 
 =head2 Controller actions in Moose roles
 
-Declaring actions in Roles is currently unsupported.
+You can use L<MooseX::MethodAttributes::Role> if you want to declare actions
+inside Moose roles.
 
 =head2 Using Moose in Components
 
@@ -309,8 +310,27 @@
 Having actions in your application class will now emit a warning at application
 startup as this is deprecated. It is highly recommended that these actions are moved
 into a MyApp::Controller::Root (as demonstrated by the scaffold application
-generated by catalyst.pl)
+generated by catalyst.pl). 
 
+This warning, also affects tests. You should move actions in your test,
+creating a myTest::Controller::Root, like the following example:
+
+    package MyTest::Controller::Root;
+
+    use strict;
+    use warnings;
+
+    use parent 'Catalyst::Controller';
+
+    __PACKAGE__->config(namespace => '');
+
+    sub action : Local {
+        my ( $self, $c ) = @_;
+        $c->do_something; 
+    }
+
+    1;
+
 =head2 ::[MVC]:: naming scheme
 
 Having packages called MyApp::[MVC]::XX is deprecated and can no longer be generated
@@ -381,7 +401,7 @@
 Calling the plugin method is deprecated, and calling it at run time is B<highly
 deprecated>.
 
-Instead you are recommended to use L< Catalyst::Model::Adaptor > or similar to
+Instead you are recommended to use L<Catalyst::Model::Adaptor> or similar to
 compose the functionality you need outside of the main application name space.
 
 Calling the plugin method will not be supported past Catalyst 5.81.

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Utils.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Utils.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst/Utils.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -172,8 +172,9 @@
             # pop off /lib and /blib if they're there
             $home = $home->parent while $home =~ /b?lib$/;
 
-            # only return the dir if it has a Makefile.PL or Build.PL
-            if (-f $home->file("Makefile.PL") or -f $home->file("Build.PL")) {
+            # only return the dir if it has a Makefile.PL or Build.PL or dist.ini
+            if (-f $home->file("Makefile.PL") or -f $home->file("Build.PL")
+                or -f $home->file("dist.ini")) {
 
                 # clean up relative path:
                 # MyApp/script/.. -> MyApp

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/lib/Catalyst.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -552,6 +552,10 @@
     # 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;
@@ -569,7 +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 " .
@@ -578,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}/)";
         }
@@ -795,6 +800,12 @@
 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 {
@@ -1134,7 +1145,6 @@
         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 {
@@ -1159,7 +1169,16 @@
         ) 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.
 }
 
 
@@ -1187,7 +1206,7 @@
     $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? )
 
@@ -1195,6 +1214,10 @@
 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
@@ -1618,9 +1641,10 @@
 
     # 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"},
@@ -2652,6 +2676,73 @@
 
 sub version { return $Catalyst::VERSION }
 
+=head1 CONFIGURATION
+
+There are a number of 'base' config variables which can be set:
+
+=over
+
+=item *
+
+C<default_model> - The default model picked if you say C<< $c->model >>. See L</$c->model($name)>.
+
+=item *
+
+C<default_view> - The default view to be rendered or returned when C<< $c->view >>. See L</$c->view($name)>.
+is called.
+
+=item *
+
+C<disable_component_resolution_regex_fallback> - 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<undef> will be returned.
+
+=item *
+
+C<home> - 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<ignore_frontend_proxy> - See L</PROXY SUPPORT>
+
+=item *
+
+C<name> - The name of the application in debug messages and the debug and
+welcome screens
+
+=item *
+
+C<parse_on_demand> - 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</ON-DEMAND PARSER>
+
+=item *
+
+C<root> - 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<search_extra> - 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<show_internal_actions> - If true, causes internal actions such as C<< _DISPATCH >>
+to be shown in hit debug tables in the test server.
+
+=item *
+
+C<using_frontend_proxy> - See L</PROXY SUPPORT>.
+
+=back
+
 =head1 INTERNAL ACTIONS
 
 Catalyst uses internal actions like C<_DISPATCH>, C<_BEGIN>, C<_AUTO>,
@@ -2660,16 +2751,6 @@
 
     MyApp->config(show_internal_actions => 1);
 
-=head1 CASE SENSITIVITY
-
-By default Catalyst is not case sensitive, so C<MyApp::C::FOO::Bar> is
-mapped to C</foo/bar>. You can activate case sensitivity with a config
-parameter.
-
-    MyApp->config(case_sensitive => 1);
-
-This causes C<MyApp::C::Foo::Bar> to map to C</Foo/Bar>.
-
 =head1 ON-DEMAND PARSER
 
 The request body is usually parsed at the beginning of a request,
@@ -2779,6 +2860,8 @@
 
 acme: Leon Brocard <leon at astray.com>
 
+abraxxa: Alexander Hartmaier <abraxxa at cpan.org>
+
 Andrew Bramble
 
 Andrew Ford E<lt>A.Ford at ford-mason.co.ukE<gt>

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestApp/Controller/Action/Private.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestApp/Controller/Action/Private.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestApp/Controller/Action/Private.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -8,27 +8,27 @@
     $c->res->output('access denied');
 }
 
-sub one : Private { 
+sub one : Private {
     my ( $self, $c ) = @_;
     $c->res->output('access allowed');
 }
 
-sub two : Private Relative {
+sub two : Private {
     my ( $self, $c ) = @_;
     $c->res->output('access allowed');
 }
 
-sub three : Private Absolute {
+sub three : Private {
     my ( $self, $c ) = @_;
     $c->res->output('access allowed');
 }
 
-sub four : Private Path('/action/private/four') {
+sub four : Private {
     my ( $self, $c ) = @_;
     $c->res->output('access allowed');
 }
 
-sub five : Private Path('five') {
+sub five : Private {
     my ( $self, $c ) = @_;
     $c->res->output('access allowed');
 }

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestApp/Controller/Dump.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestApp/Controller/Dump.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestApp/Controller/Dump.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -3,7 +3,7 @@
 use strict;
 use base 'Catalyst::Controller';
 
-sub default : Action Private {
+sub default : Action {
     my ( $self, $c ) = @_;
     $c->forward('TestApp::View::Dump');
 }

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestAppDoubleAutoBug.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestAppDoubleAutoBug.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestAppDoubleAutoBug.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -44,3 +44,6 @@
 
     return $c->SUPER::execute(@_);
 }
+
+1;
+

Modified: Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestAppStats.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestAppStats.pm	2009-11-12 01:12:05 UTC (rev 11801)
+++ Catalyst-Runtime/5.80/branches/aggregate_more/t/lib/TestAppStats.pm	2009-11-12 01:19:45 UTC (rev 11802)
@@ -21,3 +21,6 @@
 
 sub info { push(@TestAppStats::log_messages, @_); }
 sub debug { push(@TestAppStats::log_messages, @_); }
+
+1;
+




More information about the Catalyst-commits mailing list