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 <tt>lib/plugin/AnalyseAccessLogSql.php</tt>. For more information, please see the section *Adding new queries* below.

Usage

Experimental! Will change a lot.

Usage

  <?plugin AnalyseAccessLogSql mode=<QUERY NAME> ?>

Parameters

mode _(required parameter)_:

period:

count:

caption:

center:

debugShowQuery:

user:

host:

referrer:

local_referrers:

Adding new queries

The file <tt>lib/plugin/AnalyseAccessLogSql.php</tt> 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

API for AnalyseAccessLogSql

Author

CharlesCorrigan
Changes by ReiniUrban


PhpWikiDocumentation WikiPlugin

CSE Grad Student Wiki: AnalyseAccessLogSqlPlugin (last edited 2008-09-11 15:31:05 by localhost)