From: Zbigniew Łukasiak Date: Mon, 16 Nov 2009 20:32:40 +0000 (+0000) Subject: case_sensitive config setting removed X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=40a21eff7619a0c872ad88c6962cfd7474039b88;hp=7d7519a4bbd079da53bf50f4822cabb0e3af74a1;p=catagits%2FCatalyst-Runtime.git case_sensitive config setting removed --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 6e74e58..f3807c6 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1169,11 +1169,6 @@ EOF ) 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.. diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index 1d91b3c..8e73316 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -138,29 +138,13 @@ around action_namespace => sub { my ( $self, $c ) = @_; my $class = ref($self) || $self; - my $appclass = ref($c) || $c; if( ref($self) ){ return $self->$orig if $self->has_action_namespace; } else { return $class->config->{namespace} if exists $class->config->{namespace}; } - my $case_s; - if( $c ){ - $case_s = $appclass->config->{case_sensitive}; - } else { - if ($self->isa('Catalyst')) { - $case_s = $class->config->{case_sensitive}; - } else { - if (ref $self) { - $case_s = ref($self->_application)->config->{case_sensitive}; - } else { - confess("Can't figure out case_sensitive setting"); - } - } - } - - my $namespace = Catalyst::Utils::class2prefix($self->catalyst_component_name, $case_s) || ''; + my $namespace = Catalyst::Utils::class2prefix($self->catalyst_component_name) || ''; $self->$orig($namespace) if ref($self); return $namespace; }; diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index d82dfe1..4ea6ce1 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -334,9 +334,7 @@ sub _invoke_as_component { code => $code, reverse => "$component_class->$method", class => $component_class, - namespace => Catalyst::Utils::class2prefix( - $component_class, ref($c)->config->{case_sensitive} - ), + namespace => Catalyst::Utils::class2prefix( $component_class ), } ); } diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index 53bf795..3fff3c6 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -100,9 +100,9 @@ sub class2env { return uc($class); } -=head2 class2prefix( $class, $case ); +=head2 class2prefix( $class ); -Returns the uri prefix for a class. If case is false the prefix is converted to lowercase. +Returns the uri prefix for a class. The prefix is converted to lowercase. My::App::Controller::Foo::Bar becomes foo/bar @@ -110,10 +110,9 @@ Returns the uri prefix for a class. If case is false the prefix is converted to sub class2prefix { my $class = shift || ''; - my $case = shift || 0; my $prefix; if ( $class =~ /^.+?::([MVC]|Model|View|Controller)::(.+)$/ ) { - $prefix = $case ? $2 : lc $2; + $prefix = lc $2; $prefix =~ s{::}{/}g; } return $prefix;