com web/bugs: Add simple PHP version stats: www/stats.php
| From: | Johannes Schlüter | Date: | Wed, 07 Aug 2013 17:25:15 +0000 |
| Subject: | com web/bugs: Add simple PHP version stats: www/stats.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-16454@lists.php.net to get a copy of this message | ||
Commit: 3a9bc07b12021b80ed251c4fef6d6474e2087fb6
Author: Johannes Schlüter <johannes@schlueters.de> Wed, 7 Aug 2013 19:25:15 +0200
Parents: ba3da64f11ab42b0e93cd2278eb1316bcb3ba220
Branches: master
Link: http://git.php.net/?p=web/bugs.git;a=commitdiff;h=3a9bc07b12021b80ed251c4fef6d6474e2087fb6
Log:
Add simple PHP version stats
Changed paths:
M www/stats.php
Diff:
diff --git a/www/stats.php b/www/stats.php
index 9f2c960..c687f0b 100644
--- a/www/stats.php
+++ b/www/stats.php
@@ -144,7 +144,33 @@ OUTPUT;
}
}
-echo "</table>\n";
+echo "</table>\n<hr>\n<b>PHP Versions for recent bug reports:";
+
+$query = " SELECT DATE_FORMAT(ts1, '%Y-%m') as d,
+ IF(b.php_version LIKE '_._Git%', SUBSTR(b.php_version, 1, 6),
b.php_version) AS php_version,
+ COUNT(*) AS quant
+ FROM bugdb AS b
+ WHERE ts1 >= CONCAT(YEAR(NOW())-1, '-', MONTH(NOW()), '-01
00:00:00')
+ {$where}
+ GROUP BY d, php_version
+ ORDER BY d, quant";
+
+$result = $dbh->prepare($query)->execute();
+
+$last_date = null;
+while ($row = $result->fetchRow(MDB2_FETCHMODE_ASSOC)) {
+ if ($row['d'] != $last_date) {
+ if ($last_date !== null) {
+ echo "</table>\n\n";
+ }
+ echo "<b>{$row[d]}:</b><br>\n<table>\n";
+ $last_date = $row['d'];
+ }
+ echo "<tr><td class='bug_head'>{$row[php_version]}</td><td
class='bug_bg1'>{$row[quant]}</td></tr>\n";
+}
+if ($last_date) {
+ echo "</table>\n\n";
+}
response_footer();