The AnalyseAccessLogSql? plugin provides a framework to analyse the SQL access log and display the results. This information may be sensitive and therefore this plugin is limited to administrator access only.
A small number of queries that may (or might not) use the MySQL specific dialect of SQL are provided in lib/plugin/AnalyseAccessLogSql.php. For more information, please see the section Adding new queries below.
Experimental! Will change a lot.
<?plugin AnalyseAccessLogSql mode=<QUERY NAME> ?>
The file lib/plugin/AnalyseAccessLogSql?.php contains a default set of queries against the SQL access log. Feel free to change this file to suit your own needs, but please note that this requires filesystem access to the web server where PhpWiki is running. In particular, this file may need to be modified to correctly query databases other than MySQL. The queries supplied by default are: "Referring URLs", "Referring Domains", "Remote Hosts", "Users" and "Host Users".
To add a new query, add a new section towards the end of the file, using one of the existing queries as a template. An example of an existing query is:
} elseif ($mode=="Users") {
$query = "SELECT "
."remote_user AS User, "
."count(*) AS 'Access Count' "
."FROM $accesslog "
.($whereConditions ? 'WHERE '.$whereConditions : '')
."GROUP BY User";
If you do add a query, please consider contributing it back to the PhpWiki project at http://http://sourceforge.net/projects/phpwiki
input arguments:
output:
conventions:
While constructing the query string,
language hints for PHP newbies - please remember:
PhpWiki:CharlesCorrigan
Changes by PhpWiki:ReiniUrban