Fix downloadToDir method

This commit is contained in:
Alexander Pankratov 2023-05-22 19:45:44 +02:00
parent 6ee61530c4
commit 149149b281
2 changed files with 16 additions and 15 deletions

20
composer.lock generated
View File

@ -1113,16 +1113,16 @@
}, },
{ {
"name": "amphp/parallel", "name": "amphp/parallel",
"version": "v2.2.0", "version": "v2.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/amphp/parallel.git", "url": "https://github.com/amphp/parallel.git",
"reference": "37850ff591155c6f5c662173c3fc75682752c918" "reference": "ba11031b8664134b13c150530ae041a75e631858"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/amphp/parallel/zipball/37850ff591155c6f5c662173c3fc75682752c918", "url": "https://api.github.com/repos/amphp/parallel/zipball/ba11031b8664134b13c150530ae041a75e631858",
"reference": "37850ff591155c6f5c662173c3fc75682752c918", "reference": "ba11031b8664134b13c150530ae041a75e631858",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1184,7 +1184,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/amphp/parallel/issues", "issues": "https://github.com/amphp/parallel/issues",
"source": "https://github.com/amphp/parallel/tree/v2.2.0" "source": "https://github.com/amphp/parallel/tree/v2.2.1"
}, },
"funding": [ "funding": [
{ {
@ -1192,7 +1192,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-05-12T22:42:36+00:00" "time": "2023-05-22T03:33:27+00:00"
}, },
{ {
"name": "amphp/parser", "name": "amphp/parser",
@ -2452,12 +2452,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/danog/MadelineProto.git", "url": "https://github.com/danog/MadelineProto.git",
"reference": "d863b40df729c8ad438916cb08b977ebbb41a714" "reference": "ea44d93f1c5a8898f25bc5fd04a097de835e7acc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/danog/MadelineProto/zipball/d863b40df729c8ad438916cb08b977ebbb41a714", "url": "https://api.github.com/repos/danog/MadelineProto/zipball/ea44d93f1c5a8898f25bc5fd04a097de835e7acc",
"reference": "d863b40df729c8ad438916cb08b977ebbb41a714", "reference": "ea44d93f1c5a8898f25bc5fd04a097de835e7acc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2572,7 +2572,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2023-05-15T09:44:17+00:00" "time": "2023-05-22T17:44:42+00:00"
}, },
{ {
"name": "danog/primemodule", "name": "danog/primemodule",

View File

@ -164,11 +164,11 @@ abstract class AbstractApiController
$madelineProtoExtensions = new $this->extensionClass($madelineProto, $this->request, $this->file); $madelineProtoExtensions = new $this->extensionClass($madelineProto, $this->request, $this->file);
$result = $madelineProtoExtensions->{$this->api[0]}(...$this->parameters); $result = $madelineProtoExtensions->{$this->api[0]}(...$this->parameters);
} else { } else {
if ($this->api[0] === 'API') { if ($this->api[0] === 'API') {
$madelineProto = Client::getWrapper($madelineProto)->getAPI(); $madelineProto = Client::getWrapper($madelineProto)->getAPI();
array_shift($this->api); array_shift($this->api);
$pathCount = count($this->api); $pathCount = count($this->api);
} }
//Проверяем нет ли в MadilineProto такого метода. //Проверяем нет ли в MadilineProto такого метода.
switch ($pathCount) { switch ($pathCount) {
case 1: case 1:
@ -237,6 +237,7 @@ abstract class AbstractApiController
$data, $data,
JSON_THROW_ON_ERROR | JSON_THROW_ON_ERROR |
JSON_INVALID_UTF8_SUBSTITUTE | JSON_INVALID_UTF8_SUBSTITUTE |
JSON_PARTIAL_OUTPUT_ON_ERROR |
JSON_PRETTY_PRINT | JSON_PRETTY_PRINT |
JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_SLASHES |
JSON_UNESCAPED_UNICODE JSON_UNESCAPED_UNICODE