Hi,
I have a rather large number of websites and in order to keep some overview, I structured the AWstats data directory like this:
data/
├── www01.example.com
│ ├── awstats022024.www01.example.com.txt
│ └── awstats032024.www01.example.com.txt
├── www02.example.com
│ ├── awstats022024.www02.example.com.txt
│ └── awstats032024.www02.example.com.txt
└── www03.example.com
├── awstats022024.www03.example.com.txt
└── awstats032024.www03.example.com.txt
This structure was no problem with awstatstotals.php
version 1.18. The configs and numbers are shown on the page. However, version 1.22 does show the configs, but all numbers are zeros.
The parse_dir
method does scan the data directory recursively and it finds all database files. It takes the (full) path into account. The problem is that in numerous places, the method make_filename
is called. This method synthesizes the filename using the name of the config, the year and the month. The method kind of assumes that the database files are all in the $DirData
directory, but that is obviously not true for nested data directories. Since make_filename
does not take the actual path to the database file into account, the files cannot be found, resulting in the numbers not being able to be calculated. I asked myself: why would one synthesize the filename while the filename is already available (in $files
)?
I began writing a patch for fixing the problem, but I found some methods in the class that make an easy fix hard. For example, the year_data
method. Looking into it, I found that this method is declared, but not used. And I found a couple of more of these methods:
- errors404_list
- month_data
- pages_url_list
- year_data
So I was wondering, what is the deal with these methods? Are they in the class for future use? If not, could they be removed.
If I would fix the problem, would you like a patch file or rather an PR?
-Remy