Bug #5259 [Asn->Csd]: Package statistics per category show 1 random release only
| From: | cellog@php.net | Date: | Wed, 18 Oct 2006 19:28:49 +0000 |
| Subject: | Bug #5259 [Asn->Csd]: Package statistics per category show 1 random release only | ||
| References: | 1 | Groups: | php.pear.webmaster |
| Request: | Send a blank email to pear-webmaster+get-5317@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=5259&edit=1
ID: 5259
Updated by: cellog@php.net
Reported By: pear dot nosey at veggerby dot dk
-Status: Assigned
+Status: Closed
Id: 5259
Type: Bug
Package: Web Site
Operating System: irrelevant
PHP Version: Irrelevant
-Assigned To: pajoye
+Assigned To: cellog
New Comment:
This bug has been fixed in CVS.
If this was a documentation problem, the fix will appear on
pear.php.net by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
Previous Comments:
------------------------------------------------------------------------
[2005-08-31 14:28:30] pear dot nosey at veggerby dot dk
Description:
------------
On the package statistics page, when selecting a category, fx. HTTP
(http://pear.php.net/package-stats.php?cid=11&pid=&rid=). HTTP_Upload
shows with 36.000+ downloads, while it on the statitics page for the
package shows 72.000+ downloads.
The downloads it seems are only show for 1 relase of the package (and a
random it seems for HTTP_Upload it seems to be version 0.8.1)
Test script:
---------------
Without having done a deep review of the code, it seems to be a problem
with the SQL for the 'cid' case - it does not sum over the dl_number.
I think this ought to fix it:
Index: package-stats.php
===================================================================
RCS file: /repository/pearweb/public_html/package-stats.php,v
retrieving revision 1.69
diff -u -r1.69 package-stats.php
--- package-stats.php 1 Jun 2005 14:04:49 -0000 1.69
+++ package-stats.php 31 Aug 2005 18:19:06 -0000
@@ -317,10 +317,10 @@
$total_categories = $dbh->getOne(sprintf("SELECT COUNT(*) FROM
categories WHERE parent = %d", $_GET['cid']));
// Query to get package list from package_stats_table
- $query = sprintf("SELECT ps.dl_number, ps.package, ps.release,
ps.pid, ps.rid, ps.cid
- FROM package_stats ps, packages p
- WHERE p.package_type = 'pear' AND p.id = ps.pid
AND
- p.category = %s GROUP BY ps.pid ORDER BY
ps.dl_number DESC",
+ $query = sprintf("SELECT sum(ps.dl_number) as dl_number, ps.package,
ps.pid, ps.rid, ps.cid
+ FROM package_stats ps, packages p
+ WHERE p.id = ps.pid AND p.package_type = 'pear'
AND
+ p.category = %s GROUP BY ps.pid ORDER BY
dl_number DESC",
$_GET['cid']
);
Expected result:
----------------
The sum of _all_ releases of the package.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=5259&edit=1