From 8e8756f458574586049b92326fb5869525cf6ddc Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 3 Oct 2012 13:45:04 +0100 Subject: [PATCH] Rationalised arguments to load_cgi. There's no point in passing upload_hook to load_cgi explicitly, when it's already implicitly passed as part of $self. This will just pull it from there now. --- Application.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Application.pm b/Application.pm index 9b07d9c..e65b2b8 100644 --- a/Application.pm +++ b/Application.pm @@ -124,7 +124,7 @@ sub run { or $self -> {"logger"} -> die_log("Not avilable", "Application: Unable to obtain configuration file: ".$ConfigMicro::errstr); # Create a new CGI object to generate page content through - $self -> {"cgi"} = $self -> load_cgi($self -> {"settings"} -> {"setup"} -> {"disable_compression"}, $self -> {"upload_hook"}); + $self -> {"cgi"} = $self -> load_cgi($self -> {"settings"} -> {"setup"} -> {"disable_compression"}); # Database initialisation. Errors in this will kill program. $self -> {"dbh"} = DBI->connect($self -> {"settings"} -> {"database"} -> {"database"}, @@ -283,7 +283,7 @@ sub run { # ============================================================================ # Internal code -## @method private $ load_cgi($no_compression, $upload_hook) +## @method private $ load_cgi($no_compression) # Dynamically load a module to handle CGI interaction. This will attempt to # load the best available module for CGI handling based on the modules installed # on the server: if `CGI::Compress::Gzip` is installed it will use that, otherwise @@ -298,7 +298,6 @@ sub run { # version of CGI, even if CGI::Compress::Gzip is available. # This defaults to false (the compressed CGI is used if # it is available). -# @param upload_hook Optional reference to a function to call as an upload hook. # @return A reference to a cgi object. This will die on error. sub load_cgi { my $self = shift; @@ -325,7 +324,7 @@ sub load_cgi { # Set up post stuff $CGI::POST_MAX = $self -> {"post_max"} * 1048576; - $cgi -> upload_hook($upload_hook) if($upload_hook); + $cgi -> upload_hook($self -> {"upload_hook") if($self -> {"upload_hook"}); return $cgi; }