svn: /web/php-bugs/trunk/www/ lstats.php

From: Date: Thu, 11 Mar 2010 16:01:21 +0000
Subject: svn: /web/php-bugs/trunk/www/ lstats.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-7551@lists.php.net to get a copy of this message
jani Thu, 11 Mar 2010 16:01:21 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=296075 Log: - Restore the quick and dirty shame list Changed paths: A web/php-bugs/trunk/www/lstats.php Added: web/php-bugs/trunk/www/lstats.php =================================================================== --- web/php-bugs/trunk/www/lstats.php (rev 0) +++ web/php-bugs/trunk/www/lstats.php 2010-03-11 16:01:21 UTC (rev 296075) @@ -0,0 +1,71 @@ +<?php + +require '../include/prepend.php'; + +function status_print ($status, $num, $width, $align = STR_PAD_LEFT) +{ + echo ucfirst($status), ':', str_pad($num, $width - strlen($status), ' ', $align), "\n\n"; +} + +function get_status_count ($status, $category = '') +{ + global $phpver, $dbh; + + $query = "SELECT count(id) from bugdb WHERE"; + + if ($phpver > 0) { + $query .= " php_version LIKE '{$phpver}%' AND"; + } + + /* Categories which are excluded from bug count */ + $excluded = "'Feature/Change Request', 'Systems problem', 'Website Problem', 'PEAR related', 'PECL related', 'Documentation problem', 'Translation problem', 'PHP-GTK related', 'Online Doc Editor problem'"; + + if ($category != '') { + $query.= " {$status} AND bug_type = 'Bug' AND package_name = '" . $dbh->escape($category). "' "; + } else { + $query.= " status='{$status}' "; + } + $query.= "AND bug_type NOT IN({$excluded})"; + + $res = $dbh->prepare($query)->execute(array()); + $row = $res->fetchRow(MDB2_FETCHMODE_ORDERED); + + return $row[0]; +} + +// Input +if (!isset($_GET['phpver'])) { + echo "<h3>Bug stats for both <a href='lstats.php?phpver=5'>PHP 5</a> and <a href='lstats.php?phpver=6'>PHP 6</a>:</h3>\n<pre>\n"; +} else { + $phpver = (int) $_GET['phpver']; + echo "<h3>Bug stats for PHP $phpver:</h3>\n<pre>\n"; +} + +if (isset($_GET['per_category'])) +{ + $pseudo_pkgs = get_pseudo_packages($site); + + $totals = array(); + foreach ($pseudo_pkgs as $category => $data) { + $count = get_status_count ("status NOT IN('to be documented', 'closed', 'bogus', 'duplicate', 'wont fix', 'no feedback')", $category); + if ($count > 0) { + $totals[$category] = $count; + } + } + arsort($totals); + foreach ($totals as $category => $total) { + status_print($category, $total, 40); + } + +} else { + + foreach ($tla as $status => $short) { + if (!in_array($status, array('Duplicate'))) { + $count = get_status_count ($status); + status_print($status, $count, 30); + } + } + +} + +echo "\n</pre>\n";

« previous php.webmaster (#7551) next »