<?php
/*
* phpWebLogAnalyzer - powerful weblog and analyzer
*
* utils/table-counts.php - prints number of records in weblog tables
* ____________________________________________________________
*
* Developed by Ondrej Jombik <nepto@platon.sk>
* Copyright (c) 2001-2005 Platon SDG, http://platon.sk/
* All rights reserved.
*
* See README file for more information about this software.
* See COPYING file for license information.
*
* Download the latest version from
* http://platon.sk/projects/phpWebLogAnalyzer/
*/
/* $Platon: phpWebLogAnalyzer/utils/table-counts.php,v 1.1 2003/01/27 00:52:29 nepto Exp $ */
require_once 'config.php';
$weblog = new Web_Log($dsn);
if (! is_object($weblog)) {
die("No object.\n");
}
$weblog->disableRawLog();
foreach (array_keys($weblog->getPropertiesArray()) as $prop_name) {
$count = $weblog->getPropertyCount($prop_name);
if (DB::isError($count)) {
$count = 'error';
} else {
if ($count === false) {
$count = str_pad('N/A', 5, ' ', STR_PAD_LEFT);
} else {
$count = sprintf('%5d', $count);
}
}
echo str_pad($prop_name, 20, ' ', STR_PAD_LEFT), ' ', $count, "\n";
}
$weblog->destroy();
Platon Group <platon@platon.org> http://platon.org/
|