summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/NeonXP/DozorApi.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/NeonXP/DozorApi.php b/src/NeonXP/DozorApi.php
index c3b492e..8c7c510 100644
--- a/src/NeonXP/DozorApi.php
+++ b/src/NeonXP/DozorApi.php
@@ -45,17 +45,18 @@ class DozorApi
"action" => 'entcod',
];
$data = http_build_query($params);
- $context = [
+ $contextData = [
'http' => [
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $data
]
];
- $context = stream_context_create($context);
+ $context = stream_context_create($contextData);
$result = file_get_contents($this->getLink($chat), false, $context);
+ $contextData['result'] = $result;
- return $this->parseResult($result);
+ return json_encode($contextData, JSON_UNESCAPED_UNICODE);
}
private function parseResult($html)
@@ -109,4 +110,4 @@ class DozorApi
{
return $this->cache->fetch("link_{$chat->getId()}");
}
-} \ No newline at end of file
+}