com web/master: Modify the always-100% 'PHP 5' stat to be a more useful currently-active-release overview.: manage/mirrors.php
| From: | Daniel P. Brown | Date: | Mon, 01 Oct 2012 15:50:30 +0000 |
| Subject: | com web/master: Modify the always-100% 'PHP 5' stat to be a more useful currently-active-release overview.: manage/mirrors.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-14791@lists.php.net to get a copy of this message | ||
Commit: 80d3ccdd3f682f2c494e597d1f10e6f78fdaa7dd
Author: Daniel P. Brown <danbrown@php.net> Mon, 1 Oct 2012 11:50:30 -0400
Parents: 19a809e66b859510b191a296bea9fe5104fc6bb0
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=80d3ccdd3f682f2c494e597d1f10e6f78fdaa7dd
Log:
Modify the always-100% 'PHP 5' stat to be a more useful currently-active-release overview.
Changed paths:
M manage/mirrors.php
Diff:
diff --git a/manage/mirrors.php b/manage/mirrors.php
index 9dfb0f4..8d54efc 100644
--- a/manage/mirrors.php
+++ b/manage/mirrors.php
@@ -310,7 +310,13 @@ foot();
function page_mirror_list($moreinfo = false)
{
global $checktime;
-
+
+ // For counting versions and building a statistical analysis
+ $php_versions = array(
+ '53' => 0,
+ '54' => 0,
+ 'other' => 0,
+ );
// Query the whole mirror list and display all mirrors. The query is
// similar to the one in the mirror fetch script. We need to get mirror
// status data to show proper icons and need to order by country too
@@ -461,6 +467,15 @@ function page_mirror_list($moreinfo = false)
// Print out version information for this mirror
$summary .= '<td align="center" class="rounded">' .
$row['phpversion']. '</td>' . "\n";
+ // Increment the appropriate version for our statistical overview
+ if (preg_match('/^5\.3/',$row['phpversion'])) {
+ $php_versions['53']++;
+ } elseif (preg_match('/^5.4/',$row['phpversion'])) {
+ $php_versions['54']++;
+ } else {
+ $php_versions['other']++;
+ }
+
// Print out mirror stats table cell
$summary .= '<td align="right" class="rounded">' .
$statscell . '</td>' . "\n";
@@ -511,6 +526,10 @@ function page_mirror_list($moreinfo = false)
// Create version specific statistics
$stats['version5_percent'] = sprintf('%.1f%%',
$stats['phpversion_counts'][5] / $stats['mirrors'] * 100);
+ $php53_percent = sprintf('%.1f%%',($php_versions['53'] /
$stats['mirrors']) * 100);
+ $php54_percent = sprintf('%.1f%%',($php_versions['54'] /
$stats['mirrors']) * 100);
+ $php_other_versions = sprintf('%.1f%%',($php_versions['other'] /
$stats['mirrors']) * 100);
+
$stats['has_stats_percent'] = sprintf('%.1f%%',
$stats['has_stats'] / $stats['mirrors'] * 100);
$last_check_time = get_print_date($checktime);
@@ -562,8 +581,16 @@ echo <<<EOS
</tr>
<tr>
<td><img src="/images/mirror_info.png" /></td>
- <td>PHP 5:</td>
- <td>{$stats['version5_percent']}</td>
+ <td>
+ PHP 5.3:<br/>
+ PHP 5.4:<br/>
+ Other:
+ </td>
+ <td>
+ {$php53_percent}<br/>
+ {$php54_percent}<br/>
+ {$php_other_versions}
+ </td>
</tr>
<tr>
<td colspan="3"><hr /></td>