# the DNS. You may specify partial addresses (ie 163.85. for everything
# behind the usual firewall setup, etc)...
# This is only useful if DNSLookup=1.
-# Use space between each value and put a backslash before each dot.
+# Note: Use space between each value and put a backslash before each dot.
# Example: "163\.85\. 201\.101\.51\.2"
# Default: ""
#
# For example, to ignore a whole directory tree, just add "directorytoignore",
# to ignore "users" homepage in your stats, you can add "/~".
# The oposite parameter of "SkipFiles" is "OnlyFiles".
+# Note: This parameter is not case sensitive.
# Note: Use space between each value and do not remove default values
# Note: \. means . and xxx$ means URL ending by xxx.
-# Example: "\.css$ \.js$ \.class$ robots\.txt$ dir/badpage\.html /~"
+# Example: "\.css$ \.js$ \.class$ robots\.txt$ badpage\.html /~"
# Default: "\.css$ \.js$ \.class$ robots\.txt$"
#
SkipFiles="\.css$ \.js$ \.class$ robots\.txt$"
# match a particular string, like a particular directory, you can add this
# directory name in this parameter.
# The oposite parameter of "OnlyFiles" is "SkipFiles".
+# Note: This parameter is not case sensitive.
# Note: Use space between each value and do not remove default values
# Note: \. means . and xxx$ means URL ending by xxx.
# Example: "marketing_directory"
# Example: color_name="RRGGBB" # RRGGBB is Red Green Blue components in Hex
#
color_Background="FFFFFF" # Background color for main page (Default = "FFFFFF")
-color_TableBGTitle="CCCCDD" # Background color for table title (Default = "CCCCCC")
+color_TableBGTitle="CCCCDD" # Background color for table title (Default = "CCCCDD")
color_TableTitle="000000" # Table title font color (Default = "000000")
color_TableBG="CCCCDD" # Background color for table (Default = "CCCCDD")
color_TableRowTitle="FFFFFF" # Table row title font color (Default = "FFFFFF")
#-------------------------------------------------------
# ALGORITHM SUMMARY
# Read config file
+# Init variables
# If 'update'
# Get last history file name
# Read this last history file (LastTime, data arrays, ...)
";
print "</head>\n\n";
print "<body>\n";
- &Init_HashArray; # Should be useless (to avoid problem with mod_perl that keep variables in memory).
}
# Input: Global variables
#--------------------------------------------------------------------
sub Init_HashArray {
+ &debug("Call to Init_HashArray [$_[0],$_[1]]");
# We purge data read for year $_[0] and month $_[1] so it's like we never read it
$HistoryFileAlreadyRead{"$_[0]$_[1]"}=0;
# Delete/Reinit all arrays with name beginning by _
# monthnum must be in english because it's used to translate log date in apache log files which are always in english
%monthnum = ( "Jan","01","jan","01","Feb","02","feb","02","Mar","03","mar","03","Apr","04","apr","04","May","05","may","05","Jun","06","jun","06","Jul","07","jul","07","Aug","08","aug","08","Sep","09","sep","09","Oct","10","oct","10","Nov","11","nov","11","Dec","12","dec","12" );
-
# Check year and month parameters
if ($QueryString =~ /year=/i) { $YearRequired=$QueryString; $YearRequired =~ s/.*year=//; $YearRequired =~ s/&.*//; $YearRequired =~ s/ .*//; }
if ($YearRequired !~ /^[\d][\d][\d][\d]$/) { $YearRequired=$nowyear; }
$FirstTime{$YearRequired.$monthix}=0;$LastTime{$YearRequired.$monthix}=0;$LastUpdate{$YearRequired.$monthix}=0;
$MonthVisits{$YearRequired.$monthix}=0;$MonthUnique{$YearRequired.$monthix}=0;$MonthPages{$YearRequired.$monthix}=0;$MonthHits{$YearRequired.$monthix}=0;$MonthBytes{$YearRequired.$monthix}=0;
}
-&Init_HashArray;
+&Init_HashArray; # Should be useless in perl (except with mod_perl that keep variables in memory).
# Show logo
print "<table WIDTH=$WIDTH>\n";
#if (($YearRequired == $nowyear) && ($MonthRequired eq "year" || $MonthRequired == $nowmonth)) {
# No update (no log processing) if UpdateStats != 1
if ($UpdateStats) {
+ &debug("Start Update process");
#------------------------------------------
# READING THE LAST PROCESSED HISTORY FILE
# Save current processed month $monthtoprocess
if ($UpdateStats && $monthtoprocess) { # If monthtoprocess is still 0, it means there was no history files and we found no valid lines in log file
&Save_History_File($yeartoprocess,$monthtoprocess); # We save data for this month,year
- if (($MonthRequired ne "year") && ($monthtoprocess != $MonthRequired)) { &Init_HashArray($yeartoprocess,$monthtoprocess); } # Not a desired month, so we clean data
+ if (($MonthRequired ne "year") && ($monthtoprocess != $MonthRequired)) { &Init_HashArray($yeartoprocess,$monthtoprocess); } # Not a desired month (wrong month), so we clean data arrays
+ if (($MonthRequired eq "year") && ($yeartoprocess != $YearRequired)) { &Init_HashArray($yeartoprocess,$monthtoprocess); } # Not a desired month (wrong year), so we clean data arrays
}
# Archive LOG file into ARCHIVELOG