__PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC);
# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.90096';
+our $VERSION = '5.90103';
$VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
sub import {
return $c->{error} || [];
}
-
=head2 $c->state
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.
+Please note that if an action throws an exception, the value of state
+should no longer be considered the return if the last action. It is generally
+going to be 0, which indicates an error state. Examine $c->error for error
+details.
+
=head2 $c->clear_errors
Clear errors. You probably don't want to clear the errors unless you are
my $comps = $c->components;
my $check = $appclass."::Controller::".$name;
return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
+ foreach my $path (@{$appclass->config->{ setup_components }->{ search_extra }}) {
+ next unless $path =~ /.*::Controller/;
+ $check = $path."::".$name;
+ return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
+ }
}
my @result = $c->_comp_search_prefixes( $name, qw/Controller C/ );
return map { $c->_filter_component( $_, @args ) } @result if ref $name;
my $comps = $c->components;
my $check = $appclass."::Model::".$name;
return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
+ foreach my $path (@{$appclass->config->{ setup_components }->{ search_extra }}) {
+ next unless $path =~ /.*::Model/;
+ $check = $path."::".$name;
+ return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
+ }
}
my @result = $c->_comp_search_prefixes( $name, qw/Model M/ );
return map { $c->_filter_component( $_, @args ) } @result if ref $name;
else {
$c->log->warn( "Attempted to use view '$check', but does not exist" );
}
+ foreach my $path (@{$appclass->config->{ setup_components }->{ search_extra }}) {
+ next unless $path =~ /.*::View/;
+ $check = $path."::".$name;
+ return $c->_filter_component( $comps->{$check}, @args ) if exists $comps->{$check};
+ }
}
my @result = $c->_comp_search_prefixes( $name, qw/View V/ );
return map { $c->_filter_component( $_, @args ) } @result if ref $name;
my $fragment = ((scalar(@args) && ref($args[-1]) eq 'SCALAR') ? pop @args : undef );
unless(blessed $path) {
- if ($path =~ s/#(.+)$//) {
+ if (defined($path) and $path =~ s/#(.+)$//) {
if(defined($1) and $fragment) {
carp "Abiguious fragment declaration: You cannot define a fragment in '$path' and as an argument '$fragment'";
}
sub execute {
my ( $c, $class, $code ) = @_;
$class = $c->component($class) || $class;
- $c->state(0);
+ #$c->state(0);
if ( $c->depth >= $RECURSION ) {
my $action = $code->reverse();
}
$c->error($error);
}
- $c->state(0);
+ #$c->state(0);
}
return $c->state;
}
my $c = $class->context_class->new({ $uploadtmp ? (_uploadtmp => $uploadtmp) : ()});
$c->response->_context($c);
-
$c->stats($class->stats_class->new)->enable($c->use_stats);
if ( $c->debug || $c->config->{enable_catalyst_header} ) {
MyApp::TraitFor::Request::Foo
Catalyst::TraitFor::Request::Foo
-The namespace part 'TraitFor::Request' was choosen to assist in backwards
+The namespace part 'TraitFor::Request' was chosen to assist in backwards
compatibility with L<CatalystX::RoleApplicator> which previously provided
these features in a stand alone package.
MyApp::TraitFor::Response::Foo
Catalyst::TraitFor::Responset::Foo
-The namespace part 'TraitFor::Response' was choosen to assist in backwards
+The namespace part 'TraitFor::Response' was chosen to assist in backwards
compatibility with L<CatalystX::RoleApplicator> which previously provided
these features in a stand alone package.
my $config = shift;
my @paths = qw( ::M ::Model ::V ::View ::C ::Controller );
- my $extra = delete $config->{ search_extra } || [];
+ my $extra = $config->{ search_extra } || [];
unshift @paths, @$extra;
MyApp::TraitFor::Stats::Foo
Catalyst::TraitFor::Stats::Foo
-The namespace part 'TraitFor::Stats' was choosen to assist in backwards
+The namespace part 'TraitFor::Stats' was chosen to assist in backwards
compatibility with L<CatalystX::RoleApplicator> which previously provided
these features in a stand alone package.
C<skip_complex_post_part_handling>
-When creating body parameters from a POST, if we run into a multpart POST
+When creating body parameters from a POST, if we run into a multipart POST
that does not contain uploads, but instead contains inlined complex data
(very uncommon) we cannot reliably convert that into field => value pairs. So
instead we create an instance of L<Catalyst::Request::PartData>. If this causes
C<do_not_decode_query>
If true, then do not try to character decode any wide characters in your
-request URL query or keywords. Most readings of the relevent specifications
+request URL query or keywords. Most readings of the relevant specifications
suggest these should be UTF-* encoded, which is the default that L<Catalyst>
-will use, hwoever if you are creating a lot of URLs manually or have external
+will use, however if you are creating a lot of URLs manually or have external
evil clients, this might cause you trouble. If you find the changes introduced
in Catalyst version 5.90080+ break some of your query code, you may disable
the UTF-8 decoding globally using this configuration.
C<default_query_encoding>
By default we decode query and keywords in your request URL using UTF-8, which
-is our reading of the relevent specifications. This setting allows one to
+is our reading of the relevant specifications. This setting allows one to
specify a fixed value for how to decode your query. You might need this if
you are doing a lot of custom encoding of your URLs and not using UTF-8.
C<stats_class_traits>
-An arrayref of L<Moose::Role>s that get componsed into your stats class.
+An arrayref of L<Moose::Role>s that get composed into your stats class.
=item *
C<request_class_traits>
-An arrayref of L<Moose::Role>s that get componsed into your request class.
+An arrayref of L<Moose::Role>s that get composed into your request class.
=item *
C<response_class_traits>
-An arrayref of L<Moose::Role>s that get componsed into your response class.
+An arrayref of L<Moose::Role>s that get composed into your response class.
=item *