|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56518 Package statistics per category show 1 random release only
Submitted: 2005-08-31 14:28 UTC Modified: 2006-10-18 15:28 UTC
From: pear dot nosey at veggerby dot dk Assigned: cellog (profile)
Status: Closed Package: PECL website (PECL)
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: pear dot nosey at veggerby dot dk
New email:
PHP Version: OS:


 [2005-08-31 14:28 UTC] pear dot nosey at veggerby dot dk
On the package statistics page, when selecting a category, fx. HTTP ( 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.rid, ps.cid 
-	                  FROM package_stats ps, packages p 
-	                  WHERE p.package_type = 'pear' AND = AND
-	                  p.category = %s GROUP BY ORDER BY ps.dl_number DESC",
+	$query = sprintf("SELECT sum(ps.dl_number) as dl_number, ps.package,, ps.rid, ps.cid 
+                      FROM package_stats ps, packages p
+                      WHERE = AND p.package_type = 'pear' AND
+                      p.category = %s GROUP BY ORDER BY dl_number DESC",

Expected result:
The sum of _all_ releases of the package.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-18 15:28 UTC]
This bug has been fixed in CVS.

If this was a documentation problem, the fix will appear on by the end of next Sunday (CET).

If this was a problem with the 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.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Nov 29 07:01:28 2023 UTC