[Catalyst-commits] r7868 - Catalyst-Runtime/5.70/branches/compres/lib

bricas at dev.catalyst.perl.org bricas at dev.catalyst.perl.org
Fri May 30 13:54:43 BST 2008


Author: bricas
Date: 2008-05-30 13:54:43 +0100 (Fri, 30 May 2008)
New Revision: 7868

Modified:
   Catalyst-Runtime/5.70/branches/compres/lib/Catalyst.pm
Log:
update some warnings

Modified: Catalyst-Runtime/5.70/branches/compres/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.70/branches/compres/lib/Catalyst.pm	2008-05-30 12:34:31 UTC (rev 7867)
+++ Catalyst-Runtime/5.70/branches/compres/lib/Catalyst.pm	2008-05-30 12:54:43 UTC (rev 7868)
@@ -536,6 +536,7 @@
         $c->log->warn( '* $c->config->{default_model} # the name of the default model to use' );
         $c->log->warn( '* $c->stash->{current_model} # the name of the model to use for this request' );
         $c->log->warn( '* $c->stash->{current_model_instance} # the instance of the model to use for this request' );
+        $c->log->warn( 'NB: in version 5.80, the "random" behavior will not work at all.' );
     }
 
     return $c->_filter_component( $comp );
@@ -583,6 +584,7 @@
         $c->log->warn( '* $c->config->{default_view} # the name of the default view to use' );
         $c->log->warn( '* $c->stash->{current_view} # the name of the view to use for this request' );
         $c->log->warn( '* $c->stash->{current_view_instance} # the instance of the view to use for this request' );
+        $c->log->warn( 'NB: in version 5.80, the "random" behavior will not work at all.' );
     }
 
     return $c->_filter_component( $comp );
@@ -657,8 +659,13 @@
 
         my @result = grep { m{$query} } keys %{ $c->components };
         return @result if ref $name;
-        return $result[ 0 ] if $result[ 0 ];
 
+        if( $result[ 0 ] ) {
+            $c->log->warn( 'Relying on the regexp fallback behavior for component resolution' );
+            $c->log->warn( 'is unreliable and unsafe. You have been warned' );
+            return $result[ 0 ];
+        }
+
         # I would expect to return an empty list here, but that breaks back-compat
     }
 




More information about the Catalyst-commits mailing list