Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, April 20, 2024

File: [Platon] / phpWebLogAnalyzer / test.php (download)

Revision 1.9, Wed Mar 27 23:32:31 2002 UTC (22 years ago) by jombik9

Changes since 1.8: +0 -1 lines

Week Number Magic class.

<?php

//error_reporting (E_ALL ^ E_NOTICE);

// this function will handle all errors reported by PHP
function php_error_handler($errno, $errstr, $errfile, $errline)
{
    echo "<table bgcolor=lightblue>";
    echo "<tr><th colspan=2>";
    echo "An error occured";
    echo "</th></tr>";

    foreach(array(
                'file' => $errfile,
                'line' => $errline,
                'code' => $errno,
                'message' => $errstr)
            as $key => $val) {

        echo "<tr><td>";
        echo "<b>".htmlspecialchars($key)."</b>";
        echo "</td><td>";
        echo htmlspecialchars($val);
        echo "</td></tr>";
    }

    die();
}

set_error_handler ('php_error_handler');

function pear_error_handler($err_obj)
{
    $error_string = $err_obj->getMessage() . ' | ' . $err_obj->getDebugInfo();

    trigger_error($error_string, E_USER_ERROR);
}

function get_mtime()
{
    $mtime = microtime();
    $mtime = explode(" ", $mtime);
    $mtime = $mtime[1] + $mtime[0];

    return $mtime;
}

$start_time = get_mtime();

include("./phpWebLogAnalyzer.inc.php");


$weblog = new Web_Log("mysql://test:test@localhost/test");

$weblog->enableRawLog();
//$weblog->disableRawLog();

$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>";
}

echo("<hr>Processing time: "
        . sprintf("%.2f", get_mtime() - $start_time));

?>

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top