From: eldy <> Date: Sat, 26 Jul 2003 15:33:22 +0000 (+0000) Subject: Better management of plugin's load failure. X-Git-Tag: AWSTATS_5_7_BETA~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0653c9c93cecef3f86d3ca703de2817d8f9eca0f;p=thirdparty%2FAWStats.git Better management of plugin's load failure. --- diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt index 63117bc6..233f531a 100644 --- a/docs/awstats_changelog.txt +++ b/docs/awstats_changelog.txt @@ -27,6 +27,7 @@ New features/improvements: - Added maillogconvert.p for analyzing mail log files (support better sendmail, postfix and qmail log files). - Added -addfilenum option in logresolvemerge.pl +- Better management of plugin load failure. Other/Documentation: - Added mp4 mime type. diff --git a/wwwroot/cgi-bin/plugins/example/example.pm b/wwwroot/cgi-bin/plugins/example/example.pm index d82f4959..12855d40 100644 --- a/wwwroot/cgi-bin/plugins/example/example.pm +++ b/wwwroot/cgi-bin/plugins/example/example.pm @@ -1,6 +1,6 @@ #!/usr/bin/perl #----------------------------------------------------------------------------- -# Example AWStats plugin +# AWStats axample plugin # <----- # THIS IS A SAMPLE OF AN EMPTY PLUGIN FILE WITH INSTRUCTIONS TO HELP YOU TO # WRITE YOUR OWN WORKING PLUGIN. REPLACE THIS SENTENCE WITH THE PLUGIN GOAL. @@ -14,7 +14,7 @@ # <----- # ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES -#if (!eval ('require "Time/HiRes.pm"')) { return "Error: Need Perl module Time::HiRes"; } +#if (!eval ('require "TheModule.pm";')) { return $@?"Error: $@":"Error: Need Perl module TheModule"; } # -----> use strict;no strict "refs"; @@ -27,7 +27,7 @@ use strict;no strict "refs"; # ENTER HERE THE MINIMUM AWSTATS VERSION REQUIRED BY YOUR PLUGIN # AND THE NAME OF ALL FUNCTIONS THE PLUGIN MANAGE. # EACH POSSIBLE FUNCTION AND GOAL ARE DESCRIBE LATER. -my $PluginNeedAWStatsVersion="5.4"; +my $PluginNeedAWStatsVersion="5.6"; my $PluginHooksFunctions="xxx"; # -----> diff --git a/wwwroot/cgi-bin/plugins/geoip.pm b/wwwroot/cgi-bin/plugins/geoip.pm index 3392359e..84a5d19f 100644 --- a/wwwroot/cgi-bin/plugins/geoip.pm +++ b/wwwroot/cgi-bin/plugins/geoip.pm @@ -16,7 +16,7 @@ use vars qw/ $type /; $type='geoip'; if (!eval ('require "Geo/IP.pm";')) { $type='geoippureperl'; - if (!eval ('require "Geo/IP/PurePerl.pm";')) { return "Error: Need Perl module Geo::IP or Geo::IP::PurePerl"; } + if (!eval ('require "Geo/IP/PurePerl.pm";')) { return $@?"Error: $@":"Error: Need Perl module Geo::IP or Geo::IP::PurePerl"; } } # -----> use strict;no strict "refs"; diff --git a/wwwroot/cgi-bin/plugins/geoipfree.pm b/wwwroot/cgi-bin/plugins/geoipfree.pm index d499fa58..d1a50d95 100644 --- a/wwwroot/cgi-bin/plugins/geoipfree.pm +++ b/wwwroot/cgi-bin/plugins/geoipfree.pm @@ -13,7 +13,7 @@ # <----- push @INC, "${DIR}/plugins"; # ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES -if (!eval ('require "Geo/IPfree.pm";')) { return "Error: Need Perl module Geo::IPfree"; } +if (!eval ('require "Geo/IPfree.pm";')) { return $@?"Error: $@":"Error: Need Perl module Geo::IPfree"; } # -----> use strict;no strict "refs"; diff --git a/wwwroot/cgi-bin/plugins/hashfiles.pm b/wwwroot/cgi-bin/plugins/hashfiles.pm index 0e95d675..c188c3c1 100644 --- a/wwwroot/cgi-bin/plugins/hashfiles.pm +++ b/wwwroot/cgi-bin/plugins/hashfiles.pm @@ -11,7 +11,7 @@ # <----- # ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES -if (!eval ('require "Storable.pm";')) { return "Error: Need Perl module Storable"; } +if (!eval ('require "Storable.pm";')) { return $@?"Error: $@":"Error: Need Perl module Storable"; } # -----> use strict;no strict "refs"; diff --git a/wwwroot/cgi-bin/plugins/ipv6.pm b/wwwroot/cgi-bin/plugins/ipv6.pm index 82d70967..eb12fbc9 100644 --- a/wwwroot/cgi-bin/plugins/ipv6.pm +++ b/wwwroot/cgi-bin/plugins/ipv6.pm @@ -10,8 +10,8 @@ # <----- # ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES -if (!eval ('require "Net/IP.pm";')) { return "Error: Need Perl module Net::IP"; } -if (!eval ('require "Net/DNS.pm";')) { return "Error: Need Perl module Net::DNS"; } +if (!eval ('require "Net/IP.pm";')) { return $@?"Error: $@":"Error: Need Perl module Net::IP"; } +if (!eval ('require "Net/DNS.pm";')) { return $@?"Error: $@":"Error: Need Perl module Net::DNS"; } # -----> use strict;no strict "refs"; diff --git a/wwwroot/cgi-bin/plugins/timehires.pm b/wwwroot/cgi-bin/plugins/timehires.pm index d53161b0..8868c4a5 100644 --- a/wwwroot/cgi-bin/plugins/timehires.pm +++ b/wwwroot/cgi-bin/plugins/timehires.pm @@ -10,7 +10,7 @@ # <----- # ENTER HERE THE USE COMMAND FOR ALL REQUIRED PERL MODULES -if (!eval ('require "Time/HiRes.pm"')) { return "Error: Need Perl module Time::HiRes"; } +if (!eval ('require "Time/HiRes.pm"')) { return $@?"Error: $@":"Error: Need Perl module Time::HiRes"; } # -----> use strict;no strict "refs";