]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Better management of plugin's load failure.
authoreldy <>
Sat, 26 Jul 2003 15:33:22 +0000 (15:33 +0000)
committereldy <>
Sat, 26 Jul 2003 15:33:22 +0000 (15:33 +0000)
docs/awstats_changelog.txt
wwwroot/cgi-bin/plugins/example/example.pm
wwwroot/cgi-bin/plugins/geoip.pm
wwwroot/cgi-bin/plugins/geoipfree.pm
wwwroot/cgi-bin/plugins/hashfiles.pm
wwwroot/cgi-bin/plugins/ipv6.pm
wwwroot/cgi-bin/plugins/timehires.pm

index 63117bc6a8d9e14a9eafc339b142faffdb043aaf..233f531aab3dafb859f4b0b6bb7f57a1f9a12e0c 100644 (file)
@@ -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.
index d82f495936c5768430111415743d185dde838665..12855d40eafcba49b48da27e40481d7f9c731bc3 100644 (file)
@@ -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";
 # ----->
 
index 3392359e83ee54f4552bc4f9757cc8cf126c7bd1..84a5d19f27efc2aa85fd459cfc2d7e03d8bd2390 100644 (file)
@@ -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";
index d499fa587d3c2921aaf97db75584c8f4a1d84795..d1a50d9587c03aef7da51cfeef7e7c4600d54823 100644 (file)
@@ -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";
 
index 0e95d675cdd05708cd69fc3c15eae7cda3d426ef..c188c3c1db37acac8fd4e20bcf31c0d6358760c9 100644 (file)
@@ -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";
 
index 82d709679a47c4fde7465b1914d0136304dd4f72..eb12fbc9871a10316d6c0710c126b90419587245 100644 (file)
@@ -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";
 
index d53161b06102cfa777cd83c6e315191da0597b50..8868c4a5625dad5299b7d0b2c6a71b130d94c107 100644 (file)
@@ -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";