[Catalyst-commits] r11281 - in Catalyst-Runtime/5.80/trunk/lib: .
Catalyst Catalyst/Engine
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Tue Sep 1 01:11:33 GMT 2009
Author: t0m
Date: 2009-09-01 01:11:33 +0000 (Tue, 01 Sep 2009)
New Revision: 11281
Modified:
Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Controller.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm
Log:
Stop calling class data methods on instances + commented out warning
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm 2009-09-01 01:10:46 UTC (rev 11280)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm 2009-09-01 01:11:33 UTC (rev 11281)
@@ -6,7 +6,7 @@
use Moose::Util ();
sub mk_classdata {
- my ($class, $attribute) = @_;
+ my ($class, $attribute, $warn_on_instance) = @_;
confess("mk_classdata() is a class method, not an object method")
if blessed $class;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm 2009-09-01 01:10:46 UTC (rev 11280)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Component.pm 2009-09-01 01:11:33 UTC (rev 11281)
@@ -113,6 +113,8 @@
sub config {
my $self = shift;
+ # Uncomment once sane to do so
+ #Carp::cluck("config method called on instance") if ref $self;
my $config = $self->_config || {};
if (@_) {
my $newconfig = { %{@_ > 1 ? {@_} : $_[0]} };
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Controller.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Controller.pm 2009-09-01 01:10:46 UTC (rev 11280)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Controller.pm 2009-09-01 01:11:33 UTC (rev 11281)
@@ -137,21 +137,23 @@
my $orig = shift;
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 $self->config->{namespace} if exists $self->config->{namespace};
+ return $class->config->{namespace} if exists $class->config->{namespace};
}
my $case_s;
if( $c ){
- $case_s = $c->config->{case_sensitive};
+ $case_s = $appclass->config->{case_sensitive};
} else {
if ($self->isa('Catalyst')) {
- $case_s = $self->config->{case_sensitive};
+ $case_s = $class->config->{case_sensitive};
} else {
if (ref $self) {
- $case_s = $self->_application->config->{case_sensitive};
+ $case_s = ref($self->_application)->config->{case_sensitive};
} else {
confess("Can't figure out case_sensitive setting");
}
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2009-09-01 01:10:46 UTC (rev 11280)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2009-09-01 01:11:33 UTC (rev 11281)
@@ -335,7 +335,7 @@
reverse => "$component_class->$method",
class => $component_class,
namespace => Catalyst::Utils::class2prefix(
- $component_class, $c->config->{case_sensitive}
+ $component_class, ref($c)->config->{case_sensitive}
),
}
);
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm 2009-09-01 01:10:46 UTC (rev 11280)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm 2009-09-01 01:11:33 UTC (rev 11281)
@@ -57,9 +57,9 @@
PROXY_CHECK:
{
- unless ( $c->config->{using_frontend_proxy} ) {
+ unless ( ref($c)->config->{using_frontend_proxy} ) {
last PROXY_CHECK if $ENV{REMOTE_ADDR} ne '127.0.0.1';
- last PROXY_CHECK if $c->config->{ignore_frontend_proxy};
+ last PROXY_CHECK if ref($c)->config->{ignore_frontend_proxy};
}
last PROXY_CHECK unless $ENV{HTTP_X_FORWARDED_FOR};
@@ -126,9 +126,9 @@
# If we are running as a backend proxy, get the true hostname
PROXY_CHECK:
{
- unless ( $c->config->{using_frontend_proxy} ) {
+ unless ( ref($c)->config->{using_frontend_proxy} ) {
last PROXY_CHECK if $host !~ /localhost|127.0.0.1/;
- last PROXY_CHECK if $c->config->{ignore_frontend_proxy};
+ last PROXY_CHECK if ref($c)->config->{ignore_frontend_proxy};
}
last PROXY_CHECK unless $ENV{HTTP_X_FORWARDED_HOST};
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2009-09-01 01:10:46 UTC (rev 11280)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2009-09-01 01:11:33 UTC (rev 11281)
@@ -112,7 +112,7 @@
my ( $self, $c ) = @_;
$c->res->content_type('text/html; charset=utf-8');
- my $name = $c->config->{name} || join(' ', split('::', ref $c));
+ my $name = ref($c)->config->{name} || join(' ', split('::', ref $c));
my ( $title, $error, $infos );
if ( $c->debug ) {
@@ -317,13 +317,14 @@
sub prepare_body {
my ( $self, $c ) = @_;
+ my $appclass = ref($c) || $c;
if ( my $length = $self->read_length ) {
my $request = $c->request;
unless ( $request->_body ) {
my $type = $request->header('Content-Type');
$request->_body(HTTP::Body->new( $type, $length ));
- $request->_body->tmpdir( $c->config->{uploadtmp} )
- if exists $c->config->{uploadtmp};
+ $request->_body->tmpdir( $appclass->config->{uploadtmp} )
+ if exists $appclass->config->{uploadtmp};
}
while ( my $buffer = $self->read($c) ) {
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-09-01 01:10:46 UTC (rev 11280)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst.pm 2009-09-01 01:11:33 UTC (rev 11281)
@@ -646,7 +646,7 @@
sub model {
my ( $c, $name, @args ) = @_;
-
+ my $appclass = ref($c) || $c;
if( $name ) {
my @result = $c->_comp_search_prefixes( $name, qw/Model M/ );
return map { $c->_filter_component( $_, @args ) } @result if ref $name;
@@ -659,8 +659,8 @@
return $c->model( $c->stash->{current_model} )
if $c->stash->{current_model};
}
- return $c->model( $c->config->{default_model} )
- if $c->config->{default_model};
+ return $c->model( $appclass->config->{default_model} )
+ if $appclass->config->{default_model};
my( $comp, $rest ) = $c->_comp_search_prefixes( undef, qw/Model M/);
@@ -700,6 +700,7 @@
sub view {
my ( $c, $name, @args ) = @_;
+ my $appclass = ref($c) || $c;
if( $name ) {
my @result = $c->_comp_search_prefixes( $name, qw/View V/ );
return map { $c->_filter_component( $_, @args ) } @result if ref $name;
@@ -712,8 +713,8 @@
return $c->view( $c->stash->{current_view} )
if $c->stash->{current_view};
}
- return $c->view( $c->config->{default_view} )
- if $c->config->{default_view};
+ return $c->view( $appclass->config->{default_view} )
+ if $appclass->config->{default_view};
my( $comp, $rest ) = $c->_comp_search_prefixes( undef, qw/View V/);
@@ -1566,9 +1567,9 @@
sub _stats_start_execute {
my ( $c, $code ) = @_;
-
+ my $appclass = ref($c) || $c;
return if ( ( $code->name =~ /^_.*/ )
- && ( !$c->config->{show_internal_actions} ) );
+ && ( !$appclass->config->{show_internal_actions} ) );
my $action_name = $code->reverse();
$c->counter->{$action_name}++;
@@ -1882,7 +1883,7 @@
$c->prepare_read;
# Parse the body unless the user wants it on-demand
- unless ( $c->config->{parse_on_demand} ) {
+ unless ( ref($c)->config->{parse_on_demand} ) {
$c->prepare_body;
}
}
@@ -2759,7 +2760,7 @@
Andrew Bramble
-Andrew Ford
+Andrew Ford E<lt>A.Ford at ford-mason.co.ukE<gt>
Andrew Ruthven
@@ -2775,6 +2776,14 @@
chicks: Christopher Hicks
+Chisel Wright C<pause at herlpacker.co.uk>
+
+Danijel Milicevic C<me at danijel.de>
+
+David Kamholz E<lt>dkamholz at cpan.orgE<gt>
+
+David Naughton, C<naughton at umn.edu>
+
David E. Wheeler
dkubb: Dan Kubb <dan.kubb-cpan at onautopilot.com>
@@ -2793,6 +2802,8 @@
Gary Ashton Jones
+Gavin Henry C<ghenry at perl.me.uk>
+
Geoff Richards
hobbs: Andrew Rodland <andrew at cleverdomain.org>
@@ -2801,7 +2812,7 @@
jcamacho: Juan Camacho
-jester: Jesse Sheidlower
+jester: Jesse Sheidlower C<jester at panix.com>
jhannah: Jay Hannah <jay at jays.net>
@@ -2811,6 +2822,10 @@
jon: Jon Schutz <jjschutz at cpan.org>
+Jonathan Rockway C<< <jrockway at cpan.org> >>
+
+Kieren Diment C<kd at totaldatasolution.com>
+
konobi: Scott McWhirter <konobi at cpan.org>
marcus: Marcus Ramberg <mramberg at cpan.org>
@@ -2841,14 +2856,22 @@
random: Roland Lammel <lammel at cpan.org>
+Robert Sedlacek C<< <rs at 474.at> >>
+
sky: Arthur Bergman
t0m: Tomas Doran <bobtfish at bobtfish.net>
Ulf Edvinsson
+Viljo Marrandi C<vilts at yahoo.com>
+
+Will Hawes C<info at whawes.co.uk>
+
willert: Sebastian Willert <willert at cpan.org>
+Yuval Kogman, C<nothingmuch at woobling.org>
+
=head1 LICENSE
This library is free software. You can redistribute it and/or modify it under
More information about the Catalyst-commits
mailing list