Beispiel #1
0
 /**
  * Attempt to get the resource at $url
  * Loop through all potential methods until successful
  */
 function Get($url, $args = array())
 {
     $methods = array('stream', 'fopen', 'fsockopen');
     foreach ($methods as $method) {
         if (!gpRemoteGet::Supported($method)) {
             continue;
         }
         $result = gpRemoteGet::GetMethod($method, $url, $args);
         if ($result === false) {
             continue;
         }
         return $result;
     }
     return false;
 }
Beispiel #2
0
 static function _get($url, $args = array())
 {
     $url = rawurldecode($url);
     $methods = array('stream', 'fopen', 'fsockopen');
     foreach ($methods as $method) {
         if (!gpRemoteGet::Supported($method)) {
             continue;
         }
         $result = gpRemoteGet::GetMethod($method, $url, $args);
         if ($result === false) {
             return false;
         }
         self::$debug['Method'] = $method;
         self::$debug['Len'] = strlen($result['body']);
         return $result;
     }
     return false;
 }