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

File: [Platon] / phpWebLogAnalyzer / utils / table-counts.php (download)

Revision 1.2, Fri May 27 16:30:48 2005 UTC (18 years, 10 months ago) by nepto


Changes since 1.1: +4 -4 lines

Updated copyright year, e-mail address and URL.

<?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/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top