예제 #1
0
파일: cURL.class.php 프로젝트: xpeknw/vc
 public function request_url($params)
 {
     $fed = new FederationSocket();
     $user = json_decode($fed->send(null, "http://localhost", 'GET'), true);
     return $user;
     // $ch = curl_init("http://localhost:8080");
     // $fp = fopen("example_homepage.txt", "w");
     // curl_setopt($ch, CURLOPT_FILE, $fp);
     // curl_setopt($ch, CURLOPT_HEADER, 0);
     // return curl_exec($ch);
     // curl_close($ch);
     // fclose($fp);
 }
예제 #2
0
 public static function send($service, $url, $method, $args = array(), $failonerror = 1)
 {
     if (!($failonerror === 0 || $failonerror === 1)) {
         $msg = $msg_http = "Bad parameter value: " . $failonerror;
         throw new Error(400, $msg, __FILE__, __METHOD__, __LINE__, $msg_http);
     }
     return FederationSocket::execute($url, $method, $args, $failonerror);
 }