X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FPlugin%2FStatic%2FSimple.pm;h=01abfa2ebfe07b800ed4cbedcc64109c30eb6fc2;hb=a28d35e93b7cf4de0f26f18774378bef7d99565e;hp=4d7ce68489ad2cb5b16c58540353a84c5fcb7e9a;hpb=2de1407635fbfb67a043ddfd7069a38319724019;p=catagits%2FCatalyst-Plugin-Static-Simple.git diff --git a/lib/Catalyst/Plugin/Static/Simple.pm b/lib/Catalyst/Plugin/Static/Simple.pm index 4d7ce68..01abfa2 100644 --- a/lib/Catalyst/Plugin/Static/Simple.pm +++ b/lib/Catalyst/Plugin/Static/Simple.pm @@ -7,7 +7,7 @@ use File::stat; use MIME::Types; use NEXT; -our $VERSION = '0.08'; +our $VERSION = '0.09'; __PACKAGE__->mk_classdata( qw/_static_mime_types/ ); __PACKAGE__->mk_accessors( qw/_static_file @@ -56,9 +56,9 @@ sub dispatch { return if ( $c->res->status != 200 ); if ( $c->_static_file ) { - if ( $c->config->{static}->{no_logs} ) { - if ( $c->log->can('abort') ) { $c->log->abort(1) ; } - } + if ( $c->config->{static}->{no_logs} && $c->log->can('abort') ) { + $c->log->abort( 1 ); + } return $c->_serve_static; } else { @@ -109,7 +109,9 @@ sub setup { $c->config->{static}->{mime_types} ||= {}; $c->config->{static}->{use_apache} ||= 0; $c->config->{static}->{debug} ||= $c->debug; - $c->config->{static}->{no_logs} ||= 1; + if ( ! defined $c->config->{static}->{no_logs} ) { + $c->config->{static}->{no_logs} = 1; + } # load up a MIME::Types object, only loading types with # at least 1 file extension @@ -296,10 +298,10 @@ probably feel less "simple" to you! =head2 Aborting request logging -With Catalyst 5.50, there has been added support for dropping logging for a -request. We've turned this on by default, as static logging tends to clutter -the Log API, however, if you want logging of static requests, you can easily -turn it on by setting MyApp->config->{static}->{no_logs} to 0. +Since Catalyst 5.50, there has been added support for dropping logging for a +request. This is enabled by default for static files, as static requests tend +to clutter the log output. However, if you want logging of static requests, +you can enable it by setting MyApp->config->{static}->{no_logs} to 0. =head2 Forcing directories into static mode @@ -312,7 +314,7 @@ specified using qr//. qr/^(images|css)/, ]; -=head2 Including additional directories (experimental!) +=head2 Including additional directories You may specify a list of directories in which to search for your static files. The directories will be searched in order and will return the first @@ -414,6 +416,10 @@ L Andy Grundman, +=head1 CONTRIBUTORS + +Marcus Ramberg, + =head1 THANKS The authors of Catalyst::Plugin::Static: