[Catalyst-commits] r12753 -
trunk/Catalyst-Plugin-UploadProgress/lib/Catalyst/Plugin
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Thu Jan 28 00:13:19 GMT 2010
Author: t0m
Date: 2010-01-28 00:13:19 +0000 (Thu, 28 Jan 2010)
New Revision: 12753
Modified:
trunk/Catalyst-Plugin-UploadProgress/lib/Catalyst/Plugin/UploadProgress.pm
Log:
Change to around modifiers
Modified: trunk/Catalyst-Plugin-UploadProgress/lib/Catalyst/Plugin/UploadProgress.pm
===================================================================
--- trunk/Catalyst-Plugin-UploadProgress/lib/Catalyst/Plugin/UploadProgress.pm 2010-01-28 00:09:52 UTC (rev 12752)
+++ trunk/Catalyst-Plugin-UploadProgress/lib/Catalyst/Plugin/UploadProgress.pm 2010-01-28 00:13:19 UTC (rev 12753)
@@ -5,8 +5,8 @@
our $VERSION = '0.05';
# I'm concerned that this doesn't call super() at all..
-override 'prepare_body_chunk' => sub {
- my ( $c, $chunk ) = @_;
+around 'prepare_body_chunk' => sub {
+ my ( $orig, $c, $chunk ) = @_;
my $body = $c->request->{_body};
$body->add( $chunk );
@@ -34,7 +34,8 @@
}
};
-override 'prepare_body' => sub {
+around 'prepare_body' => sub {
+ my $orig = shift;
my $c = shift;
# Detect if the user stopped the upload, prepare_body will die with an invalid
@@ -48,7 +49,7 @@
$croaked = shift;
};
- super;
+ $c->$orig(@_);
}
if ( $croaked ) {
@@ -68,7 +69,8 @@
}
};
-override 'dispatch' => sub {
+around 'dispatch' => sub {
+ my $orig = shift;
my $c = shift;
# if the URI query string is ?progress_id=<id> intercept the request
@@ -78,10 +80,10 @@
return $c->upload_progress_output( $1 );
}
- return super;
+ return $c->$orig(@_);
};
-after 'setup' => sub {
+after 'setup_finalize' => sub {
my $c = shift;
unless ( $c->can('cache') ) {
More information about the Catalyst-commits
mailing list