version 1.16, 2002/09/04 02:28:14 |
version 1.17, 2002/09/05 01:27:32 |
|
|
* http://www.platon.sk/projects/phpWebLogAnalyzer/ |
* http://www.platon.sk/projects/phpWebLogAnalyzer/ |
*/ |
*/ |
|
|
|
/* $Id$ */ |
|
|
function get_mtime() |
function get_mtime() |
{ |
{ |
$mtime = microtime(); |
$mtime = microtime(); |
Line 65 set_error_handler('php_error_handler'); |
|
Line 67 set_error_handler('php_error_handler'); |
|
require_once './phpWebLogAnalyzer.inc.php'; |
require_once './phpWebLogAnalyzer.inc.php'; |
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_error_handler'); |
PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'pear_error_handler'); |
|
|
|
# |
|
# Object creation |
|
# |
|
|
$weblog = new Web_Log('mysql://test:test@localhost/test'); |
$weblog = new Web_Log('mysql://test:test@localhost/test'); |
|
|
|
# |
|
# Web log object configuration |
|
# |
|
|
$weblog->enableTruncateNames(); |
$weblog->enableTruncateNames(); |
$weblog->enableRawLog(); |
$weblog->enableRawLog(); |
//$weblog->disableRawLog(); |
//$weblog->disableRawLog(); |
$weblog->enablePropertyCache('remote_host'); |
$weblog->enablePropertyCache('remote_host'); |
|
|
//$weblog->disableProperty('session_id'); |
# |
$weblog->registerAccess(3); |
# Registering access |
|
# (in following `if' use 1 for normal log, 0 for remote log) |
echo ("<hr>Session ID: " |
# |
. $weblog->getPropertyValue("session_id") . "<br>"); |
|
|
if (1) { |
|
//$weblog->disableProperty('session_id'); |
|
$weblog->registerAccess(3); |
|
echo '<hr>Session ID: '.$weblog->getPropertyValue('session_id').'<br>'; |
|
|
|
if (0) { |
|
$weblog->enableRawLog(); |
|
echo("<hr>Raw session count: " |
|
. $weblog->getSessionsCount() |
|
. "<br>"); |
|
$weblog->disableRawLog(); |
|
echo("<hr>Normal session count: " |
|
. $weblog->getSessionsCount() |
|
. "<br>"); |
|
|
|
$weblog->enableRawLog(); |
|
echo "<hr>Raw active sessions: "; |
|
$active_sessions = $weblog->getActiveSessions(); |
|
var_dump($active_sessions); |
|
echo "<br>"; |
|
|
|
$weblog->disableRawLog(); |
|
echo "<hr>Normal active sessions: "; |
|
$active_sessions = $weblog->getActiveSessions(); |
|
var_dump($active_sessions); |
|
echo "<br>"; |
|
} |
|
|
if (0) { |
} else { |
$weblog->enableRawLog(); |
echo '<hr>Remote log: '; |
echo("<hr>Raw session count: " |
$ret = $weblog->remoteLog('http://maxim.platon.sk/~ondrej/development/phpWebLogAnalyzer/utils/remote-log.php'); |
. $weblog->getSessionsCount() |
if (PEAR::isError($ret)) { |
. "<br>"); |
echo $ret->getMessage(); |
$weblog->disableRawLog(); |
} else { |
echo("<hr>Normal session count: " |
echo 'OK'; |
. $weblog->getSessionsCount() |
} |
. "<br>"); |
|
|
|
$weblog->enableRawLog(); |
|
echo "<hr>Raw active sessions: "; |
|
$active_sessions = $weblog->getActiveSessions(); |
|
var_dump($active_sessions); |
|
echo "<br>"; |
|
|
|
$weblog->disableRawLog(); |
|
echo "<hr>Normal active sessions: "; |
|
$active_sessions = $weblog->getActiveSessions(); |
|
var_dump($active_sessions); |
|
echo "<br>"; |
|
} |
} |
|
|
echo("<hr>Processing time: " |
# |
. sprintf("%.2f", get_mtime() - $start_time)); |
# Processing time counting |
|
# |
|
|
|
echo("<hr>Processing time: ".sprintf("%.2f", get_mtime() - $start_time)); |
|
|
|
# |
|
# Debug information printing |
|
# |
|
|
$debug = isset($HTTP_GET_VARS['debug']) ? $HTTP_GET_VARS['debug'] : 0; |
$debug = isset($HTTP_GET_VARS['debug']) ? $HTTP_GET_VARS['debug'] : 0; |
if (intval($debug) > 0) { |
if (intval($debug) > 0) { |
Line 114 if (intval($debug) > 0) { |
|
Line 146 if (intval($debug) > 0) { |
|
echo '</pre>'; |
echo '</pre>'; |
} |
} |
|
|
|
# |
|
# Navigation links |
|
# |
|
|
echo("<hr>Click <a href=\"$PHP_SELF\">here</a> to get HTTP refferer work."); |
echo("<hr>Click <a href=\"$PHP_SELF\">here</a> to get HTTP refferer work."); |
echo("<br>Click <a href=\"$PHP_SELF?debug=1\">here</a> to get <code>var_dump()</code> of all variables."); |
echo("<br>Click <a href=\"$PHP_SELF?debug=1\">here</a> to get <code>var_dump()</code> of all variables."); |
|
|
|
# |
|
# Object destroying |
|
# |
|
|
$weblog->destroy(); |
$weblog->destroy(); |
|
|
?> |
?> |