Changeset 754
- Timestamp:
- 01/14/10 11:12:20 (2 years ago)
- Files:
-
- 1 modified
-
trunk/phpbms/modules/api/apiwrapper.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpbms/modules/api/apiwrapper.php
r753 r754 113 113 * 114 114 * @param string $tabledefuuid The uuid of the tabledefinition that you wish to get records. 115 * @param array $data An array of table uuids (or integer ids if useUuid option is set to false)115 * @param array $data An array of associative arrays of table uuids (or integer ids if useUuid option is set to false). The key=>value format is 'uuid'=>'{the actual uuid}' 116 116 * @param array $options An associative array of options. Possible options are : 'useUuid', 'dateFormat', 'timeFormat' 117 117 * … … 460 460 461 461 /* 462 * function _encode 463 * 464 * @param array $message Message to be encoded 465 * 466 * @return string Encoded message 467 */ 468 469 private function _encode($message) { 470 471 return json_encode($message); 472 473 }//end function 474 475 476 /* 462 477 * function _decode 463 478 * … … 487 502 $params["phpbmspassword"] = $this->password; 488 503 504 if(!isset($params["request"])) 505 $params["request"] = array(); 506 507 $params["request"] = $this->_encode($params["request"]); 508 509 489 510 $this->errorMessage = ""; 490 511 $this->errorCode = ""; 491 512 492 $post_vars = $this->httpBuildQuery($params);513 $post_vars = http_build_query($params); 493 514 494 515 $payload = "POST " .$this->apiUrl. " HTTP/1.0\r\n"; … … 507 528 $port = 443; 508 529 509 $sock = fsockopen("ssl://".$ host, $port, $errno, $errstr, 30);530 $sock = fsockopen("ssl://".$this->apiHostname, $port, $errno, $errstr, 30); 510 531 } else { 511 532 … … 515 536 $port = 80; 516 537 517 $sock = fsockopen($ host, $port, $errno, $errstr, 30);538 $sock = fsockopen($this->apiHostname, $port, $errno, $errstr, 30); 518 539 } 519 540 if(!$sock) { … … 538 559 fclose($sock); 539 560 ob_end_clean(); 561 562 list($throw, $response) = explode("\r\n\r\n", $response, 2); 563 540 564 if ($info["timed_out"]) return false; 541 565