|
|
@@ -84,11 +84,14 @@ class FindBoxCoreSystem
|
|
|
*/
|
|
|
public function CallAPI(string $URI, string $Parameters, bool $skipResponse = false): array
|
|
|
{
|
|
|
+ global $frameworkUtils;
|
|
|
+
|
|
|
$bodyJSON = null;
|
|
|
$auth = "Authorization: Basic " . base64_encode("{$this->Key}:{$this->Pass}") . "\r\n";
|
|
|
|
|
|
$streamfbOS = @stream_socket_client("tcp://{$this->Host}:{$this->Port}", $errno, $errstr, 1);
|
|
|
if (!$streamfbOS) {
|
|
|
+ $frameworkUtils->getLogger()->write("CallAPI::stream_socket_client error eode: [{$errno}]-'{$errstr}'", 'd/m/Y H:i:s');
|
|
|
return $this->returnCode($errno, $errstr);
|
|
|
} else {
|
|
|
//$requestText = "{$method} {$URI}{$Parameters} HTTP/1.0\r\nHost: {$this->Host}\r\n{$auth}Accept: */*\r\nConnection: close\r\n\r\n";
|
|
|
@@ -140,6 +143,7 @@ class FindBoxCoreSystem
|
|
|
|
|
|
$streamfbOS = @stream_socket_client("tcp://{$this->Host}:{$this->Port}", $errno, $errstr, 1);
|
|
|
if (!$streamfbOS) {
|
|
|
+ $frameworkUtils->getLogger()->write("AsyncCallAPI::stream_socket_client error eode: [{$errno}]-'{$errstr}'", 'd/m/Y H:i:s');
|
|
|
return $this->returnCode($errno, $errstr);
|
|
|
} else {
|
|
|
stream_set_blocking($streamfbOS, false);
|