At first I thought that something is wrong with my goaccess_delete functions but I don't see anything wrong with it. Then I've tested AWstats and awstats_delete isn't triggered as well. The AWstats config still remains in /etc/awstats/awstats.<domain>.conf even after switching the stats_type to something else. Could somebody verify this? Is my stable-3.1 codebase somewhere messed up or does that happen also to others?
I guess that the config gets removed only when you delete the website and not when you change the statistic software. To which event did you attach your delete function?
It was "function delete", haven't checked the function name before adding it because I copy-catted awstats_delete, mea culpa However, does that make sense at all that the configs are getting deleted at removal of the webspace when this is already executed before (awstats|goaccess)_delete: Code: if($do_delete === true && $delete_folder !== '') $app->system->exec_safe('rm -rf ?', $docroot.'/'.$delete_folder); ? If you don't mind I would create a MR and move awstats_delete and goaccess_delete to function update.
The question is if we want to delete stats history in case someone tries out a different stats anylzer. I guess some users would find it annoying when their stats history in the originally used tool is gone just because they tried out a different stats software.
goaccess_delete only deletes the config file in <document_root>/log and not the processed stats in web/stats/.db folder and as far as what I've seen awstats_delete is doing the same while retaining the processed stats too in /var/lib/awstats. Imho it should be safe moving these two to function update.
ok, then feel free to make an mr for it. just take care that the data gets also removed when the site gets removed as update is not called on website deletion.