logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: pear-core /PEAR/Command Channels.php: msg#00161

Subject: cvs: pear-core /PEAR/Command Channels.php
cellog          Thu Apr 28 00:10:16 2005 EDT

  Modified files:              
    /pear-core/PEAR/Command     Channels.php 
  Log:
  fix channel-info for REST
  
http://cvs.php.net/diff.php/pear-core/PEAR/Command/Channels.php?r1=1.40&r2=1.41&ty=u
Index: pear-core/PEAR/Command/Channels.php
diff -u pear-core/PEAR/Command/Channels.php:1.40 
pear-core/PEAR/Command/Channels.php:1.41
--- pear-core/PEAR/Command/Channels.php:1.40    Sun Mar 20 20:47:25 2005
+++ pear-core/PEAR/Command/Channels.php Thu Apr 28 00:10:16 2005
@@ -18,7 +18,7 @@
  * @author     Greg Beaver <cellog@xxxxxxx>
  * @copyright  1997-2005 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: Channels.php,v 1.40 2005/03/21 01:47:25 cellog Exp $
+ * @version    CVS: $Id: Channels.php,v 1.41 2005/04/28 04:10:16 cellog Exp $
  * @link       http://pear.php.net/package/PEAR
  * @since      File available since Release 1.4.0a1
  */
@@ -386,17 +386,17 @@
 
             $data['data'] = array();
             $data['caption'] = 'Server Capabilities';
-            $data['headline'] = array('Type', 'Version', 'Function Name', 
'URI');
+            $data['headline'] = array('Type', 'Version/REST type', 'Function 
Name/REST base');
             $capabilities = $chan->getFunctions('xmlrpc');
             $soaps = $chan->getFunctions('soap');
-            if ($capabilities || $soaps) {
+            if ($capabilities || $soaps || $chan->supportsREST()) {
                 if ($capabilities) {
                     if (!isset($capabilities[0])) {
                         $capabilities = array($capabilities);
                     }
                     foreach ($capabilities as $protocol) {
                         $data['data'][] = array('xmlrpc', 
$protocol['attribs']['version'],
-                            $protocol['_content'], '');
+                            $protocol['_content']);
                     }
                 }
                 if ($soaps) {
@@ -405,7 +405,17 @@
                     }
                     foreach ($soaps as $protocol) {
                         $data['data'][] = array('soap', 
$protocol['attribs']['version'],
-                            $protocol['_content'], '');
+                            $protocol['_content']);
+                    }
+                }
+                if ($chan->supportsREST()) {
+                    $funcs = $chan->getFunctions('rest');
+                    if (!isset($funcs[0])) {
+                        $funcs = array($funcs);
+                    }
+                    foreach ($funcs as $protocol) {
+                        $data['data'][] = array('rest', 
$protocol['attribs']['type'],
+                            $protocol['_content']); 
                     }
                 }
             } else {
@@ -424,10 +434,10 @@
                 foreach ($mirrors as $mirror) {
                     $data['data'] = array();
                     $data['caption'] = 'Mirror ' . $mirror['attribs']['host'] 
. ' Capabilities';
-                    $data['headline'] = array('Type', 'Version', 'Function 
Name', 'URI');
+                    $data['headline'] = array('Type', 'Version/REST type', 
'Function Name/REST base');
                     $capabilities = $chan->getFunctions('xmlrpc', 
$mirror['attribs']['host']);
                     $soaps = $chan->getFunctions('soap', 
$mirror['attribs']['host']);
-                    if ($capabilities || $soaps) {
+                    if ($capabilities || $soaps || 
$chan->supportsREST($mirror['attribs']['host'])) {
                         if ($capabilities) {
                             if (!isset($capabilities[0])) {
                                 $capabilities = array($capabilities);
@@ -446,6 +456,16 @@
                                     $protocol['_content'], '');
                             }
                         }
+                        if ($chan->supportsREST($mirror['attribs']['host'])) {
+                            $funcs = $chan->getFunctions('rest', 
$mirror['attribs']['host']);
+                            if (!isset($funcs[0])) {
+                                $funcs = array($funcs);
+                            }
+                            foreach ($funcs as $protocol) {
+                                $data['data'][] = array('rest', 
$protocol['attribs']['type'],
+                                    $protocol['_content']); 
+                            }
+                        }
                     } else {
                         $data['data'][] = array('No supported protocols');
                     }



<Prev in Thread] Current Thread [Next in Thread>