logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

cvs: pear-core /PEAR Remote.php: msg#00083

Subject: cvs: pear-core /PEAR Remote.php
cellog          Sun Mar 26 23:06:10 2006 UTC

  Modified files:              
    /pear-core/PEAR     Remote.php 
  Log:
  remove as many @ as possible
  
http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/Remote.php?r1=1.77&r2=1.78&diff_format=u
Index: pear-core/PEAR/Remote.php
diff -u pear-core/PEAR/Remote.php:1.77 pear-core/PEAR/Remote.php:1.78
--- pear-core/PEAR/Remote.php:1.77      Sat Mar 25 21:09:08 2006
+++ pear-core/PEAR/Remote.php   Sun Mar 26 23:06:10 2006
@@ -16,7 +16,7 @@
  * @author     Greg Beaver <cellog@xxxxxxx>
  * @copyright  1997-2006 The PHP Group
  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
- * @version    CVS: $Id: Remote.php,v 1.77 2006/03/25 21:09:08 cellog Exp $
+ * @version    CVS: $Id: Remote.php,v 1.78 2006/03/26 23:06:10 cellog Exp $
  * @link       http://pear.php.net/package/PEAR
  * @since      File available since Release 0.1
  */
@@ -177,15 +177,20 @@
         if ($this->cache !== null && $this->cache['age'] < $cachettl) {
             return $this->cache['content'];
         }
+        $fp = false;
         if (extension_loaded("xmlrpc")) {
             $result = call_user_func_array(array(&$this, 'call_epi'), $args);
             if (!PEAR::isError($result)) {
                 $this->saveCache($_args, $result);
             }
             return $result;
-        } elseif (!@include_once 'XML/RPC.php') {
+        } elseif (!($fp = fopen('XML/RPC.php', 'r', true))) {
             return $this->raiseError("For this remote PEAR operation you need 
to load the xmlrpc extension or install XML_RPC");
         }
+        include_once 'XML/RPC.php';
+        if ($fp) {
+            fclose($fp);
+        }
 
         array_shift($args);
         $username = $this->config->get('username');
@@ -202,13 +207,13 @@
         }
         $proxy_host = $proxy_port = $proxy_user = $proxy_pass = '';
         if ($proxy = parse_url($this->config->get('http_proxy'))) {
-            $proxy_host = @$proxy['host'];
+            $proxy_host = isset($proxy['host']) ? $proxy['host'] : null;
             if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') {
                 $proxy_host = 'https://' . $proxy_host;
             }
-            $proxy_port = @$proxy['port'];
-            $proxy_user = @urldecode(@$proxy['user']);
-            $proxy_pass = @urldecode(@$proxy['pass']);
+            $proxy_port = isset($proxy['port']) ? $proxy['port'] : null;
+            $proxy_user = isset($proxy['user']) ? urldecode($proxy['user']) : 
null;
+            $proxy_pass = isset($proxy['pass']) ? urldecode($proxy['pass']) : 
null;
         }
         $shost = $server_host;
         if ($channel->getSSL()) {
@@ -246,30 +251,9 @@
 
     function call_epi($method)
     {
-        do {
-            if (extension_loaded("xmlrpc")) {
-                break;
-            }
-            if (OS_WINDOWS) {
-                $ext = 'dll';
-            } elseif (PHP_OS == 'HP-UX') {
-                $ext = 'sl';
-            } elseif (PHP_OS == 'AIX') {
-                $ext = 'a';
-            } else {
-                $ext = 'so';
-            }
-            $ext = OS_WINDOWS ? 'dll' : 'so';
-            @dl("xmlrpc-epi.$ext");
-            if (extension_loaded("xmlrpc")) {
-                break;
-            }
-            @dl("xmlrpc.$ext");
-            if (extension_loaded("xmlrpc")) {
-                break;
-            }
-            return $this->raiseError("unable to load xmlrpc extension");
-        } while (false);
+        if (!extension_loaded("xmlrpc")) {
+            return $this->raiseError("xmlrpc extension is not loaded");
+        }
         $server_channel = $this->config->get('default_channel');
         $channel = $this->_registry->getChannel($server_channel);
         if (!PEAR::isError($channel)) {
@@ -302,13 +286,13 @@
         if ($http_proxy = $this->config->get('http_proxy')) {
             $proxy = parse_url($http_proxy);
             $proxy_host = $proxy_port = $proxy_user = $proxy_pass = '';
-            $proxy_host = @$proxy['host'];
+            $proxy_host = isset($proxy['host']) ? $proxy['host'] : null;
             if (isset($proxy['scheme']) && $proxy['scheme'] == 'https') {
-                $proxy_host = 'ssl://' . $proxy_host;
+                $proxy_host = 'https://' . $proxy_host;
             }
-            $proxy_port = @$proxy['port'];
-            $proxy_user = @urldecode(@$proxy['user']);
-            $proxy_pass = @urldecode(@$proxy['pass']);
+            $proxy_port = isset($proxy['port']) ? $proxy['port'] : null;
+            $proxy_user = isset($proxy['user']) ? urldecode($proxy['user']) : 
null;
+            $proxy_pass = isset($proxy['pass']) ? urldecode($proxy['pass']) : 
null;
             $fp = @fsockopen($proxy_host, $proxy_port);
             $use_proxy = true;
             if ($channel->getSSL()) {

-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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