com web/master: Adding support for extension display.: include/functions.inc manage/mirrors.php
| From: | Daniel P. Brown | Date: | Wed, 10 Oct 2012 15:51:22 +0000 |
| Subject: | com web/master: Adding support for extension display.: include/functions.inc manage/mirrors.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-14819@lists.php.net to get a copy of this message | ||
Commit: dae5982724723dc1d2d450ef3d35c78df0ffed4d
Author: Daniel P. Brown <danbrown@php.net> Wed, 10 Oct 2012 11:51:22 -0400
Parents: 6217678165e085979d07204a88994b0655446560
Branches: master
Link: http://git.php.net/?p=web/master.git;a=commitdiff;h=dae5982724723dc1d2d450ef3d35c78df0ffed4d
Log:
Adding support for extension display.
Changed paths:
M include/functions.inc
M manage/mirrors..php
Diff:
diff --git a/include/functions.inc b/include/functions..inc
index 74c0571..8e7764a 100644
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -211,3 +211,19 @@ function get_ssh_keys($string) {
function unmangle($var_name,$filter_id=FILTER_UNSAFE_RAW) {
return real_clean(filter_var($var_name,$filter_id));
}
+
+/**
+ * If $ext is defined, return TRUE if available, FALSE if not.
+ * If $ext is not defined, return a string of all available extensions.
+ */
+function get_extension_info($mirror_hostname,$ext=null) {
+ $exts = db_get_one("SELECT ext_avail FROM mirrors WHERE
hostname='".real_clean($mirror_hostname)."'");
+ if (!is_null($ext)) {
+ if (preg_match('/\b'.$ext.'\b/Ui',$exts)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ return $exts;
+}
diff --git a/manage/mirrors.php b/manage/mirrors.php
index a9d01a0..31cd10a 100644
--- a/manage/mirrors.php
+++ b/manage/mirrors.php
@@ -286,6 +286,10 @@ if (intval($id) !== 0) {
<td><?php echo implode(' : ',
decipher_available_sqlites($row['has_search'])); ?></td>
</tr>
<tr>
+ <th align="right">Available extensions:</th>
+ <td><?php echo get_extension_info($row['hostname']); ?></td>
+ </tr>
+ <tr>
<th align="right">Local Stats:</th>
<td><?php echo ($row['has_stats'] ? "" :
"<strong>not</strong> "); ?>supported</td>
</tr>