diff --git a/docs/PHP/danog/MadelineProto/API.md b/docs/PHP/danog/MadelineProto/API.md new file mode 100644 index 00000000..555f2311 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/API.md @@ -0,0 +1,2767 @@ +--- +title: danog\MadelineProto\API: Main API wrapper for MadelineProto. +description: + +--- +# `danog\MadelineProto\API` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Main API wrapper for MadelineProto. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\API::RELEASE`: Release version. + +* `danog\MadelineProto\API::NOT_LOGGED_IN`: We're not logged in. + +* `danog\MadelineProto\API::WAITING_CODE`: We're waiting for the login code. + +* `danog\MadelineProto\API::WAITING_SIGNUP`: We're waiting for parameters to sign up. + +* `danog\MadelineProto\API::WAITING_PASSWORD`: We're waiting for the 2FA password. + +* `danog\MadelineProto\API::LOGGED_IN`: We're logged in. + +* `danog\MadelineProto\API::SECRET_EMPTY`: Secret chat was not found. + +* `danog\MadelineProto\API::SECRET_REQUESTED`: Secret chat was requested. + +* `danog\MadelineProto\API::SECRET_READY`: Secret chat was found. + + +## Method list: +* `startAndLoop(string $eventHandler): void` +* `startAndLoopMulti(\danog\MadelineProto\API[] $instances, string[]|string $eventHandler): void` +* `startAndLoopAsync(string $eventHandler): \Generator` +* `MTProtoToBotAPI(array $data): \Amp\Promise` +* `MTProtoToTd(mixed $params): \Amp\Promise` +* `MTProtoToTdcli(mixed $params): \Amp\Promise` +* `acceptCall(array $call): \Amp\Promise` +* `acceptSecretChat(array $params): \Amp\Promise` +* `acceptTos(): \Amp\Promise` +* `addUser(array $user): \Amp\Promise` +* `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` +* `all((\Generator|\Promise)[] $promises): \Amp\Promise` +* `any((\Promise|\Generator)[] $promises): \Amp\Promise` +* `arr(mixed $params): array` +* `base64urlDecode(string $data): string` +* `base64urlEncode(string $data): string` +* `botAPIToMTProto(array $arguments): \Amp\Promise` +* `botLogin(string $token): \Amp\Promise` +* `call(\Generator|\Promise|mixed $promise): \Amp\Promise` +* `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` +* `callForkDefer(\Generator|\Promise $promise): void` +* `callStatus(int $id): mixed` +* `checkTos(): \Amp\Promise` +* `cleanup(): \Amp\Promise` +* `closeConnection(string $message): void` +* `complete2faLogin(string $password): \Amp\Promise` +* `completeCall(array $params): \Amp\Promise` +* `completePhoneLogin(string $code): \Amp\Promise` +* `completeSignup(string $first_name, string $last_name): \Amp\Promise` +* `confirmCall(array $params): \Amp\Promise` +* `connectToAllDcs(bool $reconnectAll): \Amp\Promise` +* `declineTos(): \Amp\Promise` +* `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Amp\Promise` +* `discardSecretChat(int $chat): \Amp\Promise` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Amp\Promise` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Amp\Promise` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Amp\Promise` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Amp\Promise Downloaded file path` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Amp\Promise Returned response` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Amp\Promise` +* `echo(string $string): \Amp\Promise` +* `end(array $what): mixed` +* `exportAuthorization(): \Amp\Promise` +* `extractBotAPIFile(array $info): ?array` +* `fileGetContents(string $url): \Amp\Promise` +* `first((\Promise|\Generator)[] $promises): \Amp\Promise` +* `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` +* `fromSupergroup(int $id): float|int` +* `fullChatLastUpdated(mixed $id): \Amp\Promise` +* `fullGetSelf(): \Amp\Promise` +* `genVectorHash(array $ints): \int Vector hash` +* `getAllMethods(): mixed` +* `getAuthorization(): mixed` +* `getCachedConfig(): mixed` +* `getCall(int $call): mixed` +* `getCdnConfig(string $datacenter): \Amp\Promise` +* `getConfig(array $config, array $options): \Amp\Promise` +* `getDNSClient(): mixed` +* `getDataCenterConnections(): mixed` +* `getDataCenterId(): int|string` +* `getDialogs(bool $force): \Amp\Promise` +* `getDownloadInfo(mixed $messageMedia): \Amp\Promise` +* `getEventHandler(): mixed` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getFileInfo(mixed $constructor): \Amp\Promise` +* `getFolderId(mixed $id): ?int` +* `getFullDialogs(bool $force): \Amp\Promise` +* `getFullInfo(mixed $id): \Amp\Promise FullInfo object` +* `getHTTPClient(): mixed` +* `getHint(): mixed` +* `getId(mixed $id): int` +* `getInfo(mixed $id, bool $recursive): \Amp\Promise Info object` +* `getLogger()` +* `getMethodNamespaces(): mixed` +* `getMethodsNamespaced(): mixed` +* `getMimeFromBuffer(string $buffer): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getMimeFromFile(string $file): string` +* `getPropicInfo(mixed $messageMedia): \Amp\Promise` +* `getPsrLogger()` +* `getPwrChat(mixed $id): \Amp\Promise Chat object` +* `getSecretChat(array|int $chat): mixed` +* `getSelf(): array|bool` +* `getSettings(): mixed` +* `getTL(): mixed` +* `getVar(object $obj, string $var): mixed` +* `getWebTemplate(): mixed` +* `hasAllAuth(): mixed` +* `hasEventHandler(): mixed` +* `hasReportPeers(): mixed` +* `hasSecretChat(array|int $chat): mixed` +* `hasVar(object $obj, string $var): bool` +* `importAuthorization(mixed $authorization): \Amp\Promise` +* `inflateStripped(string $stripped): \string JPG payload` +* `initSelfRestart(): mixed` +* `isAltervista(): bool` +* `isArrayOrAlike(mixed $var): bool` +* `isIpc(): mixed` +* `isSupergroup(int $id): bool` +* `logger(string $param, int $level, string $file): mixed` +* `logout(): \Amp\Promise` +* `loop(callable|null $callback): \Amp\Promise` +* `loopFork(): \Amp\Promise` +* `markdownEscape(string $hwat): string` +* `mbStrSplit(string $text, int $length): array` +* `mbStrlen(string $text): float|int` +* `mbSubstr(string $text, int $offset, ?int $length): string` +* `methodCall(string $method, array|\Generator $args, array $aargs): \Amp\Promise` +* `methodCallWrite(string $method, array|\Generator $args, array $aargs): \Amp\Promise` +* `methodEscape(string $method): string` +* `packDouble(float $value): string` +* `packSignedInt(int $value): string` +* `packSignedLong(int $value): string` +* `packUnsignedInt(int $value): string` +* `peerIsset(mixed $id): \Amp\Promise` +* `phoneLogin(string $number, int $sms_type): \Amp\Promise` +* `posmod(int $a, int $b): \int Modulo` +* `random(int $length): \string Random string` +* `randomInt(int $modulus): int` +* `readLine(string $prompt): \Amp\Promise` +* `rekey(int $chat): \Amp\Promise` +* `report(string $message, string $parseMode): \Amp\Promise` +* `requestCall(mixed $user): \Amp\Promise` +* `requestSecretChat(mixed $user): \Amp\Promise` +* `resetUpdateState(): mixed` +* `resolveUsername(string $username): \Amp\Promise` +* `restart(): void` +* `rethrow(\Throwable $e, string $file): void` +* `rleDecode(string $string): string` +* `rleEncode(string $string): string` +* `secretChatStatus(int $chat): mixed` +* `serializeAll(): void` +* `setCallback(callable $callback): mixed` +* `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Amp\Promise` +* `setNoop(): mixed` +* `setReportPeers(int|string $userOrId): \Amp\Promise` +* `setVar(object $obj, string $var, mixed $val): void` +* `setWebTemplate(string $template): mixed` +* `setWebhook(string $hook_url, string $pem_path): mixed` +* `setupLogger(): mixed` +* `sleep(int|float $time): \Amp\Promise` +* `some((\Promise|\Generator)[] $promises): \Amp\Promise` +* `start(): \Amp\Promise` +* `stop(): void` +* `tdToMTProto(array $params): \Amp\Promise` +* `tdToTdcli(mixed $params): mixed` +* `tdcliToTd(array $params, array $key): mixed` +* `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` +* `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `toSupergroup(int $id): float|int` +* `typeEscape(string $type): string` +* `unpackDouble(string $value): float` +* `unpackFileId(string $fileId): mixed` +* `unpackSignedInt(string $value): int` +* `unpackSignedLong(string $value): int` +* `unpackSignedLongString(string $value): string` +* `unsetEventHandler(bool $disableUpdateHandling): mixed` +* `update2fa(array $params): \Amp\Promise` +* `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Amp\Promise` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Amp\Promise` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Amp\Promise` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` +* `async(bool $async): void` +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` +* `getWebAPITemplate(): string` +* `setWebAPITemplate(): void` + +## Methods: +### `startAndLoop(string $eventHandler): void` + +Start MadelineProto and the event handler (enables async). +Also initializes error reporting, catching and reporting all errors surfacing from the event loop. + +Parameters: +* `$eventHandler`: `string` Event handler class name + + + +### `startAndLoopMulti(\danog\MadelineProto\API[] $instances, string[]|string $eventHandler): void` + +Start multiple instances of MadelineProto and the event handlers (enables async). + + +Parameters: +* `$instances`: `\danog\MadelineProto\API[]` Instances of madeline +* `$eventHandler`: `string[]|string` Event handler(s) + + + +### `startAndLoopAsync(string $eventHandler): \Generator` + +Start MadelineProto and the event handler (enables async). +Also initializes error reporting, catching and reporting all errors surfacing from the event loop. + +Parameters: +* `$eventHandler`: `string` Event handler class name + + +#### See also: +* `\Generator` + + + + +### `MTProtoToBotAPI(array $data): \Amp\Promise` + +Convert MTProto parameters to bot API parameters. + + +Parameters: +* `$data`: `array` Data + + +#### See also: +* `\Amp\Promise` + + + + +### `MTProtoToTd(mixed $params): \Amp\Promise` + +MTProto to TD params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `MTProtoToTdcli(mixed $params): \Amp\Promise` + +MTProto to TDCLI params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptCall(array $call): \Amp\Promise` + +Accept call. + + +Parameters: +* `$call`: `array` Call + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptSecretChat(array $params): \Amp\Promise` + +Accept secret chat. + + +Parameters: +* `$params`: `array` Secret chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptTos(): \Amp\Promise` + +Accept terms of service update. + + +#### See also: +* `\Amp\Promise` + + + + +### `addUser(array $user): \Amp\Promise` + +Add user info. + + +Parameters: +* `$user`: `array` User info + + +#### See also: +* `\Amp\Promise` + + + + +### `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` + +Call promise $b after promise $a. + + +Parameters: +* `$a`: `\Generator|\Promise` Promise A +* `$b`: `\Generator|\Promise` Promise B + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `all((\Generator|\Promise)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when all promises succeed, and fails if any promise fails. +Returned promise succeeds with an array of values used to succeed each contained promise, with keys corresponding to the array of promises. + +Parameters: +* `$promises`: `(\Generator|\Promise)[]` Promises + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `any((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that is resolved when all promises are resolved. The returned promise will not fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `arr(mixed $params): array` + +Create array. + + +Parameters: +* `$params`: `mixed` Params + + + +### `base64urlDecode(string $data): string` + +base64URL decode. + + +Parameters: +* `$data`: `string` Data to decode + + + +### `base64urlEncode(string $data): string` + +Base64URL encode. + + +Parameters: +* `$data`: `string` Data to encode + + + +### `botAPIToMTProto(array $arguments): \Amp\Promise` + +Convert bot API parameters to MTProto parameters. + + +Parameters: +* `$arguments`: `array` Arguments + + +#### See also: +* `\Amp\Promise` + + + + +### `botLogin(string $token): \Amp\Promise` + +Login as bot. + + +Parameters: +* `$token`: `string` Bot token + + +#### See also: +* `\Amp\Promise` + + + + +### `call(\Generator|\Promise|mixed $promise): \Amp\Promise` + +Convert generator, promise or any other value to a promise. + + +Parameters: +* `$promise`: `\Generator|\Promise|mixed` + Full type: + ``` + \Generator|\Promise<\TReturn>|\TReturn + ``` + + +Fully typed return value: +``` +\Promise<\TReturn> +``` +#### See also: +* `\Generator` +* `\Promise` +* `\TReturn` +* `\Amp\Promise` + + + + +### `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` + +Call promise in background. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve +* `$actual`: `?\Generator|\Promise` Promise to resolve instead of $promise +* `$file`: `string` File + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `callForkDefer(\Generator|\Promise $promise): void` + +Call promise in background, deferring execution. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `callStatus(int $id): mixed` + +Get call status. + + +Parameters: +* `$id`: `int` Call ID + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `checkTos(): \Amp\Promise` + +Check for terms of service update. + + +#### See also: +* `\Amp\Promise` + + + + +### `cleanup(): \Amp\Promise` + +Cleanup memory and session file. + + +#### See also: +* `\Amp\Promise` + + + + +### `closeConnection(string $message): void` + +Close connection with client, connected via web. + + +Parameters: +* `$message`: `string` Message + + + +### `complete2faLogin(string $password): \Amp\Promise` + +Complete 2FA login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Amp\Promise` + + + + +### `completeCall(array $params): \Amp\Promise` + +Complete call handshake. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `completePhoneLogin(string $code): \Amp\Promise` + +Complet user login using login code. + + +Parameters: +* `$code`: `string` Login code + + +#### See also: +* `\Amp\Promise` + + + + +### `completeSignup(string $first_name, string $last_name): \Amp\Promise` + +Complete signup to Telegram. + + +Parameters: +* `$first_name`: `string` First name +* `$last_name`: `string` Last name + + +#### See also: +* `\Amp\Promise` + + + + +### `confirmCall(array $params): \Amp\Promise` + +Confirm call. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `connectToAllDcs(bool $reconnectAll): \Amp\Promise` + +Connects to all datacenters and if necessary creates authorization keys, binds them and writes client info. + + +Parameters: +* `$reconnectAll`: `bool` Whether to reconnect to all DCs + + +#### See also: +* `\Amp\Promise` + + + + +### `declineTos(): \Amp\Promise` + +Decline terms of service update. +THIS WILL DELETE YOUR ACCOUNT! + +#### See also: +* `\Amp\Promise` + + + + +### `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Amp\Promise` + +Discard call. + + +Parameters: +* `$call`: `array` Call +* `$reason`: `array` +* `$rating`: `array` Rating +* `$need_debug`: `bool` Need debug? + + +#### See also: +* `\Amp\Promise` + + + + +### `discardSecretChat(int $chat): \Amp\Promise` + +Discard secret chat. + + +Parameters: +* `$chat`: `int` Secret chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Amp\Promise` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Amp\Promise` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Amp\Promise` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Amp\Promise` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Amp\Promise Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Amp\Promise Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Amp\Promise<\Amp\Http\Server\Response> +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Amp\Promise` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Amp\Promise` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `echo(string $string): \Amp\Promise` + +Asynchronously write to stdout/browser. + + +Parameters: +* `$string`: `string` Message to echo + + +#### See also: +* `\Amp\Promise` + + + + +### `end(array $what): mixed` + +Get final element of array. + + +Parameters: +* `$what`: `array` Array + + + +### `exportAuthorization(): \Amp\Promise` + +Export authorization. + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `extractBotAPIFile(array $info): ?array` + +Extract file info from bot API message. + + +Parameters: +* `$info`: `array` Bot API message object + + + +### `fileGetContents(string $url): \Amp\Promise` + +Get contents of remote file asynchronously. + + +Parameters: +* `$url`: `string` URL + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `first((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when the first promise succeeds, and fails only if all promises fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` + +Asynchronously lock a file +Resolves with a callbable that MUST eventually be called in order to release the lock. + + +Parameters: +* `$file`: `string` File to lock +* `$operation`: `int` Locking mode +* `$polling`: `float` Polling interval +* `$token`: `?\Promise` Cancellation token +* `$failureCb`: `?callable` Failure callback, called only once if the first locking attempt fails. + + +#### See also: +* `\Promise` +* `\Amp\Promise` + + + + +### `fromSupergroup(int $id): float|int` + +Convert bot API channel ID to MTProto channel ID. + + +Parameters: +* `$id`: `int` Bot API channel ID + + + +### `fullChatLastUpdated(mixed $id): \Amp\Promise` + +When were full info for this chat last cached. + + +Parameters: +* `$id`: `mixed` Chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `fullGetSelf(): \Amp\Promise` + +Get info about the logged-in user, not cached. + + +#### See also: +* `\Amp\Promise` + + + + +### `genVectorHash(array $ints): \int Vector hash` + +Generate MTProto vector hash. + + +Parameters: +* `$ints`: `array` IDs + + +Return value: Vector hash + + +### `getAllMethods(): mixed` + +Get full list of MTProto and API methods. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getAuthorization(): mixed` + +Get authorization info. + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCachedConfig(): mixed` + +Get cached server-side config. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCall(int $call): mixed` + +Get call info. + + +Parameters: +* `$call`: `int` Call ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCdnConfig(string $datacenter): \Amp\Promise` + +Store RSA keys for CDN datacenters. + + +Parameters: +* `$datacenter`: `string` DC ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getConfig(array $config, array $options): \Amp\Promise` + +Get cached (or eventually re-fetch) server-side config. + + +Parameters: +* `$config`: `array` Current config +* `$options`: `array` Options for method call + + +#### See also: +* `\Amp\Promise` + + + + +### `getDNSClient(): mixed` + +Get async DNS client. + + +Fully typed return value: +``` +\Amp\Dns\Resolver|\Amp\Promise<\Amp\Dns\Resolver> +``` +#### See also: +* `\Amp\Dns\Resolver` +* `\Amp\Promise` + + + + +### `getDataCenterConnections(): mixed` + +Get all datacenter connections. + + +Fully typed return value: +``` +array<\danog\MadelineProto\DataCenterConnection>|\Amp\Promise> +``` +#### See also: +* `\danog\MadelineProto\DataCenterConnection` +* `\Amp\Promise` + + + + +### `getDataCenterId(): int|string` + +Get main DC ID. + + + +### `getDialogs(bool $force): \Amp\Promise` + +Get dialog peers. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\Amp\Promise` + + + + +### `getDownloadInfo(mixed $messageMedia): \Amp\Promise` + +Get download info of file +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getEventHandler(): mixed` + +Get event handler. + + +Fully typed return value: +``` +\danog\MadelineProto\EventHandler|\Amp\Promise<\danog\MadelineProto\EventHandler> +``` +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Amp\Promise` + + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getFileInfo(mixed $constructor): \Amp\Promise` + +Get info about file. + + +Parameters: +* `$constructor`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getFolderId(mixed $id): ?int` + +Get folder ID from object. + + +Parameters: +* `$id`: `mixed` Object + + + +### `getFullDialogs(bool $force): \Amp\Promise` + +Get full info of all dialogs. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +#### See also: +* `\Amp\Promise` + + + + +### `getFullInfo(mixed $id): \Amp\Promise FullInfo object` + +Get full info about peer, returns an FullInfo object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: FullInfo object + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [https://docs.madelineproto.xyz/FullInfo.html](https://docs.madelineproto.xyz/FullInfo.html) +* `\Amp\Promise` + + + + +### `getHTTPClient(): mixed` + +Get async HTTP client. + + +Fully typed return value: +``` +\Amp\Http\Client\HttpClient|\Amp\Promise<\Amp\Http\Client\HttpClient> +``` +#### See also: +* `\Amp\Http\Client\HttpClient` +* `\Amp\Promise` + + + + +### `getHint(): mixed` + +Get current password hint. + + +Fully typed return value: +``` +string|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getId(mixed $id): int` + +Get bot API ID from peer object. + + +Parameters: +* `$id`: `mixed` Peer + + + +### `getInfo(mixed $id, bool $recursive): \Amp\Promise Info object` + +Get info about peer, returns an Info object. + + +Parameters: +* `$id`: `mixed` Peer +* `$recursive`: `bool` Internal + + +Return value: Info object + +Fully typed return value: +``` +\Generator|array, mixed, array{InputPeer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}, Peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}, DialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, NotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputDialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputNotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, bot_api_id: int|string, user_id?: int, chat_id?: int, channel_id?: int, InputUser?: array{_: string, user_id?: int, access_hash?: mixed, min?: bool}, InputChannel?: array{_: string, channel_id: int, access_hash: mixed, min: bool}, type: string}> +``` +#### See also: +* [https://docs.madelineproto.xyz/Info.html](https://docs.madelineproto.xyz/Info.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `getLogger()` + +Get logger. + + + +### `getMethodNamespaces(): mixed` + +Get TL namespaces. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMethodsNamespaced(): mixed` + +Get namespaced methods (method => namespace). + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getPropicInfo(mixed $messageMedia): \Amp\Promise` + +Get download info of the propic of a user +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getPsrLogger()` + +Get PSR logger. + + + +### `getPwrChat(mixed $id): \Amp\Promise Chat object` + +Get full info about peer (including full list of channel members), returns a Chat object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: Chat object + +#### See also: +* [https://docs.madelineproto.xyz/Chat.html](https://docs.madelineproto.xyz/Chat.html) + + + + +### `getSecretChat(array|int $chat): mixed` + +Get secret chat. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getSelf(): array|bool` + +Get info about the logged-in user, cached. + + + +### `getSettings(): mixed` + +Return current settings. + + +Fully typed return value: +``` +\danog\MadelineProto\Settings|\Amp\Promise<\danog\MadelineProto\Settings> +``` +#### See also: +* [`\danog\MadelineProto\Settings`: Settings class used for configuring MadelineProto.](./Settings.md) +* `\Amp\Promise` + + + + +### `getTL(): mixed` + +Get TL serializer. + + +Fully typed return value: +``` +\danog\MadelineProto\TL\TL|\Amp\Promise<\danog\MadelineProto\TL\TL> +``` +#### See also: +* `\danog\MadelineProto\TL\TL` +* `\Amp\Promise` + + + + +### `getVar(object $obj, string $var): mixed` + +Accesses a private variable from an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `getWebTemplate(): mixed` + +Get web template. + + +Fully typed return value: +``` +string|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasAllAuth(): mixed` + +Checks whether all datacenters are authorized. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasEventHandler(): mixed` + +Check if an event handler instance is present. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasReportPeers(): mixed` + +Check if has report peers. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasSecretChat(array|int $chat): mixed` + +Check whether secret chat exists. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasVar(object $obj, string $var): bool` + +Checks private property exists in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `importAuthorization(mixed $authorization): \Amp\Promise` + +Import authorization. + + +Parameters: +* `$authorization`: `mixed` Authorization info + + +#### See also: +* `\Amp\Promise` + + + + +### `inflateStripped(string $stripped): \string JPG payload` + +Inflate stripped photosize to full JPG payload. + + +Parameters: +* `$stripped`: `string` Stripped photosize + + +Return value: JPG payload + + +### `initSelfRestart(): mixed` + +Initialize self-restart hack. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `isAltervista(): bool` + +Whether this is altervista. + + + +### `isArrayOrAlike(mixed $var): bool` + +Check if is array or similar (traversable && countable && arrayAccess). + + +Parameters: +* `$var`: `mixed` Value to check + + + +### `isIpc(): mixed` + +Whether we're an IPC client instance. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `isSupergroup(int $id): bool` + +Check whether provided bot API ID is a channel. + + +Parameters: +* `$id`: `int` Bot API ID + + + +### `logger(string $param, int $level, string $file): mixed` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `logout(): \Amp\Promise` + +Log out currently logged in user. + + +#### See also: +* `\Amp\Promise` + + + + +### `loop(callable|null $callback): \Amp\Promise` + +Start MadelineProto's update handling loop, or run the provided async callable. + + +Parameters: +* `$callback`: `callable|null` Async callable to run + + +#### See also: +* `\Amp\Promise` + + + + +### `loopFork(): \Amp\Promise` + +Start MadelineProto's update handling loop in background. + + +#### See also: +* `\Amp\Promise` + + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `mbStrSplit(string $text, int $length): array` + +Telegram UTF-8 multibyte split. + + +Parameters: +* `$text`: `string` Text +* `$length`: `int` Length + + + +### `mbStrlen(string $text): float|int` + +Get Telegram UTF-8 length of string. + + +Parameters: +* `$text`: `string` Text + + + +### `mbSubstr(string $text, int $offset, ?int $length): string` + +Telegram UTF-8 multibyte substring. + + +Parameters: +* `$text`: `string` Text to substring +* `$offset`: `int` Offset +* `$length`: `?int` Length + + + +### `methodCall(string $method, array|\Generator $args, array $aargs): \Amp\Promise` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `methodCallWrite(string $method, array|\Generator $args, array $aargs): \Amp\Promise` + +Call method and make sure it is asynchronously sent. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `packDouble(float $value): string` + +Convert double to binary version. + + +Parameters: +* `$value`: `float` Value to convert + + + +### `packSignedInt(int $value): string` + +Convert integer to base256 signed int. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packSignedLong(int $value): string` + +Convert integer to base256 long. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packUnsignedInt(int $value): string` + +Convert value to unsigned base256 int. + + +Parameters: +* `$value`: `int` Value + + + +### `peerIsset(mixed $id): \Amp\Promise` + +Check if peer is present in internal peer database. + + +Parameters: +* `$id`: `mixed` Peer + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `phoneLogin(string $number, int $sms_type): \Amp\Promise` + +Login as user. + + +Parameters: +* `$number`: `string` Phone number +* `$sms_type`: `int` SMS type + + +#### See also: +* `\Amp\Promise` + + + + +### `posmod(int $a, int $b): \int Modulo` + +Positive modulo +Works just like the % (modulus) operator, only returns always a postive number. + + +Parameters: +* `$a`: `int` A +* `$b`: `int` B + + +Return value: Modulo + + +### `random(int $length): \string Random string` + +Get random string of specified length. + + +Parameters: +* `$length`: `int` Length + + +Return value: Random string + + +### `randomInt(int $modulus): int` + +Get random integer. + + +Parameters: +* `$modulus`: `int` Modulus + + + +### `readLine(string $prompt): \Amp\Promise` + +Asynchronously read line. + + +Parameters: +* `$prompt`: `string` Prompt + + +#### See also: +* `\Amp\Promise` + + + + +### `rekey(int $chat): \Amp\Promise` + +Rekey secret chat. + + +Parameters: +* `$chat`: `int` Secret chat to rekey + + +#### See also: +* `\Amp\Promise` + + + + +### `report(string $message, string $parseMode): \Amp\Promise` + +Report an error to the previously set peer. + + +Parameters: +* `$message`: `string` Error to report +* `$parseMode`: `string` Parse mode + + +#### See also: +* `\Amp\Promise` + + + + +### `requestCall(mixed $user): \Amp\Promise` + +Request VoIP call. + + +Parameters: +* `$user`: `mixed` User + + +#### See also: +* `\Amp\Promise` + + + + +### `requestSecretChat(mixed $user): \Amp\Promise` + +Request secret chat. + + +Parameters: +* `$user`: `mixed` User to start secret chat with + + +#### See also: +* `\Amp\Promise` + + + + +### `resetUpdateState(): mixed` + +Reset the update state and fetch all updates from the beginning. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `resolveUsername(string $username): \Amp\Promise` + +Resolve username (use getInfo instead). + + +Parameters: +* `$username`: `string` Username + + +#### See also: +* `\Amp\Promise` + + + + +### `restart(): void` + +Restart update loop. + + + +### `rethrow(\Throwable $e, string $file): void` + +Rethrow error catched in strand. + + +Parameters: +* `$e`: `\Throwable` Exception +* `$file`: `string` File where the strand started + + +#### See also: +* `\Throwable` + + + + +### `rleDecode(string $string): string` + +null-byte RLE decode. + + +Parameters: +* `$string`: `string` Data to decode + + + +### `rleEncode(string $string): string` + +null-byte RLE encode. + + +Parameters: +* `$string`: `string` Data to encode + + + +### `secretChatStatus(int $chat): mixed` + +Get secret chat status. + + +Parameters: +* `$chat`: `int` Chat ID + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `serializeAll(): void` + +Serialize all instances. +CALLED ONLY ON SHUTDOWN. + + +### `setCallback(callable $callback): mixed` + +Set update handling callback. + + +Parameters: +* `$callback`: `callable` Callback + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Amp\Promise` + +Set event handler. + + +Parameters: +* `$eventHandler`: `class-string<\danog\MadelineProto\EventHandler>` Event handler + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Amp\Promise` + + + + +### `setNoop(): mixed` + +Set NOOP update handler, ignoring all updates. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setReportPeers(int|string $userOrId): \Amp\Promise` + +Set peer(s) where to send errors occurred in the event loop. + + +Parameters: +* `$userOrId`: `int|string` Username(s) or peer ID(s) + + +#### See also: +* `\Amp\Promise` + + + + +### `setVar(object $obj, string $var, mixed $val): void` + +Sets a private variable in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name +* `$val`: `mixed` Attribute value + + + +### `setWebTemplate(string $template): mixed` + +Set web template. + + +Parameters: +* `$template`: `string` Template + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setWebhook(string $hook_url, string $pem_path): mixed` + +Set webhook update handler. + + +Parameters: +* `$hook_url`: `string` Webhook URL +* `$pem_path`: `string` PEM path for self-signed certificate + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setupLogger(): mixed` + +Setup logger. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `sleep(int|float $time): \Amp\Promise` + +Asynchronously sleep. + + +Parameters: +* `$time`: `int|float` Number of seconds to sleep for + + +#### See also: +* `\Amp\Promise` + + + + +### `some((\Promise|\Generator)[] $promises): \Amp\Promise` + +Resolves with a two-item array delineating successful and failed Promise results. +The returned promise will only fail if the given number of required promises fail. + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `start(): \Amp\Promise` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Amp\Promise` + + + + +### `stop(): void` + +Stop update loop. + + + +### `tdToMTProto(array $params): \Amp\Promise` + +Convert TD to MTProto parameters. + + +Parameters: +* `$params`: `array` Parameters + + +#### See also: +* `\Amp\Promise` + + + + +### `tdToTdcli(mixed $params): mixed` + +Convert TD parameters to tdcli. + + +Parameters: +* `$params`: `mixed` Parameters + + + +### `tdcliToTd(array $params, array $key): mixed` + +Convert tdcli parameters to tdcli. + + +Parameters: +* `$params`: `array` Params +* `$key`: `array` Key + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` + +Create an artificial timeout for any \Generator or Promise. + + +Parameters: +* `$promise`: `\Generator|\Promise` +* `$timeout`: `int` + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` + +Creates an artificial timeout for any `Promise`. +If the promise is resolved before the timeout expires, the result is returned + +If the timeout expires before the promise is resolved, a default value is returned + +Parameters: +* `$promise`: `\Promise|\Generator` Promise to which the timeout is applied. + Full type: + ``` + \Promise<\TReturn>|\TGenerator + ``` +* `$timeout`: `int` Timeout in milliseconds. +* `$default`: `mixed` + Full type: + ``` + \TReturnAlt + ``` + + +#### See also: +* `\Promise` +* `\Generator` +* `\TReturn` +* `\TGenerator` +* `\TReturnAlt` +* `\Amp\Promise` + + + + +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `toSupergroup(int $id): float|int` + +Convert MTProto channel ID to bot API channel ID. + + +Parameters: +* `$id`: `int` MTProto channel ID + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `unpackDouble(string $value): float` + +Unpack binary double. + + +Parameters: +* `$value`: `string` Value to unpack + + + +### `unpackFileId(string $fileId): mixed` + +Unpack bot API file ID. + + +Parameters: +* `$fileId`: `string` Bot API file ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `unpackSignedInt(string $value): int` + +Unpack base256 signed int. + + +Parameters: +* `$value`: `string` base256 int + + + +### `unpackSignedLong(string $value): int` + +Unpack base256 signed long. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unpackSignedLongString(string $value): string` + +Unpack base256 signed long to string. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unsetEventHandler(bool $disableUpdateHandling): mixed` + +Unset event handler. + + +Parameters: +* `$disableUpdateHandling`: `bool` Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler) + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `update2fa(array $params): \Amp\Promise` + +Update the 2FA password. +The params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` The params + + +#### See also: +* `\Amp\Promise` + + + + +### `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Amp\Promise` + +Parse, update and store settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` +* `\Amp\Promise` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Amp\Promise` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Amp\Promise` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Amp\Promise` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` + +Synchronously wait for a promise|generator. + + +Parameters: +* `$promise`: `\Generator|\Promise` The promise to wait for +* `$ignoreSignal`: `bool` Whether to ignore shutdown signals + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `async(bool $async): void` + +Enable or disable async. + + +Parameters: +* `$async`: `bool` Whether to enable or disable async + + + +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + +### `getWebAPITemplate(): string` + +Get web API login HTML template string. + + + +### `setWebAPITemplate(): void` + +Set web API login HTML template string. + + + diff --git a/docs/PHP/danog/MadelineProto/ApiWrappers/Start.md b/docs/PHP/danog/MadelineProto/ApiWrappers/Start.md new file mode 100644 index 00000000..a9799798 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/ApiWrappers/Start.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\ApiWrappers\Start: Manages simple logging in and out. +description: + +--- +# `danog\MadelineProto\ApiWrappers\Start` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages simple logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Async/AsyncConstruct.md b/docs/PHP/danog/MadelineProto/Async/AsyncConstruct.md new file mode 100644 index 00000000..f0693c35 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Async/AsyncConstruct.md @@ -0,0 +1,58 @@ +--- +title: danog\MadelineProto\Async\AsyncConstruct: Async constructor class. +description: Manages asynchronous construction and wakeup of classes + +--- +# `danog\MadelineProto\Async\AsyncConstruct` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Async constructor class. + +Manages asynchronous construction and wakeup of classes + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` + +## Methods: +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + diff --git a/docs/PHP/danog/MadelineProto/Connection.md b/docs/PHP/danog/MadelineProto/Connection.md new file mode 100644 index 00000000..250cd83b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Connection.md @@ -0,0 +1,481 @@ +--- +title: danog\MadelineProto\Connection: Connection class. +description: Manages connection to Telegram datacenters + +--- +# `danog\MadelineProto\Connection` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Connection class. + +Manages connection to Telegram datacenters + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `needReconnect(bool $needsReconnect): void` +* `shouldReconnect(): bool` +* `writing(bool $writing): void` +* `reading(bool $reading): void` +* `haveRead(): void` +* `getLastChunk(): float` +* `httpReceived(): void` +* `countHttpReceived(): int` +* `httpSent(): void` +* `countHttpSent(): int` +* `getID(): int` +* `getDatacenterID(): string` +* `getCtx(): \danog\MadelineProto\Stream\ConnectionContext` +* `isHttp(): bool` +* `isMedia(): bool` +* `isCDN(): bool` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `sendMessage(array $message, bool $flush): \Generator` +* `flush(): void` +* `pingHttpWaiter(): void` +* `setExtra(\danog\MadelineProto\DataCenterConnection $extra, int $id): void` +* `getExtra(): \danog\MadelineProto\MTProto` +* `getShared(): \danog\MadelineProto\DataCenterConnection` +* `disconnect(bool $temporary): void` +* `reconnect(): \Generator` +* `getName(): string` +* `resetSession(): void` +* `createSession(): void` +* `backupSession(): array` +* `ackOutgoingMessageId(string|int $message_id): bool` +* `gotResponseForOutgoingMessageId(string|int $message_id): bool` +* `ackIncomingMessageId(string|int $message_id): bool` +* `hasPendingCalls(): bool` +* `getPendingCalls(): array` +* `handleReject(array $request, \Throwable $data): void` +* `handleResponse(): void` +* `methodRecall(string $watcherId, array $args): void` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` +* `objectCall(string $object, array $args, array $aargs): \Generator` +* `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +## Methods: +### `needReconnect(bool $needsReconnect): void` + +Indicate if this socket needs to be reconnected. + + +Parameters: +* `$needsReconnect`: `bool` Whether the socket has to be reconnected + + + +### `shouldReconnect(): bool` + +Whether this sockets needs to be reconnected. + + + +### `writing(bool $writing): void` + +Set writing boolean. + + +Parameters: +* `$writing`: `bool` + + + +### `reading(bool $reading): void` + +Set reading boolean. + + +Parameters: +* `$reading`: `bool` + + + +### `haveRead(): void` + +Tell the class that we have read a chunk of data from the socket. + + + +### `getLastChunk(): float` + +Get the receive date of the latest chunk of data from the socket. + + + +### `httpReceived(): void` + +Indicate a received HTTP response. + + + +### `countHttpReceived(): int` + +Count received HTTP responses. + + + +### `httpSent(): void` + +Indicate a sent HTTP request. + + + +### `countHttpSent(): int` + +Count sent HTTP requests. + + + +### `getID(): int` + +Get connection ID. + + + +### `getDatacenterID(): string` + +Get datacenter concatenated with connection ID. + + + +### `getCtx(): \danog\MadelineProto\Stream\ConnectionContext` + +Get connection context. + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./Stream/ConnectionContext.md) + + + + +### `isHttp(): bool` + +Check if is an HTTP connection. + + + +### `isMedia(): bool` + +Check if is a media connection. + + + +### `isCDN(): bool` + +Check if is a CDN connection. + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connects to a telegram DC using the specified protocol, proxy and connection parameters. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./Stream/ConnectionContext.md) +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](./Stream/StreamInterface.md) +* `\Generator` + + + + +### `sendMessage(array $message, bool $flush): \Generator` + +Send an MTProto message. +Structure of message array: +[ + // only in outgoing messages + 'body' => deserialized body, (optional if container) + 'serialized_body' => 'serialized body', (optional if container) + 'contentRelated' => bool, + '_' => 'predicate', + 'promise' => deferred promise that gets resolved when a response to the message is received (optional), + 'send_promise' => deferred promise that gets resolved when the message is sent (optional), + 'file' => bool (optional), + 'type' => 'type' (optional), + 'queue' => queue ID (optional), + 'container' => [message ids] (optional), + + // only in incoming messages + 'content' => deserialized body, + 'seq_no' => number (optional), + 'from_container' => bool (optional), + + // can be present in both + 'response' => message id (optional), + 'msg_id' => message id (optional), + 'sent' => timestamp, + 'tries' => number +] + +Parameters: +* `$message`: `array` The message to send +* `$flush`: `bool` Whether to flush the message right away + + +#### See also: +* `\Generator` + + + + +### `flush(): void` + +Flush pending packets. + + + +### `pingHttpWaiter(): void` + +Resume HttpWaiter. + + + +### `setExtra(\danog\MadelineProto\DataCenterConnection $extra, int $id): void` + +Connect main instance. + + +Parameters: +* `$extra`: `\danog\MadelineProto\DataCenterConnection` Shared instance +* `$id`: `int` Connection ID + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `getExtra(): \danog\MadelineProto\MTProto` + +Get main instance. + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `getShared(): \danog\MadelineProto\DataCenterConnection` + +Get shared connection instance. + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `disconnect(bool $temporary): void` + +Disconnect from DC. + + +Parameters: +* `$temporary`: `bool` Whether the disconnection is temporary, triggered by the reconnect method + + + +### `reconnect(): \Generator` + +Reconnect to DC. + + +#### See also: +* `\Generator` + + + + +### `getName(): string` + +Get name. + + + +### `resetSession(): void` + +Reset MTProto session. + + + +### `createSession(): void` + +Create MTProto session if needed. + + + +### `backupSession(): array` + +Backup eventual unsent messages before session deletion. + + + +### `ackOutgoingMessageId(string|int $message_id): bool` + +Acknowledge outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message Id + + + +### `gotResponseForOutgoingMessageId(string|int $message_id): bool` + +We have gotten response for outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `ackIncomingMessageId(string|int $message_id): bool` + +Acknowledge incoming message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `hasPendingCalls(): bool` + +Check if there are some pending calls. + + + +### `getPendingCalls(): array` + +Get all pending calls (also clear pending state requests). + + + +### `handleReject(array $request, \Throwable $data): void` + +Reject request with exception. + + +Parameters: +* `$request`: `array` Request +* `$data`: `\Throwable` Exception + + +#### See also: +* `\Throwable` + + + + +### `handleResponse(): void` + + + + + +### `methodRecall(string $watcherId, array $args): void` + +Recall method. + + +Parameters: +* `$watcherId`: `string` Watcher ID for defer +* `$args`: `array` Args + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent (generator). + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `objectCall(string $object, array $args, array $aargs): \Generator` + +Send object and make sure it is asynchronously sent (generator). + + +Parameters: +* `$object`: `string` Object name +* `$args`: `array` Arguments +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +Send state info for message IDs. + + +Parameters: +* `$req_msg_id`: `string|int` Message ID of msgs_state_req that initiated this +* `$msg_ids`: `array` Message IDs to send info about + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/Coroutine.md b/docs/PHP/danog/MadelineProto/Coroutine.md new file mode 100644 index 00000000..4c5560f9 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Coroutine.md @@ -0,0 +1,85 @@ +--- +title: danog\MadelineProto\Coroutine: Creates a promise from a generator function yielding promises. +description: When a promise is yielded, execution of the generator is interrupted until the promise is resolved. A success +value is sent into the generator, while a failure reason is thrown into the generator. Using a coroutine, +asynchronous code can be written without callbacks and be structured like synchronous code. + +--- +# `danog\MadelineProto\Coroutine` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Creates a promise from a generator function yielding promises. + +When a promise is yielded, execution of the generator is interrupted until the promise is resolved. A success +value is sent into the generator, while a failure reason is thrown into the generator. Using a coroutine, +asynchronous code can be written without callbacks and be structured like synchronous code. + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `fail(\Throwable $reason): void` +* `offsetGet(mixed $offset): \Amp\Promise` +* `getTrace(): array` +* `getFrame(): array` +* `jsonSerialize(): string` +* `onResolve()` + +## Methods: +### `fail(\Throwable $reason): void` + + + + +Parameters: +* `$reason`: `\Throwable` Failure reason. + + +#### See also: +* `\Throwable` + + + + +### `offsetGet(mixed $offset): \Amp\Promise` + +Get data at an array offset asynchronously. + + +Parameters: +* `$offset`: `mixed` Offset + + +#### See also: +* `\Amp\Promise` + + + + +### `getTrace(): array` + +Get current stack trace for running coroutine. + + + +### `getFrame(): array` + +Get current execution frame. + + + +### `jsonSerialize(): string` + +Obtain. + + + +### `onResolve()` + + + + + diff --git a/docs/PHP/danog/MadelineProto/DataCenter.md b/docs/PHP/danog/MadelineProto/DataCenter.md new file mode 100644 index 00000000..0d240a63 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/DataCenter.md @@ -0,0 +1,285 @@ +--- +title: danog\MadelineProto\DataCenter: Manages datacenters. +description: + +--- +# `danog\MadelineProto\DataCenter` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Manages datacenters. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setDataCenterConnections(array $saved): void` +* `setVoIPEndpoints(array $endpoints): void` +* `dcConnect(string $dc_number, int $id): \Generator` +* `generateContexts(int $dc_number, string $uri, \Amp\Socket\ConnectContext $context): array` +* `getAPI(): \danog\MadelineProto\MTProto` +* `getHTTPClient(): \Amp\Http\Client\HttpClient` +* `getCookieJar(): \Amp\Http\Client\Cookie\CookieJar` +* `getDNSClient(): \Amp\Dns\Resolver` +* `getNonProxiedDNSClient(): \Amp\Dns\Resolver` +* `fileGetContents(string $url): \Generator` +* `getAuthConnection(string $dc): \danog\MadelineProto\Connection` +* `getConnection(string $dc): \danog\MadelineProto\Connection` +* `waitGetConnection(string $dc): \Generator` +* `getDataCenterConnection(string $dc): \danog\MadelineProto\DataCenterConnection` +* `getDataCenterConnections(): array` +* `has(string $dc): bool` +* `isHttp(string $datacenter): bool` +* `byIPAddress(string $datacenter): bool` +* `getDcs(bool $all): array` + +## Methods: +### `setDataCenterConnections(array $saved): void` + +Set auth key information from saved auth array. + + +Parameters: +* `$saved`: `array` Saved auth array + + + +### `setVoIPEndpoints(array $endpoints): void` + +Set VoIP endpoints. + + +Parameters: +* `$endpoints`: `array` Endpoints + + + +### `dcConnect(string $dc_number, int $id): \Generator` + +Connect to specified DC. + + +Parameters: +* `$dc_number`: `string` DC to connect to +* `$id`: `int` Connection ID to re-establish (optional) + + +#### See also: +* `\Generator` + + + + +### `generateContexts(int $dc_number, string $uri, \Amp\Socket\ConnectContext $context): array` + +Generate contexts. + + +Parameters: +* `$dc_number`: `int` DC ID to generate contexts for +* `$uri`: `string` URI +* `$context`: `\Amp\Socket\ConnectContext` Connection context + + +#### See also: +* `\Amp\Socket\ConnectContext` + + + + +### `getAPI(): \danog\MadelineProto\MTProto` + +Get main API. + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `getHTTPClient(): \Amp\Http\Client\HttpClient` + +Get async HTTP client. + + +#### See also: +* `\Amp\Http\Client\HttpClient` + + + + +### `getCookieJar(): \Amp\Http\Client\Cookie\CookieJar` + +Get async HTTP client cookies. + + +#### See also: +* `\Amp\Http\Client\Cookie\CookieJar` + + + + +### `getDNSClient(): \Amp\Dns\Resolver` + +Get DNS over HTTPS async DNS client. + + +#### See also: +* `\Amp\Dns\Resolver` + + + + +### `getNonProxiedDNSClient(): \Amp\Dns\Resolver` + +Get non-proxied DNS over HTTPS async DNS client. + + +#### See also: +* `\Amp\Dns\Resolver` + + + + +### `fileGetContents(string $url): \Generator` + +Get contents of file. + + +Parameters: +* `$url`: `string` URL to fetch + + +Fully typed return value: +``` +\Generator, mixed, string> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getAuthConnection(string $dc): \danog\MadelineProto\Connection` + +Get Connection instance for authorization. + + +Parameters: +* `$dc`: `string` DC ID + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) + + + + +### `getConnection(string $dc): \danog\MadelineProto\Connection` + +Get Connection instance. + + +Parameters: +* `$dc`: `string` DC ID + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) + + + + +### `waitGetConnection(string $dc): \Generator` + +Get Connection instance asynchronously. + + +Parameters: +* `$dc`: `string` DC ID + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) +* `\Generator` + + + + +### `getDataCenterConnection(string $dc): \danog\MadelineProto\DataCenterConnection` + +Get DataCenterConnection instance. + + +Parameters: +* `$dc`: `string` DC ID + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `getDataCenterConnections(): array` + +Get all DataCenterConnection instances. + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `has(string $dc): bool` + +Check if a DC is present. + + +Parameters: +* `$dc`: `string` DC ID + + + +### `isHttp(string $datacenter): bool` + +Check if connected to datacenter using HTTP. + + +Parameters: +* `$datacenter`: `string` DC ID + + + +### `byIPAddress(string $datacenter): bool` + +Check if connected to datacenter directly using IP address. + + +Parameters: +* `$datacenter`: `string` DC ID + + + +### `getDcs(bool $all): array` + +Get all DC IDs. + + +Parameters: +* `$all`: `bool` Whether to get all possible DC IDs, or only connected ones + + + diff --git a/docs/PHP/danog/MadelineProto/DataCenterConnection.md b/docs/PHP/danog/MadelineProto/DataCenterConnection.md new file mode 100644 index 00000000..2d14dd11 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/DataCenterConnection.md @@ -0,0 +1,478 @@ +--- +title: danog\MadelineProto\DataCenterConnection: Datacenter connection. +description: + +--- +# `danog\MadelineProto\DataCenterConnection` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Datacenter connection. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\DataCenterConnection::READ_WEIGHT: + +* danog\MadelineProto\DataCenterConnection::READ_WEIGHT_MEDIA: + +* danog\MadelineProto\DataCenterConnection::WRITE_WEIGHT: + + +## Method list: +* `needReconnect(bool $needsReconnect): void` +* `shouldReconnect(): bool` +* `getAuthKey(bool $temp): \danog\MadelineProto\MTProto\AuthKey` +* `hasAuthKey(bool $temp): bool` +* `setAuthKey(\danog\MadelineProto\MTProto\AuthKey|null $key, bool $temp): void` +* `getTempAuthKey(): \danog\MadelineProto\MTProto\TempAuthKey` +* `getPermAuthKey(): \danog\MadelineProto\MTProto\PermAuthKey` +* `hasTempAuthKey(): bool` +* `hasPermAuthKey(): bool` +* `setTempAuthKey(\danog\MadelineProto\MTProto\TempAuthKey|null $key): void` +* `setPermAuthKey(\danog\MadelineProto\MTProto\PermAuthKey|null $key): void` +* `bind(bool $pfs): void` +* `isBound(): bool` +* `isAuthorized(): bool` +* `authorized(bool $authorized): void` +* `link(string $dc): void` +* `resetSession(): void` +* `createSession(): void` +* `flush(): void` +* `getCtx(): \danog\MadelineProto\Stream\ConnectionContext` +* `hasCtx(): bool` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx, int $id): \Generator` +* `signalDisconnect(int $id): void` +* `disconnect(): void` +* `reconnect(): \Generator` +* `restoreBackup(): void` +* `getAuthConnection(): \danog\MadelineProto\Connection` +* `hasConnection(int $id): bool|int` +* `waitGetConnection(): \Generator` +* `getConnection(int $id): \danog\MadelineProto\Connection` +* `even(): void` +* `reading(bool $reading, int $x): void` +* `writing(bool $writing, int $x): void` +* `setExtra(\danog\MadelineProto\MTProto $API): void` +* `getExtra(): \danog\MadelineProto\MTProto` +* `isHttp(): bool` +* `byIPAddress(): bool` +* `isMedia(): bool` +* `isCDN(): bool` +* `getSettings(): \danog\MadelineProto\Settings\Connection` +* `getGenericSettings(): \danog\MadelineProto\Settings` +* `jsonSerialize(): array` + +## Methods: +### `needReconnect(bool $needsReconnect): void` + +Indicate if this socket needs to be reconnected. + + +Parameters: +* `$needsReconnect`: `bool` Whether the socket has to be reconnected + + + +### `shouldReconnect(): bool` + +Whether this sockets needs to be reconnected. + + + +### `getAuthKey(bool $temp): \danog\MadelineProto\MTProto\AuthKey` + +Get auth key. + + +Parameters: +* `$temp`: `bool` Whether to fetch the temporary auth key + + +#### See also: +* [`\danog\MadelineProto\MTProto\AuthKey`: MTProto auth key.](./MTProto/AuthKey.md) + + + + +### `hasAuthKey(bool $temp): bool` + +Check if auth key is present. + + +Parameters: +* `$temp`: `bool` + + + +### `setAuthKey(\danog\MadelineProto\MTProto\AuthKey|null $key, bool $temp): void` + +Set auth key. + + +Parameters: +* `$key`: `\danog\MadelineProto\MTProto\AuthKey|null` The auth key +* `$temp`: `bool` + + +#### See also: +* [`\danog\MadelineProto\MTProto\AuthKey`: MTProto auth key.](./MTProto/AuthKey.md) + + + + +### `getTempAuthKey(): \danog\MadelineProto\MTProto\TempAuthKey` + +Get temporary authorization key. + + +#### See also: +* [`\danog\MadelineProto\MTProto\TempAuthKey`: MTProto temporary auth key.](./MTProto/TempAuthKey.md) + + + + +### `getPermAuthKey(): \danog\MadelineProto\MTProto\PermAuthKey` + +Get permanent authorization key. + + +#### See also: +* [`\danog\MadelineProto\MTProto\PermAuthKey`: MTProto permanent auth key.](./MTProto/PermAuthKey.md) + + + + +### `hasTempAuthKey(): bool` + +Check if has temporary authorization key. + + + +### `hasPermAuthKey(): bool` + +Check if has permanent authorization key. + + + +### `setTempAuthKey(\danog\MadelineProto\MTProto\TempAuthKey|null $key): void` + +Set temporary authorization key. + + +Parameters: +* `$key`: `\danog\MadelineProto\MTProto\TempAuthKey|null` Auth key + + +#### See also: +* [`\danog\MadelineProto\MTProto\TempAuthKey`: MTProto temporary auth key.](./MTProto/TempAuthKey.md) + + + + +### `setPermAuthKey(\danog\MadelineProto\MTProto\PermAuthKey|null $key): void` + +Set permanent authorization key. + + +Parameters: +* `$key`: `\danog\MadelineProto\MTProto\PermAuthKey|null` Auth key + + +#### See also: +* [`\danog\MadelineProto\MTProto\PermAuthKey`: MTProto permanent auth key.](./MTProto/PermAuthKey.md) + + + + +### `bind(bool $pfs): void` + +Bind temporary and permanent auth keys. + + +Parameters: +* `$pfs`: `bool` Whether to bind using PFS + + + +### `isBound(): bool` + +Check if auth keys are bound. + + + +### `isAuthorized(): bool` + +Check if we are logged in. + + + +### `authorized(bool $authorized): void` + +Set the authorized boolean. + + +Parameters: +* `$authorized`: `bool` Whether we are authorized + + + +### `link(string $dc): void` + +Link permanent authorization info of main DC to media DC. + + +Parameters: +* `$dc`: `string` Main DC ID + + + +### `resetSession(): void` + +Reset MTProto sessions. + + + +### `createSession(): void` + +Create MTProto sessions if needed. + + + +### `flush(): void` + +Flush all pending packets. + + + +### `getCtx(): \danog\MadelineProto\Stream\ConnectionContext` + +Get connection context. + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./Stream/ConnectionContext.md) + + + + +### `hasCtx(): bool` + +Has connection context? + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx, int $id): \Generator` + +Connect function. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context +* `$id`: `int` Optional connection ID to reconnect + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./Stream/ConnectionContext.md) +* `\Generator` + + + + +### `signalDisconnect(int $id): void` + +Signal that a connection ID disconnected. + + +Parameters: +* `$id`: `int` Connection ID + + + +### `disconnect(): void` + +Close all connections to DC. + + + +### `reconnect(): \Generator` + +Reconnect to DC. + + +#### See also: +* `\Generator` + + + + +### `restoreBackup(): void` + +Restore backed up messages. + + + +### `getAuthConnection(): \danog\MadelineProto\Connection` + +Get connection for authorization. + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) + + + + +### `hasConnection(int $id): bool|int` + +Check if any connection is available. + + +Parameters: +* `$id`: `int` Connection ID + + + +### `waitGetConnection(): \Generator` + +Get best socket in round robin, asynchronously. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) +* `\Generator` + + + + +### `getConnection(int $id): \danog\MadelineProto\Connection` + +Get best socket in round robin. + + +Parameters: +* `$id`: `int` Connection ID, for manual fetching + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) + + + + +### `even(): void` + +Even out round robin values. + + + +### `reading(bool $reading, int $x): void` + +Indicate that one of the sockets is busy reading. + + +Parameters: +* `$reading`: `bool` Whether we're busy reading +* `$x`: `int` Connection ID + + + +### `writing(bool $writing, int $x): void` + +Indicate that one of the sockets is busy writing. + + +Parameters: +* `$writing`: `bool` Whether we're busy writing +* `$x`: `int` Connection ID + + + +### `setExtra(\danog\MadelineProto\MTProto $API): void` + +Set main instance. + + +Parameters: +* `$API`: `\danog\MadelineProto\MTProto` Main instance + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `getExtra(): \danog\MadelineProto\MTProto` + +Get main instance. + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `isHttp(): bool` + +Check if is an HTTP connection. + + + +### `byIPAddress(): bool` + +Check if is connected directly by IP address. + + + +### `isMedia(): bool` + +Check if is a media connection. + + + +### `isCDN(): bool` + +Check if is a CDN connection. + + + +### `getSettings(): \danog\MadelineProto\Settings\Connection` + +Get DC-specific settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Connection`: Connection settings.](./Settings/Connection.md) + + + + +### `getGenericSettings(): \danog\MadelineProto\Settings` + +Get global settings. + + +#### See also: +* [`\danog\MadelineProto\Settings`: Settings class used for configuring MadelineProto.](./Settings.md) + + + + +### `jsonSerialize(): array` + +JSON serialize function. + + + diff --git a/docs/PHP/danog/MadelineProto/Db/ArrayCacheTrait.md b/docs/PHP/danog/MadelineProto/Db/ArrayCacheTrait.md new file mode 100644 index 00000000..03bcbeb7 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/ArrayCacheTrait.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Db\ArrayCacheTrait: Array caching trait. +description: + +--- +# `danog\MadelineProto\Db\ArrayCacheTrait` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Array caching trait. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Db/DbArray.md b/docs/PHP/danog/MadelineProto/Db/DbArray.md new file mode 100644 index 00000000..0383aa6f --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/DbArray.md @@ -0,0 +1,154 @@ +--- +title: danog\MadelineProto\Db\DbArray: DB array interface. +description: + +--- +# `danog\MadelineProto\Db\DbArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +DB array interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getArrayCopy(): \Amp\Promise` +* `isset(string|int $key): \Amp\Promise` +* `offsetGet(string|int $index): \Amp\Promise` +* `offsetSet(string|int $index, mixed $value): void` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Amp\Promise` +* `getIterator()` +* `getInstance(string $table, null|\danog\MadelineProto\Db\DbType|array $value, \danog\MadelineProto\Settings\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `getArrayCopy(): \Amp\Promise` + +Get Array copy. + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `isset(string|int $key): \Amp\Promise` + +Check if element is set. + + +Parameters: +* `$key`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `offsetGet(string|int $index): \Amp\Promise` + +Get element. + + +Parameters: +* `$index`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise<\T> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `offsetSet(string|int $index, mixed $value): void` + +Set element. + + +Parameters: +* `$index`: `string|int` +* `$value`: `mixed` + Full type: + ``` + \T + ``` + + +#### See also: +* `\T` + + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset element. + + +Parameters: +* `$index`: `string|int` Offset + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Amp\Promise` + +Count number of elements. + + +#### See also: +* `\Amp\Promise` + + + + +### `getIterator()` + +Get iterator. + + + +### `getInstance(string $table, null|\danog\MadelineProto\Db\DbType|array $value, \danog\MadelineProto\Settings\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `null|\danog\MadelineProto\Db\DbType|array` +* `$settings`: `\danog\MadelineProto\Settings\DatabaseAbstract` + + +#### See also: +* [`\danog\MadelineProto\Settings\DatabaseAbstract`: Base class for storage backends.](../Settings/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/DbPropertiesFactory.md b/docs/PHP/danog/MadelineProto/Db/DbPropertiesFactory.md new file mode 100644 index 00000000..d41e54cd --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/DbPropertiesFactory.md @@ -0,0 +1,23 @@ +--- +title: danog\MadelineProto\Db\DbPropertiesFactory: This factory class initializes the correct database backend for MadelineProto. +description: + +--- +# `danog\MadelineProto\Db\DbPropertiesFactory` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +This factory class initializes the correct database backend for MadelineProto. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Db\DbPropertiesFactory::TYPE_ARRAY`: Indicates a simple K-V array stored in a database backend. + + Values can be objects or other arrays, but when lots of nesting is required, it's best to split the array into multiple arrays. + diff --git a/docs/PHP/danog/MadelineProto/Db/DbPropertiesTrait.md b/docs/PHP/danog/MadelineProto/Db/DbPropertiesTrait.md new file mode 100644 index 00000000..6acb1655 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/DbPropertiesTrait.md @@ -0,0 +1,24 @@ +--- +title: danog\MadelineProto\Db\DbPropertiesTrait: Include this trait and call DbPropertiesTrait::initDb to use MadelineProto's database backend for properties. +description: You will have to define a `$dbProperties` static array property, with a list of properties you want to store to a database. + +--- +# `danog\MadelineProto\Db\DbPropertiesTrait` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Include this trait and call DbPropertiesTrait::initDb to use MadelineProto's database backend for properties. + +You will have to define a `$dbProperties` static array property, with a list of properties you want to store to a database. + +#### See also: +* [For a list of allowed property types](./DbPropertiesFactory.md) + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). ## Properties +* `$dbProperties`: `array` \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Db/Driver/Mysql.md b/docs/PHP/danog/MadelineProto/Db/Driver/Mysql.md new file mode 100644 index 00000000..d9b69a86 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/Driver/Mysql.md @@ -0,0 +1,44 @@ +--- +title: danog\MadelineProto\Db\Driver\Mysql: MySQL driver wrapper. +description: + +--- +# `danog\MadelineProto\Db\Driver\Mysql` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +MySQL driver wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator<\Amp\Mysql\Pool>` + +## Methods: +### `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator<\Amp\Mysql\Pool>` + + + + +Parameters: +* `$host`: `string` +* `$port`: `int` +* `$user`: `string` +* `$password`: `string` +* `$db`: `string` +* `$maxConnections`: `int` +* `$idleTimeout`: `int` + + +#### See also: +* `\Amp\Mysql\Pool` +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/Driver/Postgres.md b/docs/PHP/danog/MadelineProto/Db/Driver/Postgres.md new file mode 100644 index 00000000..3bc5b957 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/Driver/Postgres.md @@ -0,0 +1,44 @@ +--- +title: danog\MadelineProto\Db\Driver\Postgres: Postgres driver wrapper. +description: + +--- +# `danog\MadelineProto\Db\Driver\Postgres` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Postgres driver wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator<\Amp\Postgres\Pool>` + +## Methods: +### `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator<\Amp\Postgres\Pool>` + + + + +Parameters: +* `$host`: `string` +* `$port`: `int` +* `$user`: `string` +* `$password`: `string` +* `$db`: `string` +* `$maxConnections`: `int` +* `$idleTimeout`: `int` + + +#### See also: +* `\Amp\Postgres\Pool` +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/Driver/Redis.md b/docs/PHP/danog/MadelineProto/Db/Driver/Redis.md new file mode 100644 index 00000000..e504c0d2 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/Driver/Redis.md @@ -0,0 +1,49 @@ +--- +title: danog\MadelineProto\Db\Driver\Redis: Redis driver wrapper. +description: + +--- +# `danog\MadelineProto\Db\Driver\Redis` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Redis driver wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator` + +## Methods: +### `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator` + + + + +Parameters: +* `$host`: `string` +* `$port`: `int` +* `$user`: `string` +* `$password`: `string` +* `$db`: `string` +* `$maxConnections`: `int` +* `$idleTimeout`: `int` + + +Fully typed return value: +``` +\Generator, mixed, \Amp\Redis\Redis> +``` +#### See also: +* `\Amp\Promise` +* `\Amp\Redis\Redis` +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/DriverArray.md b/docs/PHP/danog/MadelineProto/Db/DriverArray.md new file mode 100644 index 00000000..0b77f424 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/DriverArray.md @@ -0,0 +1,154 @@ +--- +title: danog\MadelineProto\Db\DriverArray: Array caching trait. +description: + +--- +# `danog\MadelineProto\Db\DriverArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Array caching trait. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getArrayCopy(): \Amp\Promise` +* `isset(string|int $key): \Amp\Promise` +* `offsetGet(string|int $index): \Amp\Promise` +* `offsetSet(string|int $index, mixed $value): void` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Amp\Promise` +* `getIterator()` +* `getInstance(string $table, null|\danog\MadelineProto\Db\DbType|array $value, \danog\MadelineProto\Settings\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `getArrayCopy(): \Amp\Promise` + +Get Array copy. + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `isset(string|int $key): \Amp\Promise` + +Check if element is set. + + +Parameters: +* `$key`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `offsetGet(string|int $index): \Amp\Promise` + +Get element. + + +Parameters: +* `$index`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise<\T> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `offsetSet(string|int $index, mixed $value): void` + +Set element. + + +Parameters: +* `$index`: `string|int` +* `$value`: `mixed` + Full type: + ``` + \T + ``` + + +#### See also: +* `\T` + + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset element. + + +Parameters: +* `$index`: `string|int` Offset + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Amp\Promise` + +Count number of elements. + + +#### See also: +* `\Amp\Promise` + + + + +### `getIterator()` + +Get iterator. + + + +### `getInstance(string $table, null|\danog\MadelineProto\Db\DbType|array $value, \danog\MadelineProto\Settings\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `null|\danog\MadelineProto\Db\DbType|array` +* `$settings`: `\danog\MadelineProto\Settings\DatabaseAbstract` + + +#### See also: +* [`\danog\MadelineProto\Settings\DatabaseAbstract`: Base class for storage backends.](../Settings/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/MemoryArray.md b/docs/PHP/danog/MadelineProto/Db/MemoryArray.md new file mode 100644 index 00000000..4a10822b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/MemoryArray.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Db\MemoryArray: Memory database backend. +description: + +--- +# `danog\MadelineProto\Db\MemoryArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Memory database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Db\MemoryArray::STD_PROP_LIST`: + +* `danog\MadelineProto\Db\MemoryArray::ARRAY_AS_PROPS`: + + +## Method list: +* `getInstance(string $table, mixed $value, \danog\MadelineProto\Settings\Database\Memory $settings): \Amp\Promise` + +## Methods: +### `getInstance(string $table, mixed $value, \danog\MadelineProto\Settings\Database\Memory $settings): \Amp\Promise` + +Get instance. + + +Parameters: +* `$table`: `string` +* `$value`: `mixed` +* `$settings`: `\danog\MadelineProto\Settings\Database\Memory` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Memory`: Memory backend settings.](../Settings/Database/Memory.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/MysqlArray.md b/docs/PHP/danog/MadelineProto/Db/MysqlArray.md new file mode 100644 index 00000000..63ce89f9 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/MysqlArray.md @@ -0,0 +1,131 @@ +--- +title: danog\MadelineProto\Db\MysqlArray: MySQL database backend. +description: + +--- +# `danog\MadelineProto\Db\MysqlArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MySQL database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetSet(string|int $index, $value)` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `initConnection(\danog\MadelineProto\Settings\Database\Mysql $settings): \Generator` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetSet(string|int $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string|int`

+The index to set for. +

+* `$value`: `` + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string|int`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `initConnection(\danog\MadelineProto\Settings\Database\Mysql $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Mysql` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Mysql`: MySQL backend settings.](../Settings/Database/Mysql.md) +* `\Generator` + + + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/NullCache/MysqlArray.md b/docs/PHP/danog/MadelineProto/Db/NullCache/MysqlArray.md new file mode 100644 index 00000000..cc9184a1 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/NullCache/MysqlArray.md @@ -0,0 +1,131 @@ +--- +title: danog\MadelineProto\Db\NullCache\MysqlArray: MySQL database backend, no caching. +description: + +--- +# `danog\MadelineProto\Db\NullCache\MysqlArray` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +MySQL database backend, no caching. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetSet(string|int $index, $value)` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `initConnection(\danog\MadelineProto\Settings\Database\Mysql $settings): \Generator` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetSet(string|int $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string|int`

+The index to set for. +

+* `$value`: `` + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string|int`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `initConnection(\danog\MadelineProto\Settings\Database\Mysql $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Mysql` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Mysql`: MySQL backend settings.](../Settings/Database/Mysql.md) +* `\Generator` + + + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/NullCache/PostgresArray.md b/docs/PHP/danog/MadelineProto/Db/NullCache/PostgresArray.md new file mode 100644 index 00000000..34f0a08b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/NullCache/PostgresArray.md @@ -0,0 +1,143 @@ +--- +title: danog\MadelineProto\Db\NullCache\PostgresArray: Postgres database backend, no caching. +description: + +--- +# `danog\MadelineProto\Db\NullCache\PostgresArray` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Postgres database backend, no caching. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `initConnection(\danog\MadelineProto\Settings\Database\Postgres $settings): \Generator` +* `offsetSet(string $index, $value)` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetUnset(string $index): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `initConnection(\danog\MadelineProto\Settings\Database\Postgres $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Postgres` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Postgres`: Postgres backend settings.](../Settings/Database/Postgres.md) +* `\Generator` + + + + +### `offsetSet(string $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string`

+The index to set for. +

+* `$value`: `` + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetUnset(string $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get array copy. + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/NullCache/RedisArray.md b/docs/PHP/danog/MadelineProto/Db/NullCache/RedisArray.md new file mode 100644 index 00000000..bd4b79a7 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/NullCache/RedisArray.md @@ -0,0 +1,143 @@ +--- +title: danog\MadelineProto\Db\NullCache\RedisArray: Redis database backend, no caching. +description: + +--- +# `danog\MadelineProto\Db\NullCache\RedisArray` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Redis database backend, no caching. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `initConnection(\danog\MadelineProto\Settings\Database\Redis $settings): \Generator` +* `offsetSet(string $index, $value)` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetUnset(string $index): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `initConnection(\danog\MadelineProto\Settings\Database\Redis $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Redis` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Redis`: Redis backend settings.](../Settings/Database/Redis.md) +* `\Generator` + + + + +### `offsetSet(string $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string`

+The index to set for. +

+* `$value`: `` + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetUnset(string $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get array copy. + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/PostgresArray.md b/docs/PHP/danog/MadelineProto/Db/PostgresArray.md new file mode 100644 index 00000000..89abcd42 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/PostgresArray.md @@ -0,0 +1,143 @@ +--- +title: danog\MadelineProto\Db\PostgresArray: Postgres database backend. +description: + +--- +# `danog\MadelineProto\Db\PostgresArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Postgres database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `initConnection(\danog\MadelineProto\Settings\Database\Postgres $settings): \Generator` +* `offsetSet(string $index, $value)` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetUnset(string $index): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `initConnection(\danog\MadelineProto\Settings\Database\Postgres $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Postgres` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Postgres`: Postgres backend settings.](../Settings/Database/Postgres.md) +* `\Generator` + + + + +### `offsetSet(string $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string`

+The index to set for. +

+* `$value`: `` + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetUnset(string $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get array copy. + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/RedisArray.md b/docs/PHP/danog/MadelineProto/Db/RedisArray.md new file mode 100644 index 00000000..42fedaf2 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/RedisArray.md @@ -0,0 +1,143 @@ +--- +title: danog\MadelineProto\Db\RedisArray: Redis database backend. +description: + +--- +# `danog\MadelineProto\Db\RedisArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Redis database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `initConnection(\danog\MadelineProto\Settings\Database\Redis $settings): \Generator` +* `offsetSet(string $index, $value)` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetUnset(string $index): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `initConnection(\danog\MadelineProto\Settings\Database\Redis $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Redis` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Redis`: Redis backend settings.](../Settings/Database/Redis.md) +* `\Generator` + + + + +### `offsetSet(string $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string`

+The index to set for. +

+* `$value`: `` + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetUnset(string $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get array copy. + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Db/SqlArray.md b/docs/PHP/danog/MadelineProto/Db/SqlArray.md new file mode 100644 index 00000000..88a27287 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Db/SqlArray.md @@ -0,0 +1,159 @@ +--- +title: danog\MadelineProto\Db\SqlArray: Generic SQL database backend. +description: + +--- +# `danog\MadelineProto\Db\SqlArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Generic SQL database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `isset(string|int $key): \Amp\Promise` +* `offsetGet(string|int $index): \Amp\Promise` +* `offsetSet(string|int $index, mixed $value): void` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Amp\Promise` +* `getIterator()` + +## Methods: +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get Array copy. + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `isset(string|int $key): \Amp\Promise` + +Check if element is set. + + +Parameters: +* `$key`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `offsetGet(string|int $index): \Amp\Promise` + +Get element. + + +Parameters: +* `$index`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise<\T> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `offsetSet(string|int $index, mixed $value): void` + +Set element. + + +Parameters: +* `$index`: `string|int` +* `$value`: `mixed` + Full type: + ``` + \T + ``` + + +#### See also: +* `\T` + + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset element. + + +Parameters: +* `$index`: `string|int` Offset + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Amp\Promise` + +Count number of elements. + + +#### See also: +* `\Amp\Promise` + + + + +### `getIterator()` + +Get iterator. + + + diff --git a/docs/PHP/danog/MadelineProto/EventHandler.md b/docs/PHP/danog/MadelineProto/EventHandler.md new file mode 100644 index 00000000..f452e40a --- /dev/null +++ b/docs/PHP/danog/MadelineProto/EventHandler.md @@ -0,0 +1,2713 @@ +--- +title: danog\MadelineProto\EventHandler: Event handler. +description: + +--- +# `danog\MadelineProto\EventHandler` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Event handler. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getReportPeers(): array|string|int` +* `getAPI(): \danog\MadelineProto\MTProto` +* `MTProtoToBotAPI(array $data): \Amp\Promise` +* `MTProtoToTd(mixed $params): \Amp\Promise` +* `MTProtoToTdcli(mixed $params): \Amp\Promise` +* `acceptCall(array $call): \Amp\Promise` +* `acceptSecretChat(array $params): \Amp\Promise` +* `acceptTos(): \Amp\Promise` +* `addUser(array $user): \Amp\Promise` +* `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` +* `all((\Generator|\Promise)[] $promises): \Amp\Promise` +* `any((\Promise|\Generator)[] $promises): \Amp\Promise` +* `arr(mixed $params): array` +* `base64urlDecode(string $data): string` +* `base64urlEncode(string $data): string` +* `botAPIToMTProto(array $arguments): \Amp\Promise` +* `botLogin(string $token): \Amp\Promise` +* `call(\Generator|\Promise|mixed $promise): \Amp\Promise` +* `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` +* `callForkDefer(\Generator|\Promise $promise): void` +* `callStatus(int $id): mixed` +* `checkTos(): \Amp\Promise` +* `cleanup(): \Amp\Promise` +* `closeConnection(string $message): void` +* `complete2faLogin(string $password): \Amp\Promise` +* `completeCall(array $params): \Amp\Promise` +* `completePhoneLogin(string $code): \Amp\Promise` +* `completeSignup(string $first_name, string $last_name): \Amp\Promise` +* `confirmCall(array $params): \Amp\Promise` +* `connectToAllDcs(bool $reconnectAll): \Amp\Promise` +* `declineTos(): \Amp\Promise` +* `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Amp\Promise` +* `discardSecretChat(int $chat): \Amp\Promise` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Amp\Promise` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Amp\Promise` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Amp\Promise` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Amp\Promise Downloaded file path` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Amp\Promise Returned response` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Amp\Promise` +* `echo(string $string): \Amp\Promise` +* `end(array $what): mixed` +* `exportAuthorization(): \Amp\Promise` +* `extractBotAPIFile(array $info): ?array` +* `fileGetContents(string $url): \Amp\Promise` +* `first((\Promise|\Generator)[] $promises): \Amp\Promise` +* `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` +* `fromSupergroup(int $id): float|int` +* `fullChatLastUpdated(mixed $id): \Amp\Promise` +* `fullGetSelf(): \Amp\Promise` +* `genVectorHash(array $ints): \int Vector hash` +* `getAllMethods(): mixed` +* `getAuthorization(): mixed` +* `getCachedConfig(): mixed` +* `getCall(int $call): mixed` +* `getCdnConfig(string $datacenter): \Amp\Promise` +* `getConfig(array $config, array $options): \Amp\Promise` +* `getDNSClient(): mixed` +* `getDataCenterConnections(): mixed` +* `getDataCenterId(): int|string` +* `getDialogs(bool $force): \Amp\Promise` +* `getDownloadInfo(mixed $messageMedia): \Amp\Promise` +* `getEventHandler(): mixed` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getFileInfo(mixed $constructor): \Amp\Promise` +* `getFolderId(mixed $id): ?int` +* `getFullDialogs(bool $force): \Amp\Promise` +* `getFullInfo(mixed $id): \Amp\Promise FullInfo object` +* `getHTTPClient(): mixed` +* `getHint(): mixed` +* `getId(mixed $id): int` +* `getInfo(mixed $id, bool $recursive): \Amp\Promise Info object` +* `getLogger()` +* `getMethodNamespaces(): mixed` +* `getMethodsNamespaced(): mixed` +* `getMimeFromBuffer(string $buffer): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getMimeFromFile(string $file): string` +* `getPropicInfo(mixed $messageMedia): \Amp\Promise` +* `getPsrLogger()` +* `getPwrChat(mixed $id): \Amp\Promise Chat object` +* `getSecretChat(array|int $chat): mixed` +* `getSelf(): array|bool` +* `getSettings(): mixed` +* `getTL(): mixed` +* `getVar(object $obj, string $var): mixed` +* `getWebTemplate(): mixed` +* `hasAllAuth(): mixed` +* `hasEventHandler(): mixed` +* `hasReportPeers(): mixed` +* `hasSecretChat(array|int $chat): mixed` +* `hasVar(object $obj, string $var): bool` +* `importAuthorization(mixed $authorization): \Amp\Promise` +* `inflateStripped(string $stripped): \string JPG payload` +* `initSelfRestart(): mixed` +* `isAltervista(): bool` +* `isArrayOrAlike(mixed $var): bool` +* `isIpc(): mixed` +* `isSupergroup(int $id): bool` +* `logger(string $param, int $level, string $file): mixed` +* `logout(): \Amp\Promise` +* `loop(callable|null $callback): \Amp\Promise` +* `loopFork(): \Amp\Promise` +* `markdownEscape(string $hwat): string` +* `mbStrSplit(string $text, int $length): array` +* `mbStrlen(string $text): float|int` +* `mbSubstr(string $text, int $offset, ?int $length): string` +* `methodCall(string $method, array|\Generator $args, array $aargs): \Amp\Promise` +* `methodCallWrite(string $method, array|\Generator $args, array $aargs): \Amp\Promise` +* `methodEscape(string $method): string` +* `packDouble(float $value): string` +* `packSignedInt(int $value): string` +* `packSignedLong(int $value): string` +* `packUnsignedInt(int $value): string` +* `peerIsset(mixed $id): \Amp\Promise` +* `phoneLogin(string $number, int $sms_type): \Amp\Promise` +* `posmod(int $a, int $b): \int Modulo` +* `random(int $length): \string Random string` +* `randomInt(int $modulus): int` +* `readLine(string $prompt): \Amp\Promise` +* `rekey(int $chat): \Amp\Promise` +* `report(string $message, string $parseMode): \Amp\Promise` +* `requestCall(mixed $user): \Amp\Promise` +* `requestSecretChat(mixed $user): \Amp\Promise` +* `resetUpdateState(): mixed` +* `resolveUsername(string $username): \Amp\Promise` +* `restart(): void` +* `rethrow(\Throwable $e, string $file): void` +* `rleDecode(string $string): string` +* `rleEncode(string $string): string` +* `secretChatStatus(int $chat): mixed` +* `serializeAll(): void` +* `setCallback(callable $callback): mixed` +* `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Amp\Promise` +* `setNoop(): mixed` +* `setReportPeers(int|string $userOrId): \Amp\Promise` +* `setVar(object $obj, string $var, mixed $val): void` +* `setWebTemplate(string $template): mixed` +* `setWebhook(string $hook_url, string $pem_path): mixed` +* `setupLogger(): mixed` +* `sleep(int|float $time): \Amp\Promise` +* `some((\Promise|\Generator)[] $promises): \Amp\Promise` +* `start(): \Amp\Promise` +* `stop(): void` +* `tdToMTProto(array $params): \Amp\Promise` +* `tdToTdcli(mixed $params): mixed` +* `tdcliToTd(array $params, array $key): mixed` +* `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` +* `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `toSupergroup(int $id): float|int` +* `typeEscape(string $type): string` +* `unpackDouble(string $value): float` +* `unpackFileId(string $fileId): mixed` +* `unpackSignedInt(string $value): int` +* `unpackSignedLong(string $value): int` +* `unpackSignedLongString(string $value): string` +* `unsetEventHandler(bool $disableUpdateHandling): mixed` +* `update2fa(array $params): \Amp\Promise` +* `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Amp\Promise` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Amp\Promise` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Amp\Promise` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` +* `async(bool $async): void` +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` + +## Methods: +### `getReportPeers(): array|string|int` + +Get peers where to send error reports. + + + +### `getAPI(): \danog\MadelineProto\MTProto` + +Get API instance. + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `MTProtoToBotAPI(array $data): \Amp\Promise` + +Convert MTProto parameters to bot API parameters. + + +Parameters: +* `$data`: `array` Data + + +#### See also: +* `\Amp\Promise` + + + + +### `MTProtoToTd(mixed $params): \Amp\Promise` + +MTProto to TD params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `MTProtoToTdcli(mixed $params): \Amp\Promise` + +MTProto to TDCLI params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptCall(array $call): \Amp\Promise` + +Accept call. + + +Parameters: +* `$call`: `array` Call + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptSecretChat(array $params): \Amp\Promise` + +Accept secret chat. + + +Parameters: +* `$params`: `array` Secret chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptTos(): \Amp\Promise` + +Accept terms of service update. + + +#### See also: +* `\Amp\Promise` + + + + +### `addUser(array $user): \Amp\Promise` + +Add user info. + + +Parameters: +* `$user`: `array` User info + + +#### See also: +* `\Amp\Promise` + + + + +### `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` + +Call promise $b after promise $a. + + +Parameters: +* `$a`: `\Generator|\Promise` Promise A +* `$b`: `\Generator|\Promise` Promise B + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `all((\Generator|\Promise)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when all promises succeed, and fails if any promise fails. +Returned promise succeeds with an array of values used to succeed each contained promise, with keys corresponding to the array of promises. + +Parameters: +* `$promises`: `(\Generator|\Promise)[]` Promises + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `any((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that is resolved when all promises are resolved. The returned promise will not fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `arr(mixed $params): array` + +Create array. + + +Parameters: +* `$params`: `mixed` Params + + + +### `base64urlDecode(string $data): string` + +base64URL decode. + + +Parameters: +* `$data`: `string` Data to decode + + + +### `base64urlEncode(string $data): string` + +Base64URL encode. + + +Parameters: +* `$data`: `string` Data to encode + + + +### `botAPIToMTProto(array $arguments): \Amp\Promise` + +Convert bot API parameters to MTProto parameters. + + +Parameters: +* `$arguments`: `array` Arguments + + +#### See also: +* `\Amp\Promise` + + + + +### `botLogin(string $token): \Amp\Promise` + +Login as bot. + + +Parameters: +* `$token`: `string` Bot token + + +#### See also: +* `\Amp\Promise` + + + + +### `call(\Generator|\Promise|mixed $promise): \Amp\Promise` + +Convert generator, promise or any other value to a promise. + + +Parameters: +* `$promise`: `\Generator|\Promise|mixed` + Full type: + ``` + \Generator|\Promise<\TReturn>|\TReturn + ``` + + +Fully typed return value: +``` +\Promise<\TReturn> +``` +#### See also: +* `\Generator` +* `\Promise` +* `\TReturn` +* `\Amp\Promise` + + + + +### `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` + +Call promise in background. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve +* `$actual`: `?\Generator|\Promise` Promise to resolve instead of $promise +* `$file`: `string` File + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `callForkDefer(\Generator|\Promise $promise): void` + +Call promise in background, deferring execution. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `callStatus(int $id): mixed` + +Get call status. + + +Parameters: +* `$id`: `int` Call ID + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `checkTos(): \Amp\Promise` + +Check for terms of service update. + + +#### See also: +* `\Amp\Promise` + + + + +### `cleanup(): \Amp\Promise` + +Cleanup memory and session file. + + +#### See also: +* `\Amp\Promise` + + + + +### `closeConnection(string $message): void` + +Close connection with client, connected via web. + + +Parameters: +* `$message`: `string` Message + + + +### `complete2faLogin(string $password): \Amp\Promise` + +Complete 2FA login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Amp\Promise` + + + + +### `completeCall(array $params): \Amp\Promise` + +Complete call handshake. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `completePhoneLogin(string $code): \Amp\Promise` + +Complet user login using login code. + + +Parameters: +* `$code`: `string` Login code + + +#### See also: +* `\Amp\Promise` + + + + +### `completeSignup(string $first_name, string $last_name): \Amp\Promise` + +Complete signup to Telegram. + + +Parameters: +* `$first_name`: `string` First name +* `$last_name`: `string` Last name + + +#### See also: +* `\Amp\Promise` + + + + +### `confirmCall(array $params): \Amp\Promise` + +Confirm call. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `connectToAllDcs(bool $reconnectAll): \Amp\Promise` + +Connects to all datacenters and if necessary creates authorization keys, binds them and writes client info. + + +Parameters: +* `$reconnectAll`: `bool` Whether to reconnect to all DCs + + +#### See also: +* `\Amp\Promise` + + + + +### `declineTos(): \Amp\Promise` + +Decline terms of service update. +THIS WILL DELETE YOUR ACCOUNT! + +#### See also: +* `\Amp\Promise` + + + + +### `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Amp\Promise` + +Discard call. + + +Parameters: +* `$call`: `array` Call +* `$reason`: `array` +* `$rating`: `array` Rating +* `$need_debug`: `bool` Need debug? + + +#### See also: +* `\Amp\Promise` + + + + +### `discardSecretChat(int $chat): \Amp\Promise` + +Discard secret chat. + + +Parameters: +* `$chat`: `int` Secret chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Amp\Promise` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Amp\Promise` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Amp\Promise` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Amp\Promise` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Amp\Promise Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Amp\Promise Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Amp\Promise<\Amp\Http\Server\Response> +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Amp\Promise` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Amp\Promise` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `echo(string $string): \Amp\Promise` + +Asynchronously write to stdout/browser. + + +Parameters: +* `$string`: `string` Message to echo + + +#### See also: +* `\Amp\Promise` + + + + +### `end(array $what): mixed` + +Get final element of array. + + +Parameters: +* `$what`: `array` Array + + + +### `exportAuthorization(): \Amp\Promise` + +Export authorization. + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `extractBotAPIFile(array $info): ?array` + +Extract file info from bot API message. + + +Parameters: +* `$info`: `array` Bot API message object + + + +### `fileGetContents(string $url): \Amp\Promise` + +Get contents of remote file asynchronously. + + +Parameters: +* `$url`: `string` URL + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `first((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when the first promise succeeds, and fails only if all promises fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` + +Asynchronously lock a file +Resolves with a callbable that MUST eventually be called in order to release the lock. + + +Parameters: +* `$file`: `string` File to lock +* `$operation`: `int` Locking mode +* `$polling`: `float` Polling interval +* `$token`: `?\Promise` Cancellation token +* `$failureCb`: `?callable` Failure callback, called only once if the first locking attempt fails. + + +#### See also: +* `\Promise` +* `\Amp\Promise` + + + + +### `fromSupergroup(int $id): float|int` + +Convert bot API channel ID to MTProto channel ID. + + +Parameters: +* `$id`: `int` Bot API channel ID + + + +### `fullChatLastUpdated(mixed $id): \Amp\Promise` + +When were full info for this chat last cached. + + +Parameters: +* `$id`: `mixed` Chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `fullGetSelf(): \Amp\Promise` + +Get info about the logged-in user, not cached. + + +#### See also: +* `\Amp\Promise` + + + + +### `genVectorHash(array $ints): \int Vector hash` + +Generate MTProto vector hash. + + +Parameters: +* `$ints`: `array` IDs + + +Return value: Vector hash + + +### `getAllMethods(): mixed` + +Get full list of MTProto and API methods. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getAuthorization(): mixed` + +Get authorization info. + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCachedConfig(): mixed` + +Get cached server-side config. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCall(int $call): mixed` + +Get call info. + + +Parameters: +* `$call`: `int` Call ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCdnConfig(string $datacenter): \Amp\Promise` + +Store RSA keys for CDN datacenters. + + +Parameters: +* `$datacenter`: `string` DC ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getConfig(array $config, array $options): \Amp\Promise` + +Get cached (or eventually re-fetch) server-side config. + + +Parameters: +* `$config`: `array` Current config +* `$options`: `array` Options for method call + + +#### See also: +* `\Amp\Promise` + + + + +### `getDNSClient(): mixed` + +Get async DNS client. + + +Fully typed return value: +``` +\Amp\Dns\Resolver|\Amp\Promise<\Amp\Dns\Resolver> +``` +#### See also: +* `\Amp\Dns\Resolver` +* `\Amp\Promise` + + + + +### `getDataCenterConnections(): mixed` + +Get all datacenter connections. + + +Fully typed return value: +``` +array<\danog\MadelineProto\DataCenterConnection>|\Amp\Promise> +``` +#### See also: +* `\danog\MadelineProto\DataCenterConnection` +* `\Amp\Promise` + + + + +### `getDataCenterId(): int|string` + +Get main DC ID. + + + +### `getDialogs(bool $force): \Amp\Promise` + +Get dialog peers. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\Amp\Promise` + + + + +### `getDownloadInfo(mixed $messageMedia): \Amp\Promise` + +Get download info of file +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getEventHandler(): mixed` + +Get event handler. + + +Fully typed return value: +``` +\danog\MadelineProto\EventHandler|\Amp\Promise<\danog\MadelineProto\EventHandler> +``` +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Amp\Promise` + + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getFileInfo(mixed $constructor): \Amp\Promise` + +Get info about file. + + +Parameters: +* `$constructor`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getFolderId(mixed $id): ?int` + +Get folder ID from object. + + +Parameters: +* `$id`: `mixed` Object + + + +### `getFullDialogs(bool $force): \Amp\Promise` + +Get full info of all dialogs. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +#### See also: +* `\Amp\Promise` + + + + +### `getFullInfo(mixed $id): \Amp\Promise FullInfo object` + +Get full info about peer, returns an FullInfo object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: FullInfo object + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [https://docs.madelineproto.xyz/FullInfo.html](https://docs.madelineproto.xyz/FullInfo.html) +* `\Amp\Promise` + + + + +### `getHTTPClient(): mixed` + +Get async HTTP client. + + +Fully typed return value: +``` +\Amp\Http\Client\HttpClient|\Amp\Promise<\Amp\Http\Client\HttpClient> +``` +#### See also: +* `\Amp\Http\Client\HttpClient` +* `\Amp\Promise` + + + + +### `getHint(): mixed` + +Get current password hint. + + +Fully typed return value: +``` +string|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getId(mixed $id): int` + +Get bot API ID from peer object. + + +Parameters: +* `$id`: `mixed` Peer + + + +### `getInfo(mixed $id, bool $recursive): \Amp\Promise Info object` + +Get info about peer, returns an Info object. + + +Parameters: +* `$id`: `mixed` Peer +* `$recursive`: `bool` Internal + + +Return value: Info object + +Fully typed return value: +``` +\Generator|array, mixed, array{InputPeer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}, Peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}, DialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, NotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputDialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputNotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, bot_api_id: int|string, user_id?: int, chat_id?: int, channel_id?: int, InputUser?: array{_: string, user_id?: int, access_hash?: mixed, min?: bool}, InputChannel?: array{_: string, channel_id: int, access_hash: mixed, min: bool}, type: string}> +``` +#### See also: +* [https://docs.madelineproto.xyz/Info.html](https://docs.madelineproto.xyz/Info.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `getLogger()` + +Get logger. + + + +### `getMethodNamespaces(): mixed` + +Get TL namespaces. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMethodsNamespaced(): mixed` + +Get namespaced methods (method => namespace). + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getPropicInfo(mixed $messageMedia): \Amp\Promise` + +Get download info of the propic of a user +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getPsrLogger()` + +Get PSR logger. + + + +### `getPwrChat(mixed $id): \Amp\Promise Chat object` + +Get full info about peer (including full list of channel members), returns a Chat object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: Chat object + +#### See also: +* [https://docs.madelineproto.xyz/Chat.html](https://docs.madelineproto.xyz/Chat.html) + + + + +### `getSecretChat(array|int $chat): mixed` + +Get secret chat. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getSelf(): array|bool` + +Get info about the logged-in user, cached. + + + +### `getSettings(): mixed` + +Return current settings. + + +Fully typed return value: +``` +\danog\MadelineProto\Settings|\Amp\Promise<\danog\MadelineProto\Settings> +``` +#### See also: +* [`\danog\MadelineProto\Settings`: Settings class used for configuring MadelineProto.](./Settings.md) +* `\Amp\Promise` + + + + +### `getTL(): mixed` + +Get TL serializer. + + +Fully typed return value: +``` +\danog\MadelineProto\TL\TL|\Amp\Promise<\danog\MadelineProto\TL\TL> +``` +#### See also: +* `\danog\MadelineProto\TL\TL` +* `\Amp\Promise` + + + + +### `getVar(object $obj, string $var): mixed` + +Accesses a private variable from an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `getWebTemplate(): mixed` + +Get web template. + + +Fully typed return value: +``` +string|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasAllAuth(): mixed` + +Checks whether all datacenters are authorized. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasEventHandler(): mixed` + +Check if an event handler instance is present. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasReportPeers(): mixed` + +Check if has report peers. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasSecretChat(array|int $chat): mixed` + +Check whether secret chat exists. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasVar(object $obj, string $var): bool` + +Checks private property exists in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `importAuthorization(mixed $authorization): \Amp\Promise` + +Import authorization. + + +Parameters: +* `$authorization`: `mixed` Authorization info + + +#### See also: +* `\Amp\Promise` + + + + +### `inflateStripped(string $stripped): \string JPG payload` + +Inflate stripped photosize to full JPG payload. + + +Parameters: +* `$stripped`: `string` Stripped photosize + + +Return value: JPG payload + + +### `initSelfRestart(): mixed` + +Initialize self-restart hack. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `isAltervista(): bool` + +Whether this is altervista. + + + +### `isArrayOrAlike(mixed $var): bool` + +Check if is array or similar (traversable && countable && arrayAccess). + + +Parameters: +* `$var`: `mixed` Value to check + + + +### `isIpc(): mixed` + +Whether we're an IPC client instance. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `isSupergroup(int $id): bool` + +Check whether provided bot API ID is a channel. + + +Parameters: +* `$id`: `int` Bot API ID + + + +### `logger(string $param, int $level, string $file): mixed` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `logout(): \Amp\Promise` + +Log out currently logged in user. + + +#### See also: +* `\Amp\Promise` + + + + +### `loop(callable|null $callback): \Amp\Promise` + +Start MadelineProto's update handling loop, or run the provided async callable. + + +Parameters: +* `$callback`: `callable|null` Async callable to run + + +#### See also: +* `\Amp\Promise` + + + + +### `loopFork(): \Amp\Promise` + +Start MadelineProto's update handling loop in background. + + +#### See also: +* `\Amp\Promise` + + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `mbStrSplit(string $text, int $length): array` + +Telegram UTF-8 multibyte split. + + +Parameters: +* `$text`: `string` Text +* `$length`: `int` Length + + + +### `mbStrlen(string $text): float|int` + +Get Telegram UTF-8 length of string. + + +Parameters: +* `$text`: `string` Text + + + +### `mbSubstr(string $text, int $offset, ?int $length): string` + +Telegram UTF-8 multibyte substring. + + +Parameters: +* `$text`: `string` Text to substring +* `$offset`: `int` Offset +* `$length`: `?int` Length + + + +### `methodCall(string $method, array|\Generator $args, array $aargs): \Amp\Promise` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `methodCallWrite(string $method, array|\Generator $args, array $aargs): \Amp\Promise` + +Call method and make sure it is asynchronously sent. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `packDouble(float $value): string` + +Convert double to binary version. + + +Parameters: +* `$value`: `float` Value to convert + + + +### `packSignedInt(int $value): string` + +Convert integer to base256 signed int. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packSignedLong(int $value): string` + +Convert integer to base256 long. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packUnsignedInt(int $value): string` + +Convert value to unsigned base256 int. + + +Parameters: +* `$value`: `int` Value + + + +### `peerIsset(mixed $id): \Amp\Promise` + +Check if peer is present in internal peer database. + + +Parameters: +* `$id`: `mixed` Peer + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `phoneLogin(string $number, int $sms_type): \Amp\Promise` + +Login as user. + + +Parameters: +* `$number`: `string` Phone number +* `$sms_type`: `int` SMS type + + +#### See also: +* `\Amp\Promise` + + + + +### `posmod(int $a, int $b): \int Modulo` + +Positive modulo +Works just like the % (modulus) operator, only returns always a postive number. + + +Parameters: +* `$a`: `int` A +* `$b`: `int` B + + +Return value: Modulo + + +### `random(int $length): \string Random string` + +Get random string of specified length. + + +Parameters: +* `$length`: `int` Length + + +Return value: Random string + + +### `randomInt(int $modulus): int` + +Get random integer. + + +Parameters: +* `$modulus`: `int` Modulus + + + +### `readLine(string $prompt): \Amp\Promise` + +Asynchronously read line. + + +Parameters: +* `$prompt`: `string` Prompt + + +#### See also: +* `\Amp\Promise` + + + + +### `rekey(int $chat): \Amp\Promise` + +Rekey secret chat. + + +Parameters: +* `$chat`: `int` Secret chat to rekey + + +#### See also: +* `\Amp\Promise` + + + + +### `report(string $message, string $parseMode): \Amp\Promise` + +Report an error to the previously set peer. + + +Parameters: +* `$message`: `string` Error to report +* `$parseMode`: `string` Parse mode + + +#### See also: +* `\Amp\Promise` + + + + +### `requestCall(mixed $user): \Amp\Promise` + +Request VoIP call. + + +Parameters: +* `$user`: `mixed` User + + +#### See also: +* `\Amp\Promise` + + + + +### `requestSecretChat(mixed $user): \Amp\Promise` + +Request secret chat. + + +Parameters: +* `$user`: `mixed` User to start secret chat with + + +#### See also: +* `\Amp\Promise` + + + + +### `resetUpdateState(): mixed` + +Reset the update state and fetch all updates from the beginning. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `resolveUsername(string $username): \Amp\Promise` + +Resolve username (use getInfo instead). + + +Parameters: +* `$username`: `string` Username + + +#### See also: +* `\Amp\Promise` + + + + +### `restart(): void` + +Restart update loop. + + + +### `rethrow(\Throwable $e, string $file): void` + +Rethrow error catched in strand. + + +Parameters: +* `$e`: `\Throwable` Exception +* `$file`: `string` File where the strand started + + +#### See also: +* `\Throwable` + + + + +### `rleDecode(string $string): string` + +null-byte RLE decode. + + +Parameters: +* `$string`: `string` Data to decode + + + +### `rleEncode(string $string): string` + +null-byte RLE encode. + + +Parameters: +* `$string`: `string` Data to encode + + + +### `secretChatStatus(int $chat): mixed` + +Get secret chat status. + + +Parameters: +* `$chat`: `int` Chat ID + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `serializeAll(): void` + +Serialize all instances. +CALLED ONLY ON SHUTDOWN. + + +### `setCallback(callable $callback): mixed` + +Set update handling callback. + + +Parameters: +* `$callback`: `callable` Callback + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Amp\Promise` + +Set event handler. + + +Parameters: +* `$eventHandler`: `class-string<\danog\MadelineProto\EventHandler>` Event handler + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Amp\Promise` + + + + +### `setNoop(): mixed` + +Set NOOP update handler, ignoring all updates. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setReportPeers(int|string $userOrId): \Amp\Promise` + +Set peer(s) where to send errors occurred in the event loop. + + +Parameters: +* `$userOrId`: `int|string` Username(s) or peer ID(s) + + +#### See also: +* `\Amp\Promise` + + + + +### `setVar(object $obj, string $var, mixed $val): void` + +Sets a private variable in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name +* `$val`: `mixed` Attribute value + + + +### `setWebTemplate(string $template): mixed` + +Set web template. + + +Parameters: +* `$template`: `string` Template + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setWebhook(string $hook_url, string $pem_path): mixed` + +Set webhook update handler. + + +Parameters: +* `$hook_url`: `string` Webhook URL +* `$pem_path`: `string` PEM path for self-signed certificate + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setupLogger(): mixed` + +Setup logger. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `sleep(int|float $time): \Amp\Promise` + +Asynchronously sleep. + + +Parameters: +* `$time`: `int|float` Number of seconds to sleep for + + +#### See also: +* `\Amp\Promise` + + + + +### `some((\Promise|\Generator)[] $promises): \Amp\Promise` + +Resolves with a two-item array delineating successful and failed Promise results. +The returned promise will only fail if the given number of required promises fail. + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `start(): \Amp\Promise` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Amp\Promise` + + + + +### `stop(): void` + +Stop update loop. + + + +### `tdToMTProto(array $params): \Amp\Promise` + +Convert TD to MTProto parameters. + + +Parameters: +* `$params`: `array` Parameters + + +#### See also: +* `\Amp\Promise` + + + + +### `tdToTdcli(mixed $params): mixed` + +Convert TD parameters to tdcli. + + +Parameters: +* `$params`: `mixed` Parameters + + + +### `tdcliToTd(array $params, array $key): mixed` + +Convert tdcli parameters to tdcli. + + +Parameters: +* `$params`: `array` Params +* `$key`: `array` Key + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` + +Create an artificial timeout for any \Generator or Promise. + + +Parameters: +* `$promise`: `\Generator|\Promise` +* `$timeout`: `int` + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` + +Creates an artificial timeout for any `Promise`. +If the promise is resolved before the timeout expires, the result is returned + +If the timeout expires before the promise is resolved, a default value is returned + +Parameters: +* `$promise`: `\Promise|\Generator` Promise to which the timeout is applied. + Full type: + ``` + \Promise<\TReturn>|\TGenerator + ``` +* `$timeout`: `int` Timeout in milliseconds. +* `$default`: `mixed` + Full type: + ``` + \TReturnAlt + ``` + + +#### See also: +* `\Promise` +* `\Generator` +* `\TReturn` +* `\TGenerator` +* `\TReturnAlt` +* `\Amp\Promise` + + + + +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `toSupergroup(int $id): float|int` + +Convert MTProto channel ID to bot API channel ID. + + +Parameters: +* `$id`: `int` MTProto channel ID + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `unpackDouble(string $value): float` + +Unpack binary double. + + +Parameters: +* `$value`: `string` Value to unpack + + + +### `unpackFileId(string $fileId): mixed` + +Unpack bot API file ID. + + +Parameters: +* `$fileId`: `string` Bot API file ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `unpackSignedInt(string $value): int` + +Unpack base256 signed int. + + +Parameters: +* `$value`: `string` base256 int + + + +### `unpackSignedLong(string $value): int` + +Unpack base256 signed long. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unpackSignedLongString(string $value): string` + +Unpack base256 signed long to string. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unsetEventHandler(bool $disableUpdateHandling): mixed` + +Unset event handler. + + +Parameters: +* `$disableUpdateHandling`: `bool` Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler) + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `update2fa(array $params): \Amp\Promise` + +Update the 2FA password. +The params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` The params + + +#### See also: +* `\Amp\Promise` + + + + +### `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Amp\Promise` + +Parse, update and store settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` +* `\Amp\Promise` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Amp\Promise` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Amp\Promise` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Amp\Promise` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` + +Synchronously wait for a promise|generator. + + +Parameters: +* `$promise`: `\Generator|\Promise` The promise to wait for +* `$ignoreSignal`: `bool` Whether to ignore shutdown signals + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `async(bool $async): void` + +Enable or disable async. + + +Parameters: +* `$async`: `bool` Whether to enable or disable async + + + +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + diff --git a/docs/PHP/danog/MadelineProto/Exception.md b/docs/PHP/danog/MadelineProto/Exception.md new file mode 100644 index 00000000..bab7d2db --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Exception.md @@ -0,0 +1,87 @@ +--- +title: danog\MadelineProto\Exception: Basic exception. +description: + +--- +# `danog\MadelineProto\Exception` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Basic exception. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `extension(string $extensionName): self` +* `exceptionErrorHandler(): false` +* `exceptionHandler(): void` +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `extension(string $extensionName): self` + +Complain about missing extensions. + + +Parameters: +* `$extensionName`: `string` Extension name + + + +### `exceptionErrorHandler(): false` + +ExceptionErrorHandler. +Error handler + + +### `exceptionHandler(): void` + +ExceptionErrorHandler. +Error handler + + +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHP/danog/MadelineProto/FileCallback.md b/docs/PHP/danog/MadelineProto/FileCallback.md new file mode 100644 index 00000000..49d3aab8 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/FileCallback.md @@ -0,0 +1,28 @@ +--- +title: danog\MadelineProto\FileCallback: File callback interface. +description: + +--- +# `danog\MadelineProto\FileCallback` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +File callback interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getFile(): mixed` + +## Methods: +### `getFile(): mixed` + +Get file. + + + diff --git a/docs/PHP/danog/MadelineProto/FileCallbackInterface.md b/docs/PHP/danog/MadelineProto/FileCallbackInterface.md new file mode 100644 index 00000000..d55995e0 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/FileCallbackInterface.md @@ -0,0 +1,28 @@ +--- +title: danog\MadelineProto\FileCallbackInterface: File callback interface. +description: + +--- +# `danog\MadelineProto\FileCallbackInterface` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +File callback interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getFile(): mixed` + +## Methods: +### `getFile(): mixed` + +Get file. + + + diff --git a/docs/PHP/danog/MadelineProto/Files/Server.md b/docs/PHP/danog/MadelineProto/Files/Server.md new file mode 100644 index 00000000..49315409 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Files/Server.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Files\Server: MadelineProto fileserver. +description: + +--- +# `danog\MadelineProto\Files\Server` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MadelineProto fileserver. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Ipc/Client.md b/docs/PHP/danog/MadelineProto/Ipc/Client.md new file mode 100644 index 00000000..05cdf05e --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Ipc/Client.md @@ -0,0 +1,444 @@ +--- +title: danog\MadelineProto\Ipc\Client: IPC client. +description: + +--- +# `danog\MadelineProto\Ipc\Client` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC client. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(callable $callback): \Generator` +* `unreference(): void` +* `isIpc(): bool` +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator Downloaded file path` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` +* `setEventHandler(mixed $params): void` +* `getEventHandler(mixed $params): void` +* `logger(string $param, int $level, string $file): void` +* `disconnect(): \Generator` +* `start(): \Generator` +* `getWebTemplate(): string` +* `setWebTemplate(string $template): void` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +## Methods: +### `loop(callable $callback): \Generator` + +Run the provided async callable. + + +Parameters: +* `$callback`: `callable` Async callable to run + + +#### See also: +* `\Generator` + + + + +### `unreference(): void` + +Unreference. + + + +### `isIpc(): bool` + +Whether we're an IPC client instance. + + + +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Generator` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator Downloaded file path` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `setEventHandler(mixed $params): void` + +Placeholder. + + +Parameters: +* `$params`: `mixed` Params + + + +### `getEventHandler(mixed $params): void` + +Placeholder. + + +Parameters: +* `$params`: `mixed` Params + + + +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `disconnect(): \Generator` + +Disconnect cleanly from main instance. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `start(): \Generator` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Generator` + + + + +### `getWebTemplate(): string` + +Get web template. + + + +### `setWebTemplate(string $template): void` + +Set web template. + + +Parameters: +* `$template`: `string` Template + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Generator` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Generator|\Amp\Promise|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Generator` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/Ipc/ClientAbstract.md b/docs/PHP/danog/MadelineProto/Ipc/ClientAbstract.md new file mode 100644 index 00000000..b926d493 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Ipc/ClientAbstract.md @@ -0,0 +1,51 @@ +--- +title: danog\MadelineProto\Ipc\ClientAbstract: IPC client. +description: + +--- +# `danog\MadelineProto\Ipc\ClientAbstract` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC client. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `logger(string $param, int $level, string $file): void` +* `disconnect(): \Generator` + +## Methods: +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `disconnect(): \Generator` + +Disconnect cleanly from main instance. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/Ipc/IpcState.md b/docs/PHP/danog/MadelineProto/Ipc/IpcState.md new file mode 100644 index 00000000..29fbf577 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Ipc/IpcState.md @@ -0,0 +1,47 @@ +--- +title: danog\MadelineProto\Ipc\IpcState: IPC state class. +description: + +--- +# `danog\MadelineProto\Ipc\IpcState` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC state class. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getStartupTime(): float` +* `getStartupId(): int` +* `getException(): ?\Throwable` + +## Methods: +### `getStartupTime(): float` + +Get startup time. + + + +### `getStartupId(): int` + +Get startup ID. + + + +### `getException(): ?\Throwable` + +Get exception. + + +#### See also: +* `\Throwable` + + + + diff --git a/docs/PHP/danog/MadelineProto/Ipc/Server.md b/docs/PHP/danog/MadelineProto/Ipc/Server.md new file mode 100644 index 00000000..f2dea759 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Ipc/Server.md @@ -0,0 +1,147 @@ +--- +title: danog\MadelineProto\Ipc\Server: IPC server. +description: + +--- +# `danog\MadelineProto\Ipc\Server` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC server. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\Ipc\Server::SHUTDOWN: Shutdown server. + + +## Method list: +* `setIpcPath(\danog\MadelineProto\SessionPaths $session): void` +* `startMe(\danog\MadelineProto\SessionPaths $session): \Amp\Promise` +* `waitShutdown(): \Amp\Promise` +* `loop(): \Generator` +* `setSettings(\danog\MadelineProto\Settings\Ipc $settings): self` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `setIpcPath(\danog\MadelineProto\SessionPaths $session): void` + +Set IPC path. + + +Parameters: +* `$session`: `\danog\MadelineProto\SessionPaths` Session + + +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) + + + + +### `startMe(\danog\MadelineProto\SessionPaths $session): \Amp\Promise` + +Start IPC server in background. + + +Parameters: +* `$session`: `\danog\MadelineProto\SessionPaths` Session path + + +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) +* `\Amp\Promise` + + + + +### `waitShutdown(): \Amp\Promise` + +Wait for shutdown. + + +#### See also: +* `\Amp\Promise` + + + + +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `setSettings(\danog\MadelineProto\Settings\Ipc $settings): self` + +Set IPC settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Ipc` IPC settings + + +#### See also: +* [`\danog\MadelineProto\Settings\Ipc`: IPC server settings.](../Settings/Ipc.md) + + + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Ipc/ServerCallback.md b/docs/PHP/danog/MadelineProto/Ipc/ServerCallback.md new file mode 100644 index 00000000..4a270f8d --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Ipc/ServerCallback.md @@ -0,0 +1,147 @@ +--- +title: danog\MadelineProto\Ipc\ServerCallback: IPC callback server. +description: + +--- +# `danog\MadelineProto\Ipc\ServerCallback` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC callback server. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\Ipc\ServerCallback::SHUTDOWN: Shutdown server. + + +## Method list: +* `setIpcPath(\danog\MadelineProto\SessionPaths $session): void` +* `startMe(\danog\MadelineProto\SessionPaths $session): \Amp\Promise` +* `waitShutdown(): \Amp\Promise` +* `loop(): \Generator` +* `setSettings(\danog\MadelineProto\Settings\Ipc $settings): self` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `setIpcPath(\danog\MadelineProto\SessionPaths $session): void` + +Set IPC path. + + +Parameters: +* `$session`: `\danog\MadelineProto\SessionPaths` Session + + +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) + + + + +### `startMe(\danog\MadelineProto\SessionPaths $session): \Amp\Promise` + +Start IPC server in background. + + +Parameters: +* `$session`: `\danog\MadelineProto\SessionPaths` Session path + + +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) +* `\Amp\Promise` + + + + +### `waitShutdown(): \Amp\Promise` + +Wait for shutdown. + + +#### See also: +* `\Amp\Promise` + + + + +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `setSettings(\danog\MadelineProto\Settings\Ipc $settings): self` + +Set IPC settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Ipc` IPC settings + + +#### See also: +* [`\danog\MadelineProto\Settings\Ipc`: IPC server settings.](../Settings/Ipc.md) + + + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Ipc/Wrapper.md b/docs/PHP/danog/MadelineProto/Ipc/Wrapper.md new file mode 100644 index 00000000..0848abc0 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Ipc/Wrapper.md @@ -0,0 +1,87 @@ +--- +title: danog\MadelineProto\Ipc\Wrapper: Callback payload wrapper. +description: + +--- +# `danog\MadelineProto\Ipc\Wrapper` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Callback payload wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `create(mixed $data, \danog\MadelineProto\SessionPaths $ipc): \Generator` +* `wrap(object|callable $callback, bool $wrapObjects): void` +* `logger(string $param, int $level, string $file): void` +* `disconnect(): \Generator` + +## Methods: +### `create(mixed $data, \danog\MadelineProto\SessionPaths $ipc): \Generator` + +Constructor. + + +Parameters: +* `$data`: `mixed` Payload data +* `$ipc`: `\danog\MadelineProto\SessionPaths` IPC URI + + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, \danog\MadelineProto\Ipc\Wrapper> +``` +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `wrap(object|callable $callback, bool $wrapObjects): void` + +Wrap a certain callback object. + + +Parameters: +* `$callback`: `object|callable` Callback to wrap +* `$wrapObjects`: `bool` Whether to wrap object methods, too + + + +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `disconnect(): \Generator` + +Disconnect cleanly from main instance. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/Ipc/Wrapper/Obj.md b/docs/PHP/danog/MadelineProto/Ipc/Wrapper/Obj.md new file mode 100644 index 00000000..765fbbd1 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Ipc/Wrapper/Obj.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Ipc\Wrapper\Obj: Generic callback wrapper object. +description: + +--- +# `danog\MadelineProto\Ipc\Wrapper\Obj` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Generic callback wrapper object. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Logger.md b/docs/PHP/danog/MadelineProto/Logger.md new file mode 100644 index 00000000..00c5d9f9 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Logger.md @@ -0,0 +1,96 @@ +--- +title: danog\MadelineProto\Logger: Logger class. +description: + +--- +# `danog\MadelineProto\Logger` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Logger class. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Logger::LEVEL_ULTRA_VERBOSE`: Ultra verbose level. + +* `danog\MadelineProto\Logger::LEVEL_VERBOSE`: Verbose level. + +* `danog\MadelineProto\Logger::LEVEL_NOTICE`: Notice level. + +* `danog\MadelineProto\Logger::LEVEL_WARNING`: Warning level. + +* `danog\MadelineProto\Logger::LEVEL_ERROR`: Error level. + +* `danog\MadelineProto\Logger::LEVEL_FATAL`: Fatal error level. + +* `danog\MadelineProto\Logger::LOGGER_DEFAULT`: Default logger (syslog). + +* `danog\MadelineProto\Logger::LOGGER_ECHO`: Echo logger. + +* `danog\MadelineProto\Logger::LOGGER_FILE`: File logger. + +* `danog\MadelineProto\Logger::LOGGER_CALLABLE`: Callable logger. + + +## Method list: +* `constructorFromSettings(\danog\MadelineProto\Settings\Logger $settings): self` +* `log(mixed $param, int $level): void` +* `logger(mixed $param, int $level, string $file): void` +* `getPsrLogger(): \Psr\Log\LoggerInterface` + +## Methods: +### `constructorFromSettings(\danog\MadelineProto\Settings\Logger $settings): self` + +Construct global static logger from MadelineProto settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Logger` Settings instance + + +#### See also: +* [`\danog\MadelineProto\Settings\Logger`: Logger settings.](./Settings/Logger.md) + + + + +### `log(mixed $param, int $level): void` + +Log a message. + + +Parameters: +* `$param`: `mixed` Message +* `$level`: `int` Logging level + + + +### `logger(mixed $param, int $level, string $file): void` + +Log a message. + + +Parameters: +* `$param`: `mixed` Message to log +* `$level`: `int` Logging level +* `$file`: `string` File that originated the message + + + +### `getPsrLogger(): \Psr\Log\LoggerInterface` + +Get PSR logger. + + +#### See also: +* `\Psr\Log\LoggerInterface` + + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/APILoop.md b/docs/PHP/danog/MadelineProto/Loop/APILoop.md new file mode 100644 index 00000000..afd2f670 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/APILoop.md @@ -0,0 +1,35 @@ +--- +title: danog\MadelineProto\Loop\APILoop: API loop trait. +description: + +--- +# `danog\MadelineProto\Loop\APILoop` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +API loop trait. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `start(): bool` +* `isRunning(): bool` + +## Methods: +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Connection/CheckLoop.md b/docs/PHP/danog/MadelineProto/Loop/Connection/CheckLoop.md new file mode 100644 index 00000000..03842779 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Connection/CheckLoop.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\Loop\Connection\CheckLoop: RPC call status check loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\CheckLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +RPC call status check loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Connection/Common.md b/docs/PHP/danog/MadelineProto/Loop/Connection/Common.md new file mode 100644 index 00000000..a6021d97 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Connection/Common.md @@ -0,0 +1,35 @@ +--- +title: danog\MadelineProto\Loop\Connection\Common: RPC call status check loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\Common` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +RPC call status check loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `start(): bool` +* `isRunning(): bool` + +## Methods: +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Connection/HttpWaitLoop.md b/docs/PHP/danog/MadelineProto/Loop/Connection/HttpWaitLoop.md new file mode 100644 index 00000000..8b797129 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Connection/HttpWaitLoop.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\Loop\Connection\HttpWaitLoop: HttpWait loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\HttpWaitLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +HttpWait loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Connection/PingLoop.md b/docs/PHP/danog/MadelineProto/Loop/Connection/PingLoop.md new file mode 100644 index 00000000..84fe98d2 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Connection/PingLoop.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\Loop\Connection\PingLoop: Ping loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\PingLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Ping loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Connection/ReadLoop.md b/docs/PHP/danog/MadelineProto/Loop/Connection/ReadLoop.md new file mode 100644 index 00000000..ccb256fd --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Connection/ReadLoop.md @@ -0,0 +1,89 @@ +--- +title: danog\MadelineProto\Loop\Connection\ReadLoop: Socket read loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\ReadLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Socket read loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Connection/WriteLoop.md b/docs/PHP/danog/MadelineProto/Loop/Connection/WriteLoop.md new file mode 100644 index 00000000..27f5a3e1 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Connection/WriteLoop.md @@ -0,0 +1,126 @@ +--- +title: danog\MadelineProto\Loop\Connection\WriteLoop: Socket write loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\WriteLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Socket write loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\Loop\Connection\WriteLoop::MAX_COUNT: + +* danog\MadelineProto\Loop\Connection\WriteLoop::MAX_IDS: + + +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Update/FeedLoop.md b/docs/PHP/danog/MadelineProto/Loop/Update/FeedLoop.md new file mode 100644 index 00000000..eba91ba8 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Update/FeedLoop.md @@ -0,0 +1,124 @@ +--- +title: danog\MadelineProto\Loop\Update\FeedLoop: Update feed loop. +description: + +--- +# `danog\MadelineProto\Loop\Update\FeedLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Update feed loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\Loop\Update\FeedLoop::GENERIC: Main loop ID. + + +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Update/SeqLoop.md b/docs/PHP/danog/MadelineProto/Loop/Update/SeqLoop.md new file mode 100644 index 00000000..302374c5 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Update/SeqLoop.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\Loop\Update\SeqLoop: update feed loop. +description: + +--- +# `danog\MadelineProto\Loop\Update\SeqLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +update feed loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Loop/Update/UpdateLoop.md b/docs/PHP/danog/MadelineProto/Loop/Update/UpdateLoop.md new file mode 100644 index 00000000..087eb76b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Loop/Update/UpdateLoop.md @@ -0,0 +1,124 @@ +--- +title: danog\MadelineProto\Loop\Update\UpdateLoop: Update loop. +description: + +--- +# `danog\MadelineProto\Loop\Update\UpdateLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Update loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\Loop\Update\UpdateLoop::GENERIC: Main loop ID. + + +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHP/danog/MadelineProto/Lua.md b/docs/PHP/danog/MadelineProto/Lua.md new file mode 100644 index 00000000..6421a086 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Lua.md @@ -0,0 +1,33 @@ +--- +title: danog\MadelineProto\Lua: Lua interface. +description: + +--- +# `danog\MadelineProto\Lua` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Lua interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `tdcliFunction(): \Generator|int` + +## Methods: +### `tdcliFunction(): \Generator|int` + + + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProto.md b/docs/PHP/danog/MadelineProto/MTProto.md new file mode 100644 index 00000000..02b3a57e --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProto.md @@ -0,0 +1,1839 @@ +--- +title: danog\MadelineProto\MTProto: Manages all of the mtproto stuff. +description: + +--- +# `danog\MadelineProto\MTProto` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Manages all of the mtproto stuff. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\MTProto::RELEASE`: Release version. + +* `danog\MadelineProto\MTProto::NOT_LOGGED_IN`: We're not logged in. + +* `danog\MadelineProto\MTProto::WAITING_CODE`: We're waiting for the login code. + +* `danog\MadelineProto\MTProto::WAITING_SIGNUP`: We're waiting for parameters to sign up. + +* `danog\MadelineProto\MTProto::WAITING_PASSWORD`: We're waiting for the 2FA password. + +* `danog\MadelineProto\MTProto::LOGGED_IN`: We're logged in. + +* `danog\MadelineProto\MTProto::SECRET_EMPTY`: Secret chat was not found. + +* `danog\MadelineProto\MTProto::SECRET_REQUESTED`: Secret chat was requested. + +* `danog\MadelineProto\MTProto::SECRET_READY`: Secret chat was found. + + +## Method list: +* `serializeSession(): \Generator` +* `serializeAll(): void` +* `cleanup(): \Generator` +* `logger(string $param, int $level, string $file): void` +* `getMethodNamespaces(): array` +* `getMethodsNamespaced(): array` +* `getTL(): \danog\MadelineProto\TL\TL` +* `getLogger()` +* `getPsrLogger()` +* `getHTTPClient(): \Amp\Http\Client\HttpClient` +* `getDNSClient(): \Amp\Dns\Resolver` +* `fileGetContents(string $url): \Generator` +* `getDataCenterConnections(): \danog\MadelineProto\DataCenterConnection[]` +* `getDataCenterId(): int|string` +* `isIpc(): bool` +* `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Generator` +* `getSettings(): \danog\MadelineProto\Settings` +* `setupLogger(): void` +* `hasAllAuth(): bool` +* `connectToAllDcs(bool $reconnectAll): \Generator` +* `resetUpdateState(): void` +* `getCdnConfig(string $datacenter): \Generator` +* `getCachedConfig(): array` +* `getConfig(array $config, array $options): \Generator` +* `getSelf(): array|bool` +* `fullGetSelf(): \Generator` +* `getAuthorization(): int` +* `getHint(): string` +* `hasReportPeers(): bool` +* `setReportPeers(int|string $userOrId): \Generator` +* `report(string $message, string $parseMode): \Generator` +* `getAllMethods(): array` +* `getMethodCallbacks(): array` +* `getMethodBeforeCallbacks(): array` +* `getConstructorCallbacks(): array` +* `getConstructorBeforeCallbacks(): array` +* `getConstructorSerializeCallbacks(): array` +* `getTypeMismatchCallbacks(): array` +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` +* `methodCall(string $method, array|\Generator $args, array $aargs): mixed` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` +* `toSupergroup(int $id): float|int` +* `fromSupergroup(int $id): float|int` +* `isSupergroup(int $id): bool` +* `addUser(array $user): \Generator` +* `peerIsset(mixed $id): \Generator` +* `getFolderId(mixed $id): ?int` +* `getId(mixed $id): int` +* `getInfo(mixed $id, bool $recursive): \Generator Info object` +* `fullChatLastUpdated(mixed $id): \Generator` +* `getFullInfo(mixed $id): \Generator FullInfo object` +* `getPwrChat(mixed $id): \Generator Chat object` +* `resolveUsername(string $username): \Generator` +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` +* `getFileInfo(mixed $constructor): \Generator` +* `getPropicInfo(mixed $messageMedia): \Generator` +* `extractBotAPIFile(array $info): ?array` +* `getDownloadInfo(mixed $messageMedia): \Generator` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` +* `acceptSecretChat(array $params): \Generator` +* `requestSecretChat(mixed $user): \Generator` +* `rekey(int $chat): \Generator` +* `secretChatStatus(int $chat): \int One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY` +* `getSecretChat(array|int $chat): array` +* `hasSecretChat(array|int $chat): bool` +* `discardSecretChat(int $chat): \Generator` +* `mbStrlen(string $text): float|int` +* `mbSubstr(string $text, int $offset, ?int $length): string` +* `mbStrSplit(string $text, int $length): array` +* `MTProtoToBotAPI(array $data): \Generator` +* `botAPIToMTProto(array $arguments): \Generator` +* `unpackFileId(string $fileId): \array Unpacked file ID` +* `tdcliToTd(array $params, array $key): array` +* `tdToMTProto(array $params): \Generator` +* `MTProtoToTdcli(mixed $params): \Generator` +* `MTProtoToTd(mixed $params): \Generator` +* `tdToTdcli(mixed $params): mixed` +* `requestCall(mixed $user): \Generator` +* `acceptCall(array $call): \Generator` +* `confirmCall(array $params): \Generator` +* `completeCall(array $params): \Generator` +* `callStatus(int $id): int` +* `getCall(int $call): array` +* `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Generator` +* `getDialogs(bool $force): \Generator` +* `getFullDialogs(bool $force): \Generator` +* `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Generator` +* `unsetEventHandler(bool $disableUpdateHandling): void` +* `getEventHandler(): \danog\MadelineProto\EventHandler` +* `hasEventHandler(): bool` +* `setWebhook(string $hook_url, string $pem_path): void` +* `setCallback(callable $callback): void` +* `logout(): \Generator` +* `botLogin(string $token): \Generator` +* `phoneLogin(string $number, int $sms_type): \Generator` +* `completePhoneLogin(string $code): \Generator` +* `importAuthorization(mixed $authorization): \Generator` +* `exportAuthorization(): \Generator` +* `completeSignup(string $first_name, string $last_name): \Generator` +* `complete2faLogin(string $password): \Generator` +* `update2fa(array $params): \Generator` +* `initSelfRestart(): void` +* `loop(callable|null $callback): \Generator` +* `stop(): void` +* `restart(): void` +* `loopFork(): \Amp\Promise` +* `closeConnection(string $message): void` +* `setNoop(): void` +* `start(): \Generator` +* `getWebTemplate(): string` +* `setWebTemplate(string $template): void` +* `checkTos(): \Generator` +* `acceptTos(): \Generator` +* `declineTos(): \Generator` + +## Methods: +### `serializeSession(): \Generator` + +Serialize session, returning object to serialize to db. + + +#### See also: +* `\Generator` + + + + +### `serializeAll(): void` + +Serialize all instances. +CALLED ONLY ON SHUTDOWN. + + +### `cleanup(): \Generator` + +Cleanup memory and session file. + + +#### See also: +* `\Generator` + + + + +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `getMethodNamespaces(): array` + +Get TL namespaces. + + + +### `getMethodsNamespaced(): array` + +Get namespaced methods (method => namespace). + + + +### `getTL(): \danog\MadelineProto\TL\TL` + +Get TL serializer. + + +#### See also: +* `\danog\MadelineProto\TL\TL` + + + + +### `getLogger()` + +Get logger. + + + +### `getPsrLogger()` + +Get PSR logger. + + + +### `getHTTPClient(): \Amp\Http\Client\HttpClient` + +Get async HTTP client. + + +#### See also: +* `\Amp\Http\Client\HttpClient` + + + + +### `getDNSClient(): \Amp\Dns\Resolver` + +Get async DNS client. + + +#### See also: +* `\Amp\Dns\Resolver` + + + + +### `fileGetContents(string $url): \Generator` + +Get contents of remote file asynchronously. + + +Parameters: +* `$url`: `string` URL + + +Fully typed return value: +``` +\Generator, mixed, string> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getDataCenterConnections(): \danog\MadelineProto\DataCenterConnection[]` + +Get all datacenter connections. + + +#### See also: +* `\danog\MadelineProto\DataCenterConnection` + + + + +### `getDataCenterId(): int|string` + +Get main DC ID. + + + +### `isIpc(): bool` + +Whether we're an IPC client instance. + + + +### `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Generator` + +Parse, update and store settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` +* `\Generator` + + + + +### `getSettings(): \danog\MadelineProto\Settings` + +Return current settings. + + +#### See also: +* [`\danog\MadelineProto\Settings`: Settings class used for configuring MadelineProto.](./Settings.md) + + + + +### `setupLogger(): void` + +Setup logger. + + + +### `hasAllAuth(): bool` + +Checks whether all datacenters are authorized. + + + +### `connectToAllDcs(bool $reconnectAll): \Generator` + +Connects to all datacenters and if necessary creates authorization keys, binds them and writes client info. + + +Parameters: +* `$reconnectAll`: `bool` Whether to reconnect to all DCs + + +#### See also: +* `\Generator` + + + + +### `resetUpdateState(): void` + +Reset the update state and fetch all updates from the beginning. + + + +### `getCdnConfig(string $datacenter): \Generator` + +Store RSA keys for CDN datacenters. + + +Parameters: +* `$datacenter`: `string` DC ID + + +#### See also: +* `\Generator` + + + + +### `getCachedConfig(): array` + +Get cached server-side config. + + + +### `getConfig(array $config, array $options): \Generator` + +Get cached (or eventually re-fetch) server-side config. + + +Parameters: +* `$config`: `array` Current config +* `$options`: `array` Options for method call + + +#### See also: +* `\Generator` + + + + +### `getSelf(): array|bool` + +Get info about the logged-in user, cached. + + + +### `fullGetSelf(): \Generator` + +Get info about the logged-in user, not cached. + + +#### See also: +* `\Generator` + + + + +### `getAuthorization(): int` + +Get authorization info. + + + +### `getHint(): string` + +Get current password hint. + + + +### `hasReportPeers(): bool` + +Check if has report peers. + + + +### `setReportPeers(int|string $userOrId): \Generator` + +Set peer(s) where to send errors occurred in the event loop. + + +Parameters: +* `$userOrId`: `int|string` Username(s) or peer ID(s) + + +#### See also: +* `\Generator` + + + + +### `report(string $message, string $parseMode): \Generator` + +Report an error to the previously set peer. + + +Parameters: +* `$message`: `string` Error to report +* `$parseMode`: `string` Parse mode + + +#### See also: +* `\Generator` + + + + +### `getAllMethods(): array` + +Get full list of MTProto and API methods. + + + +### `getMethodCallbacks(): array` + +Called right before serialization of method starts. +Pass the method name + + +### `getMethodBeforeCallbacks(): array` + +Called right before serialization of method starts. +Pass the method name + + +### `getConstructorCallbacks(): array` + +Called right after deserialization of object, passing the final object. + + + +### `getConstructorBeforeCallbacks(): array` + +Called right before deserialization of object. +Pass only the constructor name + + +### `getConstructorSerializeCallbacks(): array` + +Called right before serialization of constructor. +Passed the object, will return a modified version. + + +### `getTypeMismatchCallbacks(): array` + +Called if objects of the specified type cannot be serialized. +Passed the unserializable object, +will try to convert it to an object of the proper type. + + +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + +### `methodCall(string $method, array|\Generator $args, array $aargs): mixed` + +Synchronous wrapper for methodCall. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `toSupergroup(int $id): float|int` + +Convert MTProto channel ID to bot API channel ID. + + +Parameters: +* `$id`: `int` MTProto channel ID + + + +### `fromSupergroup(int $id): float|int` + +Convert bot API channel ID to MTProto channel ID. + + +Parameters: +* `$id`: `int` Bot API channel ID + + + +### `isSupergroup(int $id): bool` + +Check whether provided bot API ID is a channel. + + +Parameters: +* `$id`: `int` Bot API ID + + + +### `addUser(array $user): \Generator` + +Add user info. + + +Parameters: +* `$user`: `array` User info + + +#### See also: +* `\Generator` + + + + +### `peerIsset(mixed $id): \Generator` + +Check if peer is present in internal peer database. + + +Parameters: +* `$id`: `mixed` Peer + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFolderId(mixed $id): ?int` + +Get folder ID from object. + + +Parameters: +* `$id`: `mixed` Object + + + +### `getId(mixed $id): int` + +Get bot API ID from peer object. + + +Parameters: +* `$id`: `mixed` Peer + + + +### `getInfo(mixed $id, bool $recursive): \Generator Info object` + +Get info about peer, returns an Info object. + + +Parameters: +* `$id`: `mixed` Peer +* `$recursive`: `bool` Internal + + +Return value: Info object + +Fully typed return value: +``` +\Generator|array, mixed, array{InputPeer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}, Peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}, DialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, NotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputDialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputNotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, bot_api_id: int|string, user_id?: int, chat_id?: int, channel_id?: int, InputUser?: array{_: string, user_id?: int, access_hash?: mixed, min?: bool}, InputChannel?: array{_: string, channel_id: int, access_hash: mixed, min: bool}, type: string}> +``` +#### See also: +* [https://docs.madelineproto.xyz/Info.html](https://docs.madelineproto.xyz/Info.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `fullChatLastUpdated(mixed $id): \Generator` + +When were full info for this chat last cached. + + +Parameters: +* `$id`: `mixed` Chat ID + + +#### See also: +* `\Generator` + + + + +### `getFullInfo(mixed $id): \Generator FullInfo object` + +Get full info about peer, returns an FullInfo object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: FullInfo object + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [https://docs.madelineproto.xyz/FullInfo.html](https://docs.madelineproto.xyz/FullInfo.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `getPwrChat(mixed $id): \Generator Chat object` + +Get full info about peer (including full list of channel members), returns a Chat object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: Chat object + +#### See also: +* [https://docs.madelineproto.xyz/Chat.html](https://docs.madelineproto.xyz/Chat.html) + + + + +### `resolveUsername(string $username): \Generator` + +Resolve username (use getInfo instead). + + +Parameters: +* `$username`: `string` Username + + +#### See also: +* `\Generator` + + + + +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\Http\Client\Response` +* `\danog\MadelineProto\Stream\StreamInterface` +* `\Generator` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator, mixed, array{_: string, id: string, parts: int, name: string, mime_type: string, key_fingerprint?: mixed, key?: mixed, iv?: mixed, md5_checksum: string}> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFileInfo(mixed $constructor): \Generator` + +Get info about file. + + +Parameters: +* `$constructor`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `getPropicInfo(mixed $messageMedia): \Generator` + +Get download info of the propic of a user +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `extractBotAPIFile(array $info): ?array` + +Extract file info from bot API message. + + +Parameters: +* `$info`: `array` Bot API message object + + + +### `getDownloadInfo(mixed $messageMedia): \Generator` + +Get download info of file +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|array|bool|mixed, mixed, false|string> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Generator` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|array|bool|mixed, mixed, false|string> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Generator` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Generator` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Generator|\Amp\Promise|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Generator` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\danog\MadelineProto\Stream\StreamInterface` +* `\Generator` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\danog\MadelineProto\Stream\StreamInterface` +* `\Generator` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* `\Amp\Promise` +* `\danog\MadelineProto\Stream\StreamInterface` +* `\Generator` + + + + +### `acceptSecretChat(array $params): \Generator` + +Accept secret chat. + + +Parameters: +* `$params`: `array` Secret chat ID + + +#### See also: +* `\Generator` + + + + +### `requestSecretChat(mixed $user): \Generator` + +Request secret chat. + + +Parameters: +* `$user`: `mixed` User to start secret chat with + + +#### See also: +* `\Generator` + + + + +### `rekey(int $chat): \Generator` + +Rekey secret chat. + + +Parameters: +* `$chat`: `int` Secret chat to rekey + + +#### See also: +* `\Generator` + + + + +### `secretChatStatus(int $chat): \int One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY` + +Get secret chat status. + + +Parameters: +* `$chat`: `int` Chat ID + + +Return value: One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY + + +### `getSecretChat(array|int $chat): array` + +Get secret chat. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + + +### `hasSecretChat(array|int $chat): bool` + +Check whether secret chat exists. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + + +### `discardSecretChat(int $chat): \Generator` + +Discard secret chat. + + +Parameters: +* `$chat`: `int` Secret chat ID + + +#### See also: +* `\Generator` + + + + +### `mbStrlen(string $text): float|int` + +Get Telegram UTF-8 length of string. + + +Parameters: +* `$text`: `string` Text + + + +### `mbSubstr(string $text, int $offset, ?int $length): string` + +Telegram UTF-8 multibyte substring. + + +Parameters: +* `$text`: `string` Text to substring +* `$offset`: `int` Offset +* `$length`: `?int` Length + + + +### `mbStrSplit(string $text, int $length): array` + +Telegram UTF-8 multibyte split. + + +Parameters: +* `$text`: `string` Text +* `$length`: `int` Length + + + +### `MTProtoToBotAPI(array $data): \Generator` + +Convert MTProto parameters to bot API parameters. + + +Parameters: +* `$data`: `array` Data + + +#### See also: +* `\Generator` + + + + +### `botAPIToMTProto(array $arguments): \Generator` + +Convert bot API parameters to MTProto parameters. + + +Parameters: +* `$arguments`: `array` Arguments + + +#### See also: +* `\Generator` + + + + +### `unpackFileId(string $fileId): \array Unpacked file ID` + +Unpack bot API file ID. + + +Parameters: +* `$fileId`: `string` Bot API file ID + + +Return value: Unpacked file ID + + +### `tdcliToTd(array $params, array $key): array` + +Convert tdcli parameters to tdcli. + + +Parameters: +* `$params`: `array` Params +* `$key`: `array` Key + + + +### `tdToMTProto(array $params): \Generator` + +Convert TD to MTProto parameters. + + +Parameters: +* `$params`: `array` Parameters + + +#### See also: +* `\Generator` + + + + +### `MTProtoToTdcli(mixed $params): \Generator` + +MTProto to TDCLI params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Generator` + + + + +### `MTProtoToTd(mixed $params): \Generator` + +MTProto to TD params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Generator` + + + + +### `tdToTdcli(mixed $params): mixed` + +Convert TD parameters to tdcli. + + +Parameters: +* `$params`: `mixed` Parameters + + + +### `requestCall(mixed $user): \Generator` + +Request VoIP call. + + +Parameters: +* `$user`: `mixed` User + + +#### See also: +* `\Generator` + + + + +### `acceptCall(array $call): \Generator` + +Accept call. + + +Parameters: +* `$call`: `array` Call + + +#### See also: +* `\Generator` + + + + +### `confirmCall(array $params): \Generator` + +Confirm call. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Generator` + + + + +### `completeCall(array $params): \Generator` + +Complete call handshake. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Generator` + + + + +### `callStatus(int $id): int` + +Get call status. + + +Parameters: +* `$id`: `int` Call ID + + + +### `getCall(int $call): array` + +Get call info. + + +Parameters: +* `$call`: `int` Call ID + + + +### `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Generator` + +Discard call. + + +Parameters: +* `$call`: `array` Call +* `$reason`: `array` +* `$rating`: `array` Rating +* `$need_debug`: `bool` Need debug? + + +#### See also: +* `\Generator` + + + + +### `getDialogs(bool $force): \Generator` + +Get dialog peers. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +Fully typed return value: +``` +\Generator, mixed, list> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFullDialogs(bool $force): \Generator` + +Get full info of all dialogs. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +#### See also: +* `\Generator` + + + + +### `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Generator` + +Set event handler. + + +Parameters: +* `$eventHandler`: `class-string<\danog\MadelineProto\EventHandler>` Event handler + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Generator` + + + + +### `unsetEventHandler(bool $disableUpdateHandling): void` + +Unset event handler. + + +Parameters: +* `$disableUpdateHandling`: `bool` Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler) + + + +### `getEventHandler(): \danog\MadelineProto\EventHandler` + +Get event handler. + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) + + + + +### `hasEventHandler(): bool` + +Check if an event handler instance is present. + + + +### `setWebhook(string $hook_url, string $pem_path): void` + +Set webhook update handler. + + +Parameters: +* `$hook_url`: `string` Webhook URL +* `$pem_path`: `string` PEM path for self-signed certificate + + + +### `setCallback(callable $callback): void` + +Set update handling callback. + + +Parameters: +* `$callback`: `callable` Callback + + + +### `logout(): \Generator` + +Log out currently logged in user. + + +#### See also: +* `\Generator` + + + + +### `botLogin(string $token): \Generator` + +Login as bot. + + +Parameters: +* `$token`: `string` Bot token + + +#### See also: +* `\Generator` + + + + +### `phoneLogin(string $number, int $sms_type): \Generator` + +Login as user. + + +Parameters: +* `$number`: `string` Phone number +* `$sms_type`: `int` SMS type + + +#### See also: +* `\Generator` + + + + +### `completePhoneLogin(string $code): \Generator` + +Complet user login using login code. + + +Parameters: +* `$code`: `string` Login code + + +#### See also: +* `\Generator` + + + + +### `importAuthorization(mixed $authorization): \Generator` + +Import authorization. + + +Parameters: +* `$authorization`: `mixed` Authorization info + + +#### See also: +* `\Generator` + + + + +### `exportAuthorization(): \Generator` + +Export authorization. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Generator` + + + + +### `completeSignup(string $first_name, string $last_name): \Generator` + +Complete signup to Telegram. + + +Parameters: +* `$first_name`: `string` First name +* `$last_name`: `string` Last name + + +#### See also: +* `\Generator` + + + + +### `complete2faLogin(string $password): \Generator` + +Complete 2FA login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Generator` + + + + +### `update2fa(array $params): \Generator` + +Update the 2FA password. +The params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` The params + + +#### See also: +* `\Generator` + + + + +### `initSelfRestart(): void` + +Initialize self-restart hack. + + + +### `loop(callable|null $callback): \Generator` + +Start MadelineProto's update handling loop, or run the provided async callable. + + +Parameters: +* `$callback`: `callable|null` Async callable to run + + +#### See also: +* `\Generator` + + + + +### `stop(): void` + +Stop update loop. + + + +### `restart(): void` + +Restart update loop. + + + +### `loopFork(): \Amp\Promise` + +Start MadelineProto's update handling loop in background. + + +#### See also: +* `\Amp\Promise` + + + + +### `closeConnection(string $message): void` + +Close connection with client, connected via web. + + +Parameters: +* `$message`: `string` Message + + + +### `setNoop(): void` + +Set NOOP update handler, ignoring all updates. + + + +### `start(): \Generator` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Generator` + + + + +### `getWebTemplate(): string` + +Get web template. + + + +### `setWebTemplate(string $template): void` + +Set web template. + + +Parameters: +* `$template`: `string` Template + + + +### `checkTos(): \Generator` + +Check for terms of service update. + + +#### See also: +* `\Generator` + + + + +### `acceptTos(): \Generator` + +Accept terms of service update. + + +#### See also: +* `\Generator` + + + + +### `declineTos(): \Generator` + +Decline terms of service update. +THIS WILL DELETE YOUR ACCOUNT! + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProto/AuthKey.md b/docs/PHP/danog/MadelineProto/MTProto/AuthKey.md new file mode 100644 index 00000000..d1c74d53 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProto/AuthKey.md @@ -0,0 +1,96 @@ +--- +title: danog\MadelineProto\MTProto\AuthKey: MTProto auth key. +description: + +--- +# `danog\MadelineProto\MTProto\AuthKey` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MTProto auth key. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setAuthKey(string $authKey): void` +* `hasAuthKey(): bool` +* `getAuthKey(): string` +* `getID(): string` +* `setServerSalt(string $salt): void` +* `getServerSalt(): string` +* `hasServerSalt(): bool` +* `isAuthorized(): bool` +* `authorized(bool $authorized): void` + +## Methods: +### `setAuthKey(string $authKey): void` + +Set auth key. + + +Parameters: +* `$authKey`: `string` Authorization key + + + +### `hasAuthKey(): bool` + +Check if auth key is present. + + + +### `getAuthKey(): string` + +Get auth key. + + + +### `getID(): string` + +Get auth key ID. + + + +### `setServerSalt(string $salt): void` + +Set server salt. + + +Parameters: +* `$salt`: `string` Server salt + + + +### `getServerSalt(): string` + +Get server salt. + + + +### `hasServerSalt(): bool` + +Check if has server salt. + + + +### `isAuthorized(): bool` + +Check if we are logged in. + + + +### `authorized(bool $authorized): void` + +Set the authorized boolean. + + +Parameters: +* `$authorized`: `bool` Whether we are authorized + + + diff --git a/docs/PHP/danog/MadelineProto/MTProto/PermAuthKey.md b/docs/PHP/danog/MadelineProto/MTProto/PermAuthKey.md new file mode 100644 index 00000000..8ffafa53 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProto/PermAuthKey.md @@ -0,0 +1,103 @@ +--- +title: danog\MadelineProto\MTProto\PermAuthKey: MTProto permanent auth key. +description: + +--- +# `danog\MadelineProto\MTProto\PermAuthKey` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MTProto permanent auth key. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `isAuthorized(): bool` +* `authorized(bool $authorized): void` +* `jsonSerialize(): array` +* `setAuthKey(string $authKey): void` +* `hasAuthKey(): bool` +* `getAuthKey(): string` +* `getID(): string` +* `setServerSalt(string $salt): void` +* `getServerSalt(): string` +* `hasServerSalt(): bool` + +## Methods: +### `isAuthorized(): bool` + +Check if we are logged in. + + + +### `authorized(bool $authorized): void` + +Set the authorized boolean. + + +Parameters: +* `$authorized`: `bool` Whether we are authorized + + + +### `jsonSerialize(): array` + +JSON serialization function. + + + +### `setAuthKey(string $authKey): void` + +Set auth key. + + +Parameters: +* `$authKey`: `string` Authorization key + + + +### `hasAuthKey(): bool` + +Check if auth key is present. + + + +### `getAuthKey(): string` + +Get auth key. + + + +### `getID(): string` + +Get auth key ID. + + + +### `setServerSalt(string $salt): void` + +Set server salt. + + +Parameters: +* `$salt`: `string` Server salt + + + +### `getServerSalt(): string` + +Get server salt. + + + +### `hasServerSalt(): bool` + +Check if has server salt. + + + diff --git a/docs/PHP/danog/MadelineProto/MTProto/TempAuthKey.md b/docs/PHP/danog/MadelineProto/MTProto/TempAuthKey.md new file mode 100644 index 00000000..65320559 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProto/TempAuthKey.md @@ -0,0 +1,163 @@ +--- +title: danog\MadelineProto\MTProto\TempAuthKey: MTProto temporary auth key. +description: + +--- +# `danog\MadelineProto\MTProto\TempAuthKey` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MTProto temporary auth key. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `init(bool $init): void` +* `isInited(): bool` +* `bind(\danog\MadelineProto\MTProto\PermAuthKey|null $bound, bool $pfs): void` +* `isBound(): bool` +* `isAuthorized(): bool` +* `authorized(bool $authorized): void` +* `expires(int $expires): void` +* `expired(): bool` +* `jsonSerialize(): array` +* `setAuthKey(string $authKey): void` +* `hasAuthKey(): bool` +* `getAuthKey(): string` +* `getID(): string` +* `setServerSalt(string $salt): void` +* `getServerSalt(): string` +* `hasServerSalt(): bool` + +## Methods: +### `init(bool $init): void` + +Init or deinit connection for auth key. + + +Parameters: +* `$init`: `bool` Init or deinit + + + +### `isInited(): bool` + +Check if connection is inited for auth key. + + + +### `bind(\danog\MadelineProto\MTProto\PermAuthKey|null $bound, bool $pfs): void` + +Bind auth key. + + +Parameters: +* `$bound`: `\danog\MadelineProto\MTProto\PermAuthKey|null` Permanent auth key +* `$pfs`: `bool` Whether to bind using PFS + + +#### See also: +* [`\danog\MadelineProto\MTProto\PermAuthKey`: MTProto permanent auth key.](./PermAuthKey.md) + + + + +### `isBound(): bool` + +Check if auth key is bound. + + + +### `isAuthorized(): bool` + +Check if we are logged in. + + + +### `authorized(bool $authorized): void` + +Set the authorized boolean. + + +Parameters: +* `$authorized`: `bool` Whether we are authorized + + + +### `expires(int $expires): void` + +Set expiration date of temporary auth key. + + +Parameters: +* `$expires`: `int` Expiration date + + + +### `expired(): bool` + +Check if auth key has expired. + + + +### `jsonSerialize(): array` + +JSON serialization function. + + + +### `setAuthKey(string $authKey): void` + +Set auth key. + + +Parameters: +* `$authKey`: `string` Authorization key + + + +### `hasAuthKey(): bool` + +Check if auth key is present. + + + +### `getAuthKey(): string` + +Get auth key. + + + +### `getID(): string` + +Get auth key ID. + + + +### `setServerSalt(string $salt): void` + +Set server salt. + + +Parameters: +* `$salt`: `string` Server salt + + + +### `getServerSalt(): string` + +Get server salt. + + + +### `hasServerSalt(): bool` + +Check if has server salt. + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/AckHandler.md b/docs/PHP/danog/MadelineProto/MTProtoSession/AckHandler.md new file mode 100644 index 00000000..7c2d9ef9 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/AckHandler.md @@ -0,0 +1,70 @@ +--- +title: danog\MadelineProto\MTProtoSession\AckHandler: Manages acknowledgement of messages. +description: + +--- +# `danog\MadelineProto\MTProtoSession\AckHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages acknowledgement of messages. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `ackOutgoingMessageId(string|int $message_id): bool` +* `gotResponseForOutgoingMessageId(string|int $message_id): bool` +* `ackIncomingMessageId(string|int $message_id): bool` +* `hasPendingCalls(): bool` +* `getPendingCalls(): array` + +## Methods: +### `ackOutgoingMessageId(string|int $message_id): bool` + +Acknowledge outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message Id + + + +### `gotResponseForOutgoingMessageId(string|int $message_id): bool` + +We have gotten response for outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `ackIncomingMessageId(string|int $message_id): bool` + +Acknowledge incoming message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `hasPendingCalls(): bool` + +Check if there are some pending calls. + + + +### `getPendingCalls(): array` + +Get all pending calls (also clear pending state requests). + + + +## Properties +* `$shared`: `\DataCenterConnection` \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/CallHandler.md b/docs/PHP/danog/MadelineProto/MTProtoSession/CallHandler.md new file mode 100644 index 00000000..91f6075f --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/CallHandler.md @@ -0,0 +1,95 @@ +--- +title: danog\MadelineProto\MTProtoSession\CallHandler: Manages method and object calls. +description: + +--- +# `danog\MadelineProto\MTProtoSession\CallHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages method and object calls. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `methodRecall(string $watcherId, array $args): void` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` +* `objectCall(string $object, array $args, array $aargs): \Generator` + +## Methods: +### `methodRecall(string $watcherId, array $args): void` + +Recall method. + + +Parameters: +* `$watcherId`: `string` Watcher ID for defer +* `$args`: `array` Args + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent (generator). + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `objectCall(string $object, array $args, array $aargs): \Generator` + +Send object and make sure it is asynchronously sent (generator). + + +Parameters: +* `$object`: `string` Object name +* `$args`: `array` Arguments +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler.md b/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler.md new file mode 100644 index 00000000..a081b932 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler.md @@ -0,0 +1,67 @@ +--- +title: danog\MadelineProto\MTProtoSession\MsgIdHandler: Manages message ids. +description: + +--- +# `danog\MadelineProto\MTProtoSession\MsgIdHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages message ids. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `createInstance(\danog\MadelineProto\Connection $session): self` +* `checkMessageId(string $newMessageId, array $aargs): void` +* `generateMessageId(): string` +* `getMaxId(bool $incoming): mixed` + +## Methods: +### `createInstance(\danog\MadelineProto\Connection $session): self` + +Create MsgIdHandler instance. + + +Parameters: +* `$session`: `\danog\MadelineProto\Connection` Session + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](../Connection.md) + + + + +### `checkMessageId(string $newMessageId, array $aargs): void` + +Check validity of given message ID. + + +Parameters: +* `$newMessageId`: `string` New message ID +* `$aargs`: `array` Params + + + +### `generateMessageId(): string` + +Generate outgoing message ID. + + + +### `getMaxId(bool $incoming): mixed` + +Get maximum message ID. + + +Parameters: +* `$incoming`: `bool` Incoming or outgoing message ID + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler32.md b/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler32.md new file mode 100644 index 00000000..35f34310 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler32.md @@ -0,0 +1,74 @@ +--- +title: danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler32: Manages message ids. +description: + +--- +# `danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler32` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Manages message ids. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `checkMessageId(string $newMessageId, array $aargs): void` +* `generateMessageId(): string` +* `getMaxId(bool $incoming): mixed` +* `reset(): void` +* `createInstance(\danog\MadelineProto\Connection $session): self` + +## Methods: +### `checkMessageId(string $newMessageId, array $aargs): void` + +Check validity of given message ID. + + +Parameters: +* `$newMessageId`: `string` New message ID +* `$aargs`: `array` Params + + + +### `generateMessageId(): string` + +Generate message ID. + + + +### `getMaxId(bool $incoming): mixed` + +Get maximum message ID. + + +Parameters: +* `$incoming`: `bool` Incoming or outgoing message ID + + + +### `reset(): void` + +Reset message IDs. + + + +### `createInstance(\danog\MadelineProto\Connection $session): self` + +Create MsgIdHandler instance. + + +Parameters: +* `$session`: `\danog\MadelineProto\Connection` Session + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](../Connection.md) + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler64.md b/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler64.md new file mode 100644 index 00000000..9e8d45de --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler64.md @@ -0,0 +1,67 @@ +--- +title: danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler64: Manages message ids. +description: + +--- +# `danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler64` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Manages message ids. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `checkMessageId(string $newMessageId, array $aargs): void` +* `generateMessageId(): string` +* `getMaxId(bool $incoming): mixed` +* `createInstance(\danog\MadelineProto\Connection $session): self` + +## Methods: +### `checkMessageId(string $newMessageId, array $aargs): void` + +Check validity of given message ID. + + +Parameters: +* `$newMessageId`: `string` New message ID +* `$aargs`: `array` Params + + + +### `generateMessageId(): string` + +Generate message ID. + + + +### `getMaxId(bool $incoming): mixed` + +Get maximum message ID. + + +Parameters: +* `$incoming`: `bool` Incoming or outgoing message ID + + + +### `createInstance(\danog\MadelineProto\Connection $session): self` + +Create MsgIdHandler instance. + + +Parameters: +* `$session`: `\danog\MadelineProto\Connection` Session + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](../Connection.md) + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/Reliable.md b/docs/PHP/danog/MadelineProto/MTProtoSession/Reliable.md new file mode 100644 index 00000000..f95f5980 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/Reliable.md @@ -0,0 +1,38 @@ +--- +title: danog\MadelineProto\MTProtoSession\Reliable: Manages responses. +description: + +--- +# `danog\MadelineProto\MTProtoSession\Reliable` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages responses. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +## Methods: +### `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +Send state info for message IDs. + + +Parameters: +* `$req_msg_id`: `string|int` Message ID of msgs_state_req that initiated this +* `$msg_ids`: `array` Message IDs to send info about + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/ResponseHandler.md b/docs/PHP/danog/MadelineProto/MTProtoSession/ResponseHandler.md new file mode 100644 index 00000000..bf984e78 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/ResponseHandler.md @@ -0,0 +1,45 @@ +--- +title: danog\MadelineProto\MTProtoSession\ResponseHandler: Manages responses. +description: + +--- +# `danog\MadelineProto\MTProtoSession\ResponseHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages responses. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `handleReject(array $request, \Throwable $data): void` +* `handleResponse(): void` + +## Methods: +### `handleReject(array $request, \Throwable $data): void` + +Reject request with exception. + + +Parameters: +* `$request`: `array` Request +* `$data`: `\Throwable` Exception + + +#### See also: +* `\Throwable` + + + + +### `handleResponse(): void` + + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/SeqNoHandler.md b/docs/PHP/danog/MadelineProto/MTProtoSession/SeqNoHandler.md new file mode 100644 index 00000000..1e32d6af --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/SeqNoHandler.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\MTProtoSession\SeqNoHandler: Manages sequence number. +description: + +--- +# `danog\MadelineProto\MTProtoSession\SeqNoHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages sequence number. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/MTProtoSession/Session.md b/docs/PHP/danog/MadelineProto/MTProtoSession/Session.md new file mode 100644 index 00000000..796a8c26 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoSession/Session.md @@ -0,0 +1,204 @@ +--- +title: danog\MadelineProto\MTProtoSession\Session: Manages MTProto session-specific data. +description: + +--- +# `danog\MadelineProto\MTProtoSession\Session` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages MTProto session-specific data. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `resetSession(): void` +* `createSession(): void` +* `backupSession(): array` +* `ackOutgoingMessageId(string|int $message_id): bool` +* `gotResponseForOutgoingMessageId(string|int $message_id): bool` +* `ackIncomingMessageId(string|int $message_id): bool` +* `hasPendingCalls(): bool` +* `getPendingCalls(): array` +* `handleReject(array $request, \Throwable $data): void` +* `handleResponse(): void` +* `methodRecall(string $watcherId, array $args): void` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` +* `objectCall(string $object, array $args, array $aargs): \Generator` +* `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +## Methods: +### `resetSession(): void` + +Reset MTProto session. + + + +### `createSession(): void` + +Create MTProto session if needed. + + + +### `backupSession(): array` + +Backup eventual unsent messages before session deletion. + + + +### `ackOutgoingMessageId(string|int $message_id): bool` + +Acknowledge outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message Id + + + +### `gotResponseForOutgoingMessageId(string|int $message_id): bool` + +We have gotten response for outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `ackIncomingMessageId(string|int $message_id): bool` + +Acknowledge incoming message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `hasPendingCalls(): bool` + +Check if there are some pending calls. + + + +### `getPendingCalls(): array` + +Get all pending calls (also clear pending state requests). + + + +### `handleReject(array $request, \Throwable $data): void` + +Reject request with exception. + + +Parameters: +* `$request`: `array` Request +* `$data`: `\Throwable` Exception + + +#### See also: +* `\Throwable` + + + + +### `handleResponse(): void` + + + + + +### `methodRecall(string $watcherId, array $args): void` + +Recall method. + + +Parameters: +* `$watcherId`: `string` Watcher ID for defer +* `$args`: `array` Args + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent (generator). + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `objectCall(string $object, array $args, array $aargs): \Generator` + +Send object and make sure it is asynchronously sent (generator). + + +Parameters: +* `$object`: `string` Object name +* `$args`: `array` Arguments +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +Send state info for message IDs. + + +Parameters: +* `$req_msg_id`: `string|int` Message ID of msgs_state_req that initiated this +* `$msg_ids`: `array` Message IDs to send info about + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/AuthKeyHandler.md b/docs/PHP/danog/MadelineProto/MTProtoTools/AuthKeyHandler.md new file mode 100644 index 00000000..97fcad52 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/AuthKeyHandler.md @@ -0,0 +1,21 @@ +--- +title: danog\MadelineProto\MTProtoTools\AuthKeyHandler: Manages the creation of the authorization key. +description: https://core.telegram.org/mtproto/auth_key +https://core.telegram.org/mtproto/samples-auth_key + +--- +# `danog\MadelineProto\MTProtoTools\AuthKeyHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages the creation of the authorization key. + +https://core.telegram.org/mtproto/auth_key +https://core.telegram.org/mtproto/samples-auth_key + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). ## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/CallHandler.md b/docs/PHP/danog/MadelineProto/MTProtoTools/CallHandler.md new file mode 100644 index 00000000..4eddbd49 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/CallHandler.md @@ -0,0 +1,89 @@ +--- +title: danog\MadelineProto\MTProtoTools\CallHandler: Manages method and object calls. +description: + +--- +# `danog\MadelineProto\MTProtoTools\CallHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages method and object calls. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `methodCall(string $method, array|\Generator $args, array $aargs): mixed` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +## Methods: +### `methodCall(string $method, array|\Generator $args, array $aargs): mixed` + +Synchronous wrapper for methodCall. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/CombinedUpdatesState.md b/docs/PHP/danog/MadelineProto/MTProtoTools/CombinedUpdatesState.md new file mode 100644 index 00000000..6d176488 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/CombinedUpdatesState.md @@ -0,0 +1,72 @@ +--- +title: danog\MadelineProto\MTProtoTools\CombinedUpdatesState: Stores multiple update states. +description: + +--- +# `danog\MadelineProto\MTProtoTools\CombinedUpdatesState` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Stores multiple update states. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `get(int $channel, array $init): \danog\MadelineProto\MTProtoTools\UpdatesState|\danog\MadelineProto\MTProtoTools\UpdatesState[]` +* `remove(int $channel): void` +* `has(int $channel): bool` +* `syncLoading(int $channel, bool|null $set): bool` + +## Methods: +### `get(int $channel, array $init): \danog\MadelineProto\MTProtoTools\UpdatesState|\danog\MadelineProto\MTProtoTools\UpdatesState[]` + +Get or update multiple parameters. + + +Parameters: +* `$channel`: `int` Channel to get info about (optional, if not provided returns the entire info array) +* `$init`: `array` Parameters to update + + +#### See also: +* `\danog\MadelineProto\MTProtoTools\UpdatesState` + + + + +### `remove(int $channel): void` + +Remove update state. + + +Parameters: +* `$channel`: `int` Channel whose state should be removed + + + +### `has(int $channel): bool` + +Check if update state is present. + + +Parameters: +* `$channel`: `int` Channel ID + + + +### `syncLoading(int $channel, bool|null $set): bool` + +Are we currently busy? + + +Parameters: +* `$channel`: `int` Channel to get info about +* `$set`: `bool|null` Busy flag to set before returning + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/Files.md b/docs/PHP/danog/MadelineProto/MTProtoTools/Files.md new file mode 100644 index 00000000..1cdcbf9d --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/Files.md @@ -0,0 +1,405 @@ +--- +title: danog\MadelineProto\MTProtoTools\Files: Manages upload and download of files. +description: + +--- +# `danog\MadelineProto\MTProtoTools\Files` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages upload and download of files. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` +* `getFileInfo(mixed $constructor): \Generator` +* `getPropicInfo(mixed $messageMedia): \Generator` +* `extractBotAPIFile(array $info): ?array` +* `getDownloadInfo(mixed $messageMedia): \Generator` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +## Methods: +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\Http\Client\Response` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator, mixed, array{_: string, id: string, parts: int, name: string, mime_type: string, key_fingerprint?: mixed, key?: mixed, iv?: mixed, md5_checksum: string}> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFileInfo(mixed $constructor): \Generator` + +Get info about file. + + +Parameters: +* `$constructor`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `getPropicInfo(mixed $messageMedia): \Generator` + +Get download info of the propic of a user +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `extractBotAPIFile(array $info): ?array` + +Extract file info from bot API message. + + +Parameters: +* `$info`: `array` Bot API message object + + + +### `getDownloadInfo(mixed $messageMedia): \Generator` + +Get download info of file +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|array|bool|mixed, mixed, false|string> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Generator` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|array|bool|mixed, mixed, false|string> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Generator` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Generator` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Generator|\Amp\Promise|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Generator` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/MinDatabase.md b/docs/PHP/danog/MadelineProto/MTProtoTools/MinDatabase.md new file mode 100644 index 00000000..f9bbc5ce --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/MinDatabase.md @@ -0,0 +1,49 @@ +--- +title: danog\MadelineProto\MTProtoTools\MinDatabase: Manages min peers. +description: + +--- +# `danog\MadelineProto\MTProtoTools\MinDatabase` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages min peers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\MTProtoTools\MinDatabase::SWITCH_CONSTRUCTORS: + +* danog\MadelineProto\MTProtoTools\MinDatabase::CATCH_PEERS: + +* danog\MadelineProto\MTProtoTools\MinDatabase::ORIGINS: + + +## Method list: +* `hasPeer(float|int $id): \Amp\Promise` + +## Methods: +### `hasPeer(float|int $id): \Amp\Promise` + +Check if location info is available for peer. + + +Parameters: +* `$id`: `float|int` Peer ID + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/PasswordCalculator.md b/docs/PHP/danog/MadelineProto/MTProtoTools/PasswordCalculator.md new file mode 100644 index 00000000..d8d7bcc4 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/PasswordCalculator.md @@ -0,0 +1,100 @@ +--- +title: danog\MadelineProto\MTProtoTools\PasswordCalculator: Manages SRP password calculation. +description: + +--- +# `danog\MadelineProto\MTProtoTools\PasswordCalculator` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages SRP password calculation. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `addInfo(array $object): void` +* `createSalt(string $prefix): \string Salt` +* `hashSha256(string $data, string $salt): \string Hash` +* `hashPassword(string $password, string $client_salt, string $server_salt): \string Resulting hash` +* `getCheckPassword(string $password): \array InputCheckPassword object` +* `getPassword(array $params): \array account.updatePasswordSettings parameters` + +## Methods: +### `addInfo(array $object): void` + +Popupate 2FA configuration. + + +Parameters: +* `$object`: `array` 2FA configuration object obtained using account.getPassword + + + +### `createSalt(string $prefix): \string Salt` + +Create a random string (eventually prefixed by the specified string). + + +Parameters: +* `$prefix`: `string` Prefix + + +Return value: Salt + + +### `hashSha256(string $data, string $salt): \string Hash` + +Hash specified data using the salt with SHA256. +The result will be the SHA256 hash of the salt concatenated with the data concatenated with the salt + +Parameters: +* `$data`: `string` Data to hash +* `$salt`: `string` Salt + + +Return value: Hash + + +### `hashPassword(string $password, string $client_salt, string $server_salt): \string Resulting hash` + +Hashes the specified password. + + +Parameters: +* `$password`: `string` Password +* `$client_salt`: `string` Client salt +* `$server_salt`: `string` Server salt + + +Return value: Resulting hash + + +### `getCheckPassword(string $password): \array InputCheckPassword object` + +Get the InputCheckPassword object for checking the validity of a password using account.checkPassword. + + +Parameters: +* `$password`: `string` The password + + +Return value: InputCheckPassword object + + +### `getPassword(array $params): \array account.updatePasswordSettings parameters` + +Get parameters to be passed to the account.updatePasswordSettings to update/set a 2FA password. +The input params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` Input params + + +Return value: account.updatePasswordSettings parameters + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/PeerHandler.md b/docs/PHP/danog/MadelineProto/MTProtoTools/PeerHandler.md new file mode 100644 index 00000000..a242b328 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/PeerHandler.md @@ -0,0 +1,214 @@ +--- +title: danog\MadelineProto\MTProtoTools\PeerHandler: Manages peers. +description: + +--- +# `danog\MadelineProto\MTProtoTools\PeerHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages peers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `toSupergroup(int $id): float|int` +* `fromSupergroup(int $id): float|int` +* `isSupergroup(int $id): bool` +* `addUser(array $user): \Generator` +* `peerIsset(mixed $id): \Generator` +* `getFolderId(mixed $id): ?int` +* `getId(mixed $id): int` +* `getInfo(mixed $id, bool $recursive): \Generator Info object` +* `fullChatLastUpdated(mixed $id): \Generator` +* `getFullInfo(mixed $id): \Generator FullInfo object` +* `getPwrChat(mixed $id): \Generator Chat object` +* `resolveUsername(string $username): \Generator` + +## Methods: +### `toSupergroup(int $id): float|int` + +Convert MTProto channel ID to bot API channel ID. + + +Parameters: +* `$id`: `int` MTProto channel ID + + + +### `fromSupergroup(int $id): float|int` + +Convert bot API channel ID to MTProto channel ID. + + +Parameters: +* `$id`: `int` Bot API channel ID + + + +### `isSupergroup(int $id): bool` + +Check whether provided bot API ID is a channel. + + +Parameters: +* `$id`: `int` Bot API ID + + + +### `addUser(array $user): \Generator` + +Add user info. + + +Parameters: +* `$user`: `array` User info + + +#### See also: +* `\Generator` + + + + +### `peerIsset(mixed $id): \Generator` + +Check if peer is present in internal peer database. + + +Parameters: +* `$id`: `mixed` Peer + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFolderId(mixed $id): ?int` + +Get folder ID from object. + + +Parameters: +* `$id`: `mixed` Object + + + +### `getId(mixed $id): int` + +Get bot API ID from peer object. + + +Parameters: +* `$id`: `mixed` Peer + + + +### `getInfo(mixed $id, bool $recursive): \Generator Info object` + +Get info about peer, returns an Info object. + + +Parameters: +* `$id`: `mixed` Peer +* `$recursive`: `bool` Internal + + +Return value: Info object + +Fully typed return value: +``` +\Generator|array, mixed, array{InputPeer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}, Peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}, DialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, NotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputDialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputNotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, bot_api_id: int|string, user_id?: int, chat_id?: int, channel_id?: int, InputUser?: array{_: string, user_id?: int, access_hash?: mixed, min?: bool}, InputChannel?: array{_: string, channel_id: int, access_hash: mixed, min: bool}, type: string}> +``` +#### See also: +* [https://docs.madelineproto.xyz/Info.html](https://docs.madelineproto.xyz/Info.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `fullChatLastUpdated(mixed $id): \Generator` + +When were full info for this chat last cached. + + +Parameters: +* `$id`: `mixed` Chat ID + + +#### See also: +* `\Generator` + + + + +### `getFullInfo(mixed $id): \Generator FullInfo object` + +Get full info about peer, returns an FullInfo object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: FullInfo object + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [https://docs.madelineproto.xyz/FullInfo.html](https://docs.madelineproto.xyz/FullInfo.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `getPwrChat(mixed $id): \Generator Chat object` + +Get full info about peer (including full list of channel members), returns a Chat object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: Chat object + +#### See also: +* [https://docs.madelineproto.xyz/Chat.html](https://docs.madelineproto.xyz/Chat.html) + + + + +### `resolveUsername(string $username): \Generator` + +Resolve username (use getInfo instead). + + +Parameters: +* `$username`: `string` Username + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/ReferenceDatabase.md b/docs/PHP/danog/MadelineProto/MTProtoTools/ReferenceDatabase.md new file mode 100644 index 00000000..0cead3c2 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/ReferenceDatabase.md @@ -0,0 +1,49 @@ +--- +title: danog\MadelineProto\MTProtoTools\ReferenceDatabase: Manages upload and download of files. +description: + +--- +# `danog\MadelineProto\MTProtoTools\ReferenceDatabase` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages upload and download of files. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::DOCUMENT_LOCATION: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::PHOTO_LOCATION: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::PHOTO_LOCATION_LOCATION: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::USER_PHOTO_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::PEER_PHOTO_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::STICKER_SET_ID_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::MESSAGE_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::SAVED_GIFS_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::STICKER_SET_RECENT_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::STICKER_SET_FAVED_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::STICKER_SET_EMOTICON_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::WALLPAPER_ORIGIN: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::LOCATION_CONTEXT: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::METHOD_CONTEXT: + +* danog\MadelineProto\MTProtoTools\ReferenceDatabase::CONSTRUCTOR_CONTEXT: + diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/ResponseInfo.md b/docs/PHP/danog/MadelineProto/MTProtoTools/ResponseInfo.md new file mode 100644 index 00000000..375fb76f --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/ResponseInfo.md @@ -0,0 +1,77 @@ +--- +title: danog\MadelineProto\MTProtoTools\ResponseInfo: Obtain response information for file to server. +description: + +--- +# `danog\MadelineProto\MTProtoTools\ResponseInfo` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Obtain response information for file to server. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `parseHeaders(string $method, array $headers, array $messageMedia): self` +* `getCodeExplanation(): string` +* `shouldServe(): \bool Whether to serve file` +* `getServeRange(): \array HTTP serving range` +* `getCode(): \int HTTP response code` +* `getHeaders(): \array Header array` + +## Methods: +### `parseHeaders(string $method, array $headers, array $messageMedia): self` + +Parse headers. + + +Parameters: +* `$method`: `string` HTTP method +* `$headers`: `array` HTTP headers +* `$messageMedia`: `array` Media info + + + +### `getCodeExplanation(): string` + +Get explanation for HTTP code. + + + +### `shouldServe(): \bool Whether to serve file` + +Whether to serve file. + + +Return value: Whether to serve file + + +### `getServeRange(): \array HTTP serving range` + +Get serving range. + + +Return value: HTTP serving range + + +### `getCode(): \int HTTP response code` + +Get HTTP response code. + + +Return value: HTTP response code + + +### `getHeaders(): \array Header array` + +Get header array. + + +Return value: Header array + + diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/UpdateHandler.md b/docs/PHP/danog/MadelineProto/MTProtoTools/UpdateHandler.md new file mode 100644 index 00000000..7f92d88a --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/UpdateHandler.md @@ -0,0 +1,19 @@ +--- +title: danog\MadelineProto\MTProtoTools\UpdateHandler: Manages updates. +description: + +--- +# `danog\MadelineProto\MTProtoTools\UpdateHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages updates. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). ## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/MTProtoTools/UpdatesState.md b/docs/PHP/danog/MadelineProto/MTProtoTools/UpdatesState.md new file mode 100644 index 00000000..06978d66 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MTProtoTools/UpdatesState.md @@ -0,0 +1,135 @@ +--- +title: danog\MadelineProto\MTProtoTools\UpdatesState: Stores the state of updates. +description: + +--- +# `danog\MadelineProto\MTProtoTools\UpdatesState` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Stores the state of updates. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `isChannel(): bool` +* `getChannel(): int` +* `syncLoading(bool|null $set): bool` +* `update(array $init): self` +* `pts(int $set): \int PTS` +* `qts(int $set): \int QTS` +* `seq(int $set): \int seq` +* `date(int $set): \int Date` +* `checkPts(array $update): \int -1 if it's too old, 0 if it's ok, 1 if it's too new` +* `checkSeq(int $seq): \int -1 if it's too old, 0 if it's ok, 1 if it's too new` + +## Methods: +### `isChannel(): bool` + +Is this state relative to a channel? + + + +### `getChannel(): int` + +Get the channel ID. + + + +### `syncLoading(bool|null $set): bool` + +Are we currently busy? + + +Parameters: +* `$set`: `bool|null` Update the currently busy flag + + + +### `update(array $init): self` + +Update multiple parameters. + + +Parameters: +* `$init`: `array` Parameters to update + + + +### `pts(int $set): \int PTS` + +Get/set PTS. + + +Parameters: +* `$set`: `int` PTS to set + + +Return value: PTS + + +### `qts(int $set): \int QTS` + +Get/set QTS. + + +Parameters: +* `$set`: `int` QTS to set + + +Return value: QTS + + +### `seq(int $set): \int seq` + +Get/set seq. + + +Parameters: +* `$set`: `int` Seq to set + + +Return value: seq + + +### `date(int $set): \int Date` + +Get/set date. + + +Parameters: +* `$set`: `int` Date to set + + +Return value: Date + + +### `checkPts(array $update): \int -1 if it's too old, 0 if it's ok, 1 if it's too new` + +Check validity of PTS contained in update. + + +Parameters: +* `$update`: `array` Update + + +Return value: -1 if it's too old, 0 if it's ok, 1 if it's too new + + +### `checkSeq(int $seq): \int -1 if it's too old, 0 if it's ok, 1 if it's too new` + +Check validity of seq contained in update. + + +Parameters: +* `$seq`: `int` Seq + + +Return value: -1 if it's too old, 0 if it's ok, 1 if it's too new + + diff --git a/docs/PHP/danog/MadelineProto/MyTelegramOrgWrapper.md b/docs/PHP/danog/MadelineProto/MyTelegramOrgWrapper.md new file mode 100644 index 00000000..c9248367 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/MyTelegramOrgWrapper.md @@ -0,0 +1,122 @@ +--- +title: danog\MadelineProto\MyTelegramOrgWrapper: Wrapper for my.telegram.org. +description: + +--- +# `danog\MadelineProto\MyTelegramOrgWrapper` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Wrapper for my.telegram.org. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `login(string $number): \Generator` +* `completeLogin(string $password): \Generator` +* `loggedIn(): bool` +* `hasApp(): \Generator` +* `getApp(): \Generator` +* `createApp(array $settings): \Generator` +* `async(bool $async): void` +* `loop(callable $callable): mixed` + +## Methods: +### `login(string $number): \Generator` + +Login. + + +Parameters: +* `$number`: `string` Phone number + + +#### See also: +* `\Generator` + + + + +### `completeLogin(string $password): \Generator` + +Complete login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Generator` + + + + +### `loggedIn(): bool` + +Whether we are logged in. + + + +### `hasApp(): \Generator` + +Check if an app was already created. + + +#### See also: +* `\Generator` + + + + +### `getApp(): \Generator` + +Get the currently created app. + + +#### See also: +* `\Generator` + + + + +### `createApp(array $settings): \Generator` + +Create an app. + + +Parameters: +* `$settings`: `array` App parameters + + +#### See also: +* `\Generator` + + + + +### `async(bool $async): void` + +Enable or disable async. + + +Parameters: +* `$async`: `bool` Async + + + +### `loop(callable $callable): mixed` + +Run specified callable synchronously. + + +Parameters: +* `$callable`: `callable` Callable + + + diff --git a/docs/PHP/danog/MadelineProto/PTSException.md b/docs/PHP/danog/MadelineProto/PTSException.md new file mode 100644 index 00000000..996a4924 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/PTSException.md @@ -0,0 +1,62 @@ +--- +title: danog\MadelineProto\PTSException: Internal error indicating a problem with Telegram's servers. +description: + +--- +# `danog\MadelineProto\PTSException` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Internal error indicating a problem with Telegram's servers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHP/danog/MadelineProto/PsrLogger.md b/docs/PHP/danog/MadelineProto/PsrLogger.md new file mode 100644 index 00000000..cfd5b591 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/PsrLogger.md @@ -0,0 +1,133 @@ +--- +title: danog\MadelineProto\PsrLogger: PSR-3 wrapper for MadelineProto's Logger. +description: + +--- +# `danog\MadelineProto\PsrLogger` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +PSR-3 wrapper for MadelineProto's Logger. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `log(mixed $level, string $message, array $context): void` +* `emergency(string $message, array $context): void` +* `alert(string $message, array $context): void` +* `critical(string $message, array $context): void` +* `error(string $message, array $context): void` +* `warning(string $message, array $context): void` +* `notice(string $message, array $context): void` +* `info(string $message, array $context): void` +* `debug(string $message, array $context): void` + +## Methods: +### `log(mixed $level, string $message, array $context): void` + +Logs with an arbitrary level. + + +Parameters: +* `$level`: `mixed` +* `$message`: `string` +* `$context`: `array` + + + +### `emergency(string $message, array $context): void` + +System is unusable. + + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `alert(string $message, array $context): void` + +Action must be taken immediately. +Example: Entire website down, database unavailable, etc. This should +trigger the SMS alerts and wake you up. + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `critical(string $message, array $context): void` + +Critical conditions. +Example: Application component unavailable, unexpected exception. + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `error(string $message, array $context): void` + +Runtime errors that do not require immediate action but should typically +be logged and monitored. + + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `warning(string $message, array $context): void` + +Exceptional occurrences that are not errors. +Example: Use of deprecated APIs, poor use of an API, undesirable things +that are not necessarily wrong. + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `notice(string $message, array $context): void` + +Normal but significant events. + + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `info(string $message, array $context): void` + +Interesting events. +Example: User logs in, SQL logs. + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `debug(string $message, array $context): void` + +Detailed debug information. + + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + diff --git a/docs/PHP/danog/MadelineProto/RPCErrorException.md b/docs/PHP/danog/MadelineProto/RPCErrorException.md new file mode 100644 index 00000000..83a68127 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/RPCErrorException.md @@ -0,0 +1,80 @@ +--- +title: danog\MadelineProto\RPCErrorException: Indicates an error returned by Telegram's API. +description: + +--- +# `danog\MadelineProto\RPCErrorException` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Indicates an error returned by Telegram's API. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getLocalization(): string` +* `setLocalization(string $localization): void` +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `getLocalization(): string` + +Get localized error name. + + + +### `setLocalization(string $localization): void` + +Set localized error name. + + +Parameters: +* `$localization`: `string` + + + +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHP/danog/MadelineProto/RSA.md b/docs/PHP/danog/MadelineProto/RSA.md new file mode 100644 index 00000000..7516bcad --- /dev/null +++ b/docs/PHP/danog/MadelineProto/RSA.md @@ -0,0 +1,54 @@ +--- +title: danog\MadelineProto\RSA: RSA class. +description: + +--- +# `danog\MadelineProto\RSA` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +RSA class. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `load(\danog\MadelineProto\TL\TL $TL, string $rsa_key): \Generator` +* `encrypt(string $data): string` + +## Methods: +### `load(\danog\MadelineProto\TL\TL $TL, string $rsa_key): \Generator` + +Load RSA key. + + +Parameters: +* `$TL`: `\danog\MadelineProto\TL\TL` TL serializer +* `$rsa_key`: `string` RSA key + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [`\danog\MadelineProto\TL\TL`: TL serialization.](./TL/TL.md) +* `\Generator` + + + + +### `encrypt(string $data): string` + +Encrypt data. + + +Parameters: +* `$data`: `string` Data to encrypt + + + diff --git a/docs/PHP/danog/MadelineProto/ResponseException.md b/docs/PHP/danog/MadelineProto/ResponseException.md new file mode 100644 index 00000000..c0106bab --- /dev/null +++ b/docs/PHP/danog/MadelineProto/ResponseException.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\ResponseException: Indicates an error thrown when an unexpected response is received from telegram's servers. +description: + +--- +# `danog\MadelineProto\ResponseException` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Indicates an error thrown when an unexpected response is received from telegram's servers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/SecretChats/AuthKeyHandler.md b/docs/PHP/danog/MadelineProto/SecretChats/AuthKeyHandler.md new file mode 100644 index 00000000..0918aeb8 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/SecretChats/AuthKeyHandler.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\SecretChats\AuthKeyHandler: Manages secret chats. +description: https://core.telegram.org/api/end-to-end + +--- +# `danog\MadelineProto\SecretChats\AuthKeyHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages secret chats. + +https://core.telegram.org/api/end-to-end + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `acceptSecretChat(array $params): \Generator` +* `requestSecretChat(mixed $user): \Generator` +* `rekey(int $chat): \Generator` +* `secretChatStatus(int $chat): \int One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY` +* `getSecretChat(array|int $chat): array` +* `hasSecretChat(array|int $chat): bool` +* `discardSecretChat(int $chat): \Generator` + +## Methods: +### `acceptSecretChat(array $params): \Generator` + +Accept secret chat. + + +Parameters: +* `$params`: `array` Secret chat ID + + +#### See also: +* `\Generator` + + + + +### `requestSecretChat(mixed $user): \Generator` + +Request secret chat. + + +Parameters: +* `$user`: `mixed` User to start secret chat with + + +#### See also: +* `\Generator` + + + + +### `rekey(int $chat): \Generator` + +Rekey secret chat. + + +Parameters: +* `$chat`: `int` Secret chat to rekey + + +#### See also: +* `\Generator` + + + + +### `secretChatStatus(int $chat): \int One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY` + +Get secret chat status. + + +Parameters: +* `$chat`: `int` Chat ID + + +Return value: One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY + + +### `getSecretChat(array|int $chat): array` + +Get secret chat. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + + +### `hasSecretChat(array|int $chat): bool` + +Check whether secret chat exists. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + + +### `discardSecretChat(int $chat): \Generator` + +Discard secret chat. + + +Parameters: +* `$chat`: `int` Secret chat ID + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/SecretChats/MessageHandler.md b/docs/PHP/danog/MadelineProto/SecretChats/MessageHandler.md new file mode 100644 index 00000000..b4f797ce --- /dev/null +++ b/docs/PHP/danog/MadelineProto/SecretChats/MessageHandler.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\SecretChats\MessageHandler: Manages packing and unpacking of messages, and the list of sent and received messages. +description: + +--- +# `danog\MadelineProto\SecretChats\MessageHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages packing and unpacking of messages, and the list of sent and received messages. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/SecretChats/ResponseHandler.md b/docs/PHP/danog/MadelineProto/SecretChats/ResponseHandler.md new file mode 100644 index 00000000..e3d49e66 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/SecretChats/ResponseHandler.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\SecretChats\ResponseHandler: Manages responses. +description: + +--- +# `danog\MadelineProto\SecretChats\ResponseHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages responses. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/SecretChats/SeqNoHandler.md b/docs/PHP/danog/MadelineProto/SecretChats/SeqNoHandler.md new file mode 100644 index 00000000..17b6addf --- /dev/null +++ b/docs/PHP/danog/MadelineProto/SecretChats/SeqNoHandler.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\SecretChats\SeqNoHandler: Manages sequence numbers. +description: + +--- +# `danog\MadelineProto\SecretChats\SeqNoHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages sequence numbers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/SecurityException.md b/docs/PHP/danog/MadelineProto/SecurityException.md new file mode 100644 index 00000000..302eaa24 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/SecurityException.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\SecurityException: Indicates a security error. +description: + +--- +# `danog\MadelineProto\SecurityException` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Indicates a security error. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Serialization.md b/docs/PHP/danog/MadelineProto/Serialization.md new file mode 100644 index 00000000..67462f3a --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Serialization.md @@ -0,0 +1,23 @@ +--- +title: danog\MadelineProto\Serialization: Manages serialization of the MadelineProto instance. +description: + +--- +# `danog\MadelineProto\Serialization` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Manages serialization of the MadelineProto instance. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\Serialization::PHP_HEADER: Header for session files. + +* danog\MadelineProto\Serialization::VERSION: Serialization version. + diff --git a/docs/PHP/danog/MadelineProto/SessionPaths.md b/docs/PHP/danog/MadelineProto/SessionPaths.md new file mode 100644 index 00000000..a97f4e6c --- /dev/null +++ b/docs/PHP/danog/MadelineProto/SessionPaths.md @@ -0,0 +1,157 @@ +--- +title: danog\MadelineProto\SessionPaths: Session path information. +description: + +--- +# `danog\MadelineProto\SessionPaths` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Session path information. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `serialize(object $object, string $path): \Generator` +* `unserialize(string $path): \Generator` +* `getLegacySessionPath(): string` +* `getSessionPath(): string` +* `getLockPath(): string` +* `getIpcPath(): string` +* `getIpcStatePath(): string` +* `getIpcState(): \Amp\Promise` +* `storeIpcState(): \Generator` +* `getLightStatePath(): string` +* `getLightState(): \Amp\Promise<\danog\MadelineProto\LightState>` +* `storeLightState(): \Generator` +* `getIpcCallbackPath(): string` + +## Methods: +### `serialize(object $object, string $path): \Generator` + +Serialize object to file. + + +Parameters: +* `$object`: `object` +* `$path`: `string` + + +#### See also: +* `\Generator` + + + + +### `unserialize(string $path): \Generator` + +Deserialize new object. + + +Parameters: +* `$path`: `string` Object path, defaults to session path + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Generator` + + + + +### `getLegacySessionPath(): string` + +Get legacy session path. + + + +### `getSessionPath(): string` + +Get session path. + + + +### `getLockPath(): string` + +Get lock path. + + + +### `getIpcPath(): string` + +Get IPC socket path. + + + +### `getIpcStatePath(): string` + +Get IPC light state path. + + + +### `getIpcState(): \Amp\Promise` + +Get IPC state. + + +#### See also: +* [`\danog\MadelineProto\Ipc\IpcState`: IPC state class.](./Ipc/IpcState.md) +* `\Amp\Promise` + + + + +### `storeIpcState(): \Generator` + +Store IPC state. + + +#### See also: +* `\Generator` + + + + +### `getLightStatePath(): string` + +Get light state path. + + + +### `getLightState(): \Amp\Promise<\danog\MadelineProto\LightState>` + +Get light state. + + +#### See also: +* `\danog\MadelineProto\LightState` +* `\Amp\Promise` + + + + +### `storeLightState(): \Generator` + +Store light state. + + +#### See also: +* `\Generator` + + + + +### `getIpcCallbackPath(): string` + +Get IPC callback socket path. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings.md b/docs/PHP/danog/MadelineProto/Settings.md new file mode 100644 index 00000000..fee04c7e --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings.md @@ -0,0 +1,488 @@ +--- +title: danog\MadelineProto\Settings: Settings class used for configuring MadelineProto. +description: + +--- +# `danog\MadelineProto\Settings` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Settings class used for configuring MadelineProto. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `parseFromLegacy(\danog\MadelineProto\SettingsAbstract|array $settings): \danog\MadelineProto\SettingsAbstract` +* `mergeArray(array $settings): void` +* `merge(\danog\MadelineProto\SettingsAbstract $settings): void` +* `getDefaultDc(): int` +* `getDefaultDcParams(): array` +* `setDefaultDc(int $dc): self` +* `getAppInfo(): \danog\MadelineProto\Settings\AppInfo` +* `setAppInfo(\danog\MadelineProto\Settings\AppInfo $appInfo): self` +* `getAuth(): \danog\MadelineProto\Settings\Auth` +* `setAuth(\danog\MadelineProto\Settings\Auth $auth): self` +* `getConnection(): \danog\MadelineProto\Settings\Connection` +* `setConnection(\danog\MadelineProto\Settings\Connection $connection): self` +* `getFiles(): \danog\MadelineProto\Settings\Files` +* `setFiles(\danog\MadelineProto\Settings\Files $files): self` +* `getLogger(): \danog\MadelineProto\Settings\Logger` +* `setLogger(\danog\MadelineProto\Settings\Logger $logger): self` +* `getPeer(): \danog\MadelineProto\Settings\Peer` +* `setPeer(\danog\MadelineProto\Settings\Peer $peer): self` +* `getPwr(): \danog\MadelineProto\Settings\Pwr` +* `setPwr(\danog\MadelineProto\Settings\Pwr $pwr): self` +* `getRpc(): \danog\MadelineProto\Settings\RPC` +* `setRpc(\danog\MadelineProto\Settings\RPC $rpc): self` +* `getSecretChats(): \danog\MadelineProto\Settings\SecretChats` +* `setSecretChats(\danog\MadelineProto\Settings\SecretChats $secretChats): self` +* `getSerialization(): \danog\MadelineProto\Settings\Serialization` +* `setSerialization(\danog\MadelineProto\Settings\Serialization $serialization): self` +* `getSchema(): \danog\MadelineProto\Settings\TLSchema` +* `setSchema(\danog\MadelineProto\Settings\TLSchema $schema): self` +* `getDb(): \danog\MadelineProto\Settings\DatabaseAbstract` +* `setDb(\danog\MadelineProto\Settings\DatabaseAbstract $db): self` +* `getIpc(): \danog\MadelineProto\Settings\Ipc` +* `setIpc(\danog\MadelineProto\Settings\Ipc $ipc): self` +* `getTemplates(): \danog\MadelineProto\Settings\Templates` +* `setTemplates(\danog\MadelineProto\Settings\Templates $templates): self` +* `hasChanged(): bool` + +## Methods: +### `parseFromLegacy(\danog\MadelineProto\SettingsAbstract|array $settings): \danog\MadelineProto\SettingsAbstract` + +Create settings object from possibly legacy settings array. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract|array` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` + + + + +### `mergeArray(array $settings): void` + +Merge legacy array settings. + + +Parameters: +* `$settings`: `array` Settings + + + +### `merge(\danog\MadelineProto\SettingsAbstract $settings): void` + +Merge another instance of settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` + + + + +### `getDefaultDc(): int` + +Get default DC ID. + + + +### `getDefaultDcParams(): array` + +Get default DC params. + + + +### `setDefaultDc(int $dc): self` + +Set default DC ID. + + +Parameters: +* `$dc`: `int` DC ID + + + +### `getAppInfo(): \danog\MadelineProto\Settings\AppInfo` + +Get app information. + + +#### See also: +* [`\danog\MadelineProto\Settings\AppInfo`: App information.](AppInfo.md) + + + + +### `setAppInfo(\danog\MadelineProto\Settings\AppInfo $appInfo): self` + +Set app information. + + +Parameters: +* `$appInfo`: `\danog\MadelineProto\Settings\AppInfo` App information. + + +#### See also: +* [`\danog\MadelineProto\Settings\AppInfo`: App information.](AppInfo.md) + + + + +### `getAuth(): \danog\MadelineProto\Settings\Auth` + +Get cryptography settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Auth`: Cryptography settings.](Auth.md) + + + + +### `setAuth(\danog\MadelineProto\Settings\Auth $auth): self` + +Set cryptography settings. + + +Parameters: +* `$auth`: `\danog\MadelineProto\Settings\Auth` Cryptography settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Auth`: Cryptography settings.](Auth.md) + + + + +### `getConnection(): \danog\MadelineProto\Settings\Connection` + +Get connection settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Connection`: Connection settings.](Connection.md) + + + + +### `setConnection(\danog\MadelineProto\Settings\Connection $connection): self` + +Set connection settings. + + +Parameters: +* `$connection`: `\danog\MadelineProto\Settings\Connection` Connection settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Connection`: Connection settings.](Connection.md) + + + + +### `getFiles(): \danog\MadelineProto\Settings\Files` + +Get file management settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Files`: File management settings.](Files.md) + + + + +### `setFiles(\danog\MadelineProto\Settings\Files $files): self` + +Set file management settings. + + +Parameters: +* `$files`: `\danog\MadelineProto\Settings\Files` File management settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Files`: File management settings.](Files.md) + + + + +### `getLogger(): \danog\MadelineProto\Settings\Logger` + +Get logger settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Logger`: Logger settings.](Logger.md) + + + + +### `setLogger(\danog\MadelineProto\Settings\Logger $logger): self` + +Set logger settings. + + +Parameters: +* `$logger`: `\danog\MadelineProto\Settings\Logger` Logger settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Logger`: Logger settings.](Logger.md) + + + + +### `getPeer(): \danog\MadelineProto\Settings\Peer` + +Get peer database settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Peer`: Peer database settings.](Peer.md) + + + + +### `setPeer(\danog\MadelineProto\Settings\Peer $peer): self` + +Set peer database settings. + + +Parameters: +* `$peer`: `\danog\MadelineProto\Settings\Peer` Peer database settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Peer`: Peer database settings.](Peer.md) + + + + +### `getPwr(): \danog\MadelineProto\Settings\Pwr` + +Get PWRTelegram settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Pwr`: PWRTelegram settings.](Pwr.md) + + + + +### `setPwr(\danog\MadelineProto\Settings\Pwr $pwr): self` + +Set PWRTelegram settings. + + +Parameters: +* `$pwr`: `\danog\MadelineProto\Settings\Pwr` PWRTelegram settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Pwr`: PWRTelegram settings.](Pwr.md) + + + + +### `getRpc(): \danog\MadelineProto\Settings\RPC` + +Get RPC settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\RPC`: RPC settings.](RPC.md) + + + + +### `setRpc(\danog\MadelineProto\Settings\RPC $rpc): self` + +Set RPC settings. + + +Parameters: +* `$rpc`: `\danog\MadelineProto\Settings\RPC` RPC settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\RPC`: RPC settings.](RPC.md) + + + + +### `getSecretChats(): \danog\MadelineProto\Settings\SecretChats` + +Get secret chat settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\SecretChats`: Secret chat settings.](SecretChats.md) + + + + +### `setSecretChats(\danog\MadelineProto\Settings\SecretChats $secretChats): self` + +Set secret chat settings. + + +Parameters: +* `$secretChats`: `\danog\MadelineProto\Settings\SecretChats` Secret chat settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\SecretChats`: Secret chat settings.](SecretChats.md) + + + + +### `getSerialization(): \danog\MadelineProto\Settings\Serialization` + +Get serialization settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Serialization`: Serialization settings.](Serialization.md) + + + + +### `setSerialization(\danog\MadelineProto\Settings\Serialization $serialization): self` + +Set serialization settings. + + +Parameters: +* `$serialization`: `\danog\MadelineProto\Settings\Serialization` Serialization settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Serialization`: Serialization settings.](Serialization.md) + + + + +### `getSchema(): \danog\MadelineProto\Settings\TLSchema` + +Get TL schema settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\TLSchema`: TL schema settings.](TLSchema.md) + + + + +### `setSchema(\danog\MadelineProto\Settings\TLSchema $schema): self` + +Set TL schema settings. + + +Parameters: +* `$schema`: `\danog\MadelineProto\Settings\TLSchema` TL schema settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\TLSchema`: TL schema settings.](TLSchema.md) + + + + +### `getDb(): \danog\MadelineProto\Settings\DatabaseAbstract` + +Get database settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\DatabaseAbstract`: Base class for storage backends.](DatabaseAbstract.md) + + + + +### `setDb(\danog\MadelineProto\Settings\DatabaseAbstract $db): self` + +Set database settings. + + +Parameters: +* `$db`: `\danog\MadelineProto\Settings\DatabaseAbstract` DatabaseAbstract settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\DatabaseAbstract`: Base class for storage backends.](DatabaseAbstract.md) + + + + +### `getIpc(): \danog\MadelineProto\Settings\Ipc` + +Get IPC server settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Ipc`: IPC server settings.](Ipc.md) + + + + +### `setIpc(\danog\MadelineProto\Settings\Ipc $ipc): self` + +Set IPC server settings. + + +Parameters: +* `$ipc`: `\danog\MadelineProto\Settings\Ipc` IPC server settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Ipc`: IPC server settings.](Ipc.md) + + + + +### `getTemplates(): \danog\MadelineProto\Settings\Templates` + +Get template settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Templates`: Web and CLI template settings for login.](Templates.md) + + + + +### `setTemplates(\danog\MadelineProto\Settings\Templates $templates): self` + +Set template settings. + + +Parameters: +* `$templates`: `\danog\MadelineProto\Settings\Templates` Template settings + + +#### See also: +* [`\danog\MadelineProto\Settings\Templates`: Web and CLI template settings for login.](Templates.md) + + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/AppInfo.md b/docs/PHP/danog/MadelineProto/Settings/AppInfo.md new file mode 100644 index 00000000..6fb4e720 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/AppInfo.md @@ -0,0 +1,161 @@ +--- +title: danog\MadelineProto\Settings\AppInfo: App information. +description: + +--- +# `danog\MadelineProto\Settings\AppInfo` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +App information. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `hasApiInfo(): bool` +* `getApiId(): int` +* `setApiId(int $apiId): self` +* `getApiHash(): string` +* `setApiHash(string $apiHash): self` +* `getDeviceModel(): string` +* `setDeviceModel(string $deviceModel): self` +* `getSystemVersion(): string` +* `setSystemVersion(string $systemVersion): self` +* `getAppVersion(): string` +* `setAppVersion(string $appVersion): self` +* `getLangCode(): string` +* `setLangCode(string $langCode): self` +* `getLangPack(): string` +* `setLangPack(string $langPack): self` +* `hasChanged(): bool` + +## Methods: +### `hasApiInfo(): bool` + +Check if the settings have API ID/hash information. + + + +### `getApiId(): int` + +Get API ID. + + + +### `setApiId(int $apiId): self` + +Set API ID. + + +Parameters: +* `$apiId`: `int` API ID. + + + +### `getApiHash(): string` + +Get API hash. + + + +### `setApiHash(string $apiHash): self` + +Set API hash. + + +Parameters: +* `$apiHash`: `string` API hash. + + + +### `getDeviceModel(): string` + +Get device model. + + + +### `setDeviceModel(string $deviceModel): self` + +Set device model. + + +Parameters: +* `$deviceModel`: `string` Device model. + + + +### `getSystemVersion(): string` + +Get system version. + + + +### `setSystemVersion(string $systemVersion): self` + +Set system version. + + +Parameters: +* `$systemVersion`: `string` System version. + + + +### `getAppVersion(): string` + +Get app version. + + + +### `setAppVersion(string $appVersion): self` + +Set app version. + + +Parameters: +* `$appVersion`: `string` App version. + + + +### `getLangCode(): string` + +Get language code. + + + +### `setLangCode(string $langCode): self` + +Set language code. + + +Parameters: +* `$langCode`: `string` Language code. + + + +### `getLangPack(): string` + +Get language pack. + + + +### `setLangPack(string $langPack): self` + +Set language pack. + + +Parameters: +* `$langPack`: `string` Language pack. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Auth.md b/docs/PHP/danog/MadelineProto/Settings/Auth.md new file mode 100644 index 00000000..bff87f3f --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Auth.md @@ -0,0 +1,100 @@ +--- +title: danog\MadelineProto\Settings\Auth: Cryptography settings. +description: + +--- +# `danog\MadelineProto\Settings\Auth` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Cryptography settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getRsaKeys(): array` +* `setRsaKeys(array $rsaKeys): self` +* `getDefaultTempAuthKeyExpiresIn(): int` +* `setDefaultTempAuthKeyExpiresIn(int $defaultTempAuthKeyExpiresIn): self` +* `getPfs(): bool` +* `setPfs(bool $pfs): self` +* `getMaxAuthTries(): int` +* `setMaxAuthTries(int $maxAuthTries): self` +* `hasChanged(): bool` + +## Methods: +### `getRsaKeys(): array` + +Get MTProto public keys array. + + + +### `setRsaKeys(array $rsaKeys): self` + +Set MTProto public keys array. + + +Parameters: +* `$rsaKeys`: `array` MTProto public keys array. + + + +### `getDefaultTempAuthKeyExpiresIn(): int` + +Get validity period of the binding of temporary and permanent keys. + + + +### `setDefaultTempAuthKeyExpiresIn(int $defaultTempAuthKeyExpiresIn): self` + +Set validity period of the binding of temporary and permanent keys. + + +Parameters: +* `$defaultTempAuthKeyExpiresIn`: `int` Validity period of the binding of temporary and permanent keys. + + + +### `getPfs(): bool` + +Get whether to use PFS. + + + +### `setPfs(bool $pfs): self` + +Set whether to use PFS. + + +Parameters: +* `$pfs`: `bool` Whether to use PFS + + + +### `getMaxAuthTries(): int` + +Get max tries for generating auth key. + + + +### `setMaxAuthTries(int $maxAuthTries): self` + +Set max tries for generating auth key. + + +Parameters: +* `$maxAuthTries`: `int` Max tries for generating auth key + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Connection.md b/docs/PHP/danog/MadelineProto/Settings/Connection.md new file mode 100644 index 00000000..b3da8ed7 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Connection.md @@ -0,0 +1,365 @@ +--- +title: danog\MadelineProto\Settings\Connection: Connection settings. +description: + +--- +# `danog\MadelineProto\Settings\Connection` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Connection settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getProtocol(): string` +* `setProtocol(class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface> $protocol): self` +* `getIpv6(): bool` +* `setIpv6(bool $ipv6): self` +* `getSslSubdomains(): array` +* `setSslSubdomains(array $sslSubdomains): self` +* `getMinMediaSocketCount(): int` +* `setMinMediaSocketCount(int $minMediaSocketCount): self` +* `getMaxMediaSocketCount(): int` +* `setMaxMediaSocketCount(int $maxMediaSocketCount): self` +* `getRobinPeriod(): int` +* `setRobinPeriod(int $robinPeriod): self` +* `getDefaultDc(): int` +* `getDefaultDcParams(): array` +* `setDefaultDc(int $defaultDc): self` +* `getProxies(): array` +* `addProxy(class-string<\danog\MadelineProto\Stream\StreamInterface> $proxy, array $extra): self` +* `setProxy(array $proxies): self` +* `clearProxies(): self` +* `removeProxy(string $proxy, array $extra): self` +* `getObfuscated(): bool` +* `setObfuscated(bool $obfuscated): self` +* `getTestMode(): bool` +* `setTestMode(bool $testMode): self` +* `getTransport(): class-string<\danog\MadelineProto\Stream\RawStreamInterface>` +* `setTransport(class-string<\danog\MadelineProto\Stream\RawStreamInterface> $transport): self` +* `getRetry(): bool` +* `setRetry(bool $retry): self` +* `getTimeout(): int` +* `setTimeout(int $timeout): self` +* `getUseDoH(): bool` +* `setUseDoH(bool $useDoH): self` +* `getBindTo(): ?string` +* `setBindTo(?string $bindTo): self` +* `hasChanged(): bool` + +## Methods: +### `getProtocol(): string` + +Get protocol identifier. + + + +### `setProtocol(class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface> $protocol): self` + +Set protocol identifier. + + +Parameters: +* `$protocol`: `class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface>` Protocol identifier + + +#### See also: +* `\danog\MadelineProto\Stream\MTProtoBufferInterface` + + + + +### `getIpv6(): bool` + +Get whether to use ipv6. + + + +### `setIpv6(bool $ipv6): self` + +Set whether to use ipv6. + + +Parameters: +* `$ipv6`: `bool` Whether to use ipv6 + + + +### `getSslSubdomains(): array` + +Get subdomains of web.telegram.org for https protocol. + + + +### `setSslSubdomains(array $sslSubdomains): self` + +Set subdomains of web.telegram.org for https protocol. + + +Parameters: +* `$sslSubdomains`: `array` Subdomains of web.telegram.org for https protocol. + + + +### `getMinMediaSocketCount(): int` + +Get minimum media socket count. + + + +### `setMinMediaSocketCount(int $minMediaSocketCount): self` + +Set minimum media socket count. + + +Parameters: +* `$minMediaSocketCount`: `int` Minimum media socket count. + + + +### `getMaxMediaSocketCount(): int` + +Get maximum media socket count. + + + +### `setMaxMediaSocketCount(int $maxMediaSocketCount): self` + +Set maximum media socket count. + + +Parameters: +* `$maxMediaSocketCount`: `int` Maximum media socket count. + + + +### `getRobinPeriod(): int` + +Get robin period (seconds). + + + +### `setRobinPeriod(int $robinPeriod): self` + +Set robin period (seconds). + + +Parameters: +* `$robinPeriod`: `int` Robin period (seconds). + + + +### `getDefaultDc(): int` + +Get default DC ID. + + + +### `getDefaultDcParams(): array` + +Get default DC params. + + + +### `setDefaultDc(int $defaultDc): self` + +Set default DC ID. + + +Parameters: +* `$defaultDc`: `int` Default DC ID. + + + +### `getProxies(): array` + +Get proxy identifiers. + + +Fully typed return value: +``` +array, array> +``` +#### See also: +* `\danog\MadelineProto\Stream\StreamInterface` + + + + +### `addProxy(class-string<\danog\MadelineProto\Stream\StreamInterface> $proxy, array $extra): self` + +Add proxy identifier to list. + + +Parameters: +* `$proxy`: `class-string<\danog\MadelineProto\Stream\StreamInterface>` Proxy identifier +* `$extra`: `array` Extra + + +#### See also: +* `\danog\MadelineProto\Stream\StreamInterface` + + + + +### `setProxy(array $proxies): self` + +Set proxies. + + +Parameters: +* `$proxies`: `array` Proxies + + + +### `clearProxies(): self` + +Clear proxies. + + + +### `removeProxy(string $proxy, array $extra): self` + +Remove specific proxy pair. + + +Parameters: +* `$proxy`: `string` +* `$extra`: `array` + + + +### `getObfuscated(): bool` + +Get whether to use the obfuscated protocol. + + + +### `setObfuscated(bool $obfuscated): self` + +Set whether to use the obfuscated protocol. + + +Parameters: +* `$obfuscated`: `bool` Whether to use the obfuscated protocol. + + + +### `getTestMode(): bool` + +Get whether we're in test mode. + + + +### `setTestMode(bool $testMode): self` + +Set whether we're in test mode. + + +Parameters: +* `$testMode`: `bool` Whether we're in test mode. + + + +### `getTransport(): class-string<\danog\MadelineProto\Stream\RawStreamInterface>` + +Get transport identifier. + + +#### See also: +* `\danog\MadelineProto\Stream\RawStreamInterface` + + + + +### `setTransport(class-string<\danog\MadelineProto\Stream\RawStreamInterface> $transport): self` + +Set transport identifier. + + +Parameters: +* `$transport`: `class-string<\danog\MadelineProto\Stream\RawStreamInterface>` Transport identifier. + + +#### See also: +* `\danog\MadelineProto\Stream\RawStreamInterface` + + + + +### `getRetry(): bool` + +Get whether to retry connection. + + + +### `setRetry(bool $retry): self` + +Set whether to retry connection. + + +Parameters: +* `$retry`: `bool` Whether to retry connection. + + + +### `getTimeout(): int` + +Get connection timeout. + + + +### `setTimeout(int $timeout): self` + +Set connection timeout. + + +Parameters: +* `$timeout`: `int` Connection timeout. + + + +### `getUseDoH(): bool` + +Get whether to use DNS over HTTPS. + + + +### `setUseDoH(bool $useDoH): self` + +Set whether to use DNS over HTTPS. + + +Parameters: +* `$useDoH`: `bool` Whether to use DNS over HTTPS + + + +### `getBindTo(): ?string` + +Get bind on specific address and port. + + + +### `setBindTo(?string $bindTo): self` + +Set bind on specific address and port. + + +Parameters: +* `$bindTo`: `?string` Bind on specific address and port. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Database/DatabaseAbstract.md b/docs/PHP/danog/MadelineProto/Settings/Database/DatabaseAbstract.md new file mode 100644 index 00000000..1a59fea7 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Database/DatabaseAbstract.md @@ -0,0 +1,107 @@ +--- +title: danog\MadelineProto\Settings\Database\DatabaseAbstract: Base class for database backends. +description: + +--- +# `danog\MadelineProto\Settings\Database\DatabaseAbstract` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Base class for database backends. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `getDatabase(): string|int` +* `getUri(): string` +* `setDatabase(int|string $database): self` +* `setUri(string $uri): self` +* `hasChanged(): bool` + +## Methods: +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `getDatabase(): string|int` + +Get database name/ID. + + + +### `getUri(): string` + +Get database URI. + + + +### `setDatabase(int|string $database): self` + +Set database name/ID. + + +Parameters: +* `$database`: `int|string` + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Database/Memory.md b/docs/PHP/danog/MadelineProto/Settings/Database/Memory.md new file mode 100644 index 00000000..a48fb690 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Database/Memory.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\Database\Memory: Memory backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\Memory` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Memory backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getCleanup(): bool` +* `setCleanup(bool $cleanup): self` +* `hasChanged(): bool` + +## Methods: +### `getCleanup(): bool` + +Get whether to cleanup the memory before serializing. + + + +### `setCleanup(bool $cleanup): self` + +Set whether to cleanup the memory before serializing. + + +Parameters: +* `$cleanup`: `bool` Whether to cleanup the memory before serializing. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Database/Mysql.md b/docs/PHP/danog/MadelineProto/Settings/Database/Mysql.md new file mode 100644 index 00000000..f7961fa6 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Database/Mysql.md @@ -0,0 +1,161 @@ +--- +title: danog\MadelineProto\Settings\Database\Mysql: MySQL backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\Mysql` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +MySQL backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMaxConnections(): int` +* `setMaxConnections(int $maxConnections): self` +* `getIdleTimeout(): int` +* `setIdleTimeout(int $idleTimeout): self` +* `getDatabase(): string` +* `setDatabase(string $database): self` +* `getUsername(): string` +* `setUsername(string $username): self` +* `getUri(): string` +* `setUri(string $uri): self` +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `hasChanged(): bool` + +## Methods: +### `getMaxConnections(): int` + +Get maximum connection limit. + + + +### `setMaxConnections(int $maxConnections): self` + +Set maximum connection limit. + + +Parameters: +* `$maxConnections`: `int` Maximum connection limit. + + + +### `getIdleTimeout(): int` + +Get idle timeout. + + + +### `setIdleTimeout(int $idleTimeout): self` + +Set idle timeout. + + +Parameters: +* `$idleTimeout`: `int` Idle timeout. + + + +### `getDatabase(): string` + +Get database name. + + + +### `setDatabase(string $database): self` + +Set database name. + + +Parameters: +* `$database`: `string` Database name. + + + +### `getUsername(): string` + +Get username. + + + +### `setUsername(string $username): self` + +Set username. + + +Parameters: +* `$username`: `string` Username. + + + +### `getUri(): string` + +Get database URI. + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` Database URI. + + + +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Database/Postgres.md b/docs/PHP/danog/MadelineProto/Settings/Database/Postgres.md new file mode 100644 index 00000000..c4c7e667 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Database/Postgres.md @@ -0,0 +1,161 @@ +--- +title: danog\MadelineProto\Settings\Database\Postgres: Postgres backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\Postgres` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Postgres backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMaxConnections(): int` +* `setMaxConnections(int $maxConnections): self` +* `getIdleTimeout(): int` +* `setIdleTimeout(int $idleTimeout): self` +* `getDatabase(): string` +* `setDatabase(string $database): self` +* `getUsername(): string` +* `setUsername(string $username): self` +* `getUri(): string` +* `setUri(string $uri): self` +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `hasChanged(): bool` + +## Methods: +### `getMaxConnections(): int` + +Get maximum connection limit. + + + +### `setMaxConnections(int $maxConnections): self` + +Set maximum connection limit. + + +Parameters: +* `$maxConnections`: `int` Maximum connection limit. + + + +### `getIdleTimeout(): int` + +Get idle timeout. + + + +### `setIdleTimeout(int $idleTimeout): self` + +Set idle timeout. + + +Parameters: +* `$idleTimeout`: `int` Idle timeout. + + + +### `getDatabase(): string` + +Get database name. + + + +### `setDatabase(string $database): self` + +Set database name. + + +Parameters: +* `$database`: `string` Database name. + + + +### `getUsername(): string` + +Get username. + + + +### `setUsername(string $username): self` + +Set username. + + +Parameters: +* `$username`: `string` Username. + + + +### `getUri(): string` + +Get database URI. + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` Database URI. + + + +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Database/Redis.md b/docs/PHP/danog/MadelineProto/Settings/Database/Redis.md new file mode 100644 index 00000000..cc45bf4f --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Database/Redis.md @@ -0,0 +1,107 @@ +--- +title: danog\MadelineProto\Settings\Database\Redis: Redis backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\Redis` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Redis backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getDatabase(): int` +* `setDatabase(int $database): self` +* `getUri(): string` +* `setUri(string $uri): self` +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `hasChanged(): bool` + +## Methods: +### `getDatabase(): int` + +Get database number. + + + +### `setDatabase(int $database): self` + +Set database number. + + +Parameters: +* `$database`: `int` Database number. + + + +### `getUri(): string` + +Get database URI. + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` Database URI. + + + +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Database/SqlAbstract.md b/docs/PHP/danog/MadelineProto/Settings/Database/SqlAbstract.md new file mode 100644 index 00000000..6174b9c0 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Database/SqlAbstract.md @@ -0,0 +1,161 @@ +--- +title: danog\MadelineProto\Settings\Database\SqlAbstract: Generic db backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\SqlAbstract` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Generic db backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMaxConnections(): int` +* `setMaxConnections(int $maxConnections): self` +* `getIdleTimeout(): int` +* `setIdleTimeout(int $idleTimeout): self` +* `getDatabase(): string` +* `setDatabase(string $database): self` +* `getUsername(): string` +* `setUsername(string $username): self` +* `getUri(): string` +* `setUri(string $uri): self` +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `hasChanged(): bool` + +## Methods: +### `getMaxConnections(): int` + +Get maximum connection limit. + + + +### `setMaxConnections(int $maxConnections): self` + +Set maximum connection limit. + + +Parameters: +* `$maxConnections`: `int` Maximum connection limit. + + + +### `getIdleTimeout(): int` + +Get idle timeout. + + + +### `setIdleTimeout(int $idleTimeout): self` + +Set idle timeout. + + +Parameters: +* `$idleTimeout`: `int` Idle timeout. + + + +### `getDatabase(): string` + +Get database name. + + + +### `setDatabase(string $database): self` + +Set database name. + + +Parameters: +* `$database`: `string` Database name. + + + +### `getUsername(): string` + +Get username. + + + +### `setUsername(string $username): self` + +Set username. + + +Parameters: +* `$username`: `string` Username. + + + +### `getUri(): string` + +Get database URI. + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` Database URI. + + + +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/DatabaseAbstract.md b/docs/PHP/danog/MadelineProto/Settings/DatabaseAbstract.md new file mode 100644 index 00000000..8ae01a19 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/DatabaseAbstract.md @@ -0,0 +1,28 @@ +--- +title: danog\MadelineProto\Settings\DatabaseAbstract: Base class for storage backends. +description: + +--- +# `danog\MadelineProto\Settings\DatabaseAbstract` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Base class for storage backends. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `hasChanged(): bool` + +## Methods: +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Files.md b/docs/PHP/danog/MadelineProto/Settings/Files.md new file mode 100644 index 00000000..145dade9 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Files.md @@ -0,0 +1,100 @@ +--- +title: danog\MadelineProto\Settings\Files: File management settings. +description: + +--- +# `danog\MadelineProto\Settings\Files` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +File management settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getAllowAutomaticUpload(): bool` +* `setAllowAutomaticUpload(bool $allowAutomaticUpload): self` +* `getUploadParallelChunks(): int` +* `setUploadParallelChunks(int $uploadParallelChunks): self` +* `getDownloadParallelChunks(): int` +* `setDownloadParallelChunks(int $downloadParallelChunks): self` +* `getReportBrokenMedia(): bool` +* `setReportBrokenMedia(bool $reportBrokenMedia): self` +* `hasChanged(): bool` + +## Methods: +### `getAllowAutomaticUpload(): bool` + +Get allow automatic upload of files from file paths present in constructors? + + + +### `setAllowAutomaticUpload(bool $allowAutomaticUpload): self` + +Set allow automatic upload of files from file paths present in constructors? + + +Parameters: +* `$allowAutomaticUpload`: `bool` Allow automatic upload of files from file paths present in constructors? + + + +### `getUploadParallelChunks(): int` + +Get upload parallel chunk count. + + + +### `setUploadParallelChunks(int $uploadParallelChunks): self` + +Set upload parallel chunk count. + + +Parameters: +* `$uploadParallelChunks`: `int` Upload parallel chunk count + + + +### `getDownloadParallelChunks(): int` + +Get download parallel chunk count. + + + +### `setDownloadParallelChunks(int $downloadParallelChunks): self` + +Set download parallel chunk count. + + +Parameters: +* `$downloadParallelChunks`: `int` Download parallel chunk count + + + +### `getReportBrokenMedia(): bool` + +Get whether to report undownloadable media to TSF. + + + +### `setReportBrokenMedia(bool $reportBrokenMedia): self` + +Set whether to report undownloadable media to TSF. + + +Parameters: +* `$reportBrokenMedia`: `bool` Whether to report undownloadable media to TSF + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Ipc.md b/docs/PHP/danog/MadelineProto/Settings/Ipc.md new file mode 100644 index 00000000..9aacc423 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Ipc.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\Ipc: IPC server settings. +description: + +--- +# `danog\MadelineProto\Settings\Ipc` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC server settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getSlow(): bool` +* `setSlow(bool $slow): self` +* `hasChanged(): bool` + +## Methods: +### `getSlow(): bool` + +Get WARNING: this will cause slow startup if enabled. + + + +### `setSlow(bool $slow): self` + +Whether to force full deserialization of instance, without using the IPC server/client. +WARNING: this will cause slow startup if enabled. + +Parameters: +* `$slow`: `bool` WARNING: this will cause slow startup if enabled. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Logger.md b/docs/PHP/danog/MadelineProto/Settings/Logger.md new file mode 100644 index 00000000..bfc3063f --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Logger.md @@ -0,0 +1,92 @@ +--- +title: danog\MadelineProto\Settings\Logger: Logger settings. +description: + +--- +# `danog\MadelineProto\Settings\Logger` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Logger settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getType()` +* `setType(): self` +* `getExtra(): null|callable|string` +* `setExtra(null|callable|string $extra): self` +* `getLevel()` +* `setLevel(): self` +* `getMaxSize(): int` +* `setMaxSize(int $maxSize): self` +* `hasChanged(): bool` + +## Methods: +### `getType()` + +Get $type Logger type. + + + +### `setType(): self` + +Set $type Logger type. + + + +### `getExtra(): null|callable|string` + +Get extra parameter for logger. + + + +### `setExtra(null|callable|string $extra): self` + +Set extra parameter for logger. + + +Parameters: +* `$extra`: `null|callable|string` Extra parameter for logger. + + + +### `getLevel()` + +Get logging level. + + + +### `setLevel(): self` + +Set logging level. + + + +### `getMaxSize(): int` + +Get maximum filesize for logger, in case of file logging. + + + +### `setMaxSize(int $maxSize): self` + +Set maximum filesize for logger, in case of file logging. + + +Parameters: +* `$maxSize`: `int` Maximum filesize for logger, in case of file logging. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Peer.md b/docs/PHP/danog/MadelineProto/Settings/Peer.md new file mode 100644 index 00000000..23ed6b81 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Peer.md @@ -0,0 +1,82 @@ +--- +title: danog\MadelineProto\Settings\Peer: Peer database settings. +description: + +--- +# `danog\MadelineProto\Settings\Peer` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Peer database settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getFullInfoCacheTime(): int` +* `setFullInfoCacheTime(int $fullInfoCacheTime): self` +* `getFullFetch(): bool` +* `setFullFetch(bool $fullFetch): self` +* `getCacheAllPeersOnStartup(): bool` +* `setCacheAllPeersOnStartup(bool $cacheAllPeersOnStartup): self` +* `hasChanged(): bool` + +## Methods: +### `getFullInfoCacheTime(): int` + +Get cache time for full peer information (seconds). + + + +### `setFullInfoCacheTime(int $fullInfoCacheTime): self` + +Set cache time for full peer information (seconds). + + +Parameters: +* `$fullInfoCacheTime`: `int` Cache time for full peer information (seconds). + + + +### `getFullFetch(): bool` + +Get should madeline fetch the full member list of every group it meets? + + + +### `setFullFetch(bool $fullFetch): self` + +Set should madeline fetch the full member list of every group it meets? + + +Parameters: +* `$fullFetch`: `bool` Should madeline fetch the full member list of every group it meets? + + + +### `getCacheAllPeersOnStartup(): bool` + +Get whether to cache all peers on startup for userbots. + + + +### `setCacheAllPeersOnStartup(bool $cacheAllPeersOnStartup): self` + +Set whether to cache all peers on startup for userbots. + + +Parameters: +* `$cacheAllPeersOnStartup`: `bool` Whether to cache all peers on startup for userbots. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Pwr.md b/docs/PHP/danog/MadelineProto/Settings/Pwr.md new file mode 100644 index 00000000..5358a04c --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Pwr.md @@ -0,0 +1,64 @@ +--- +title: danog\MadelineProto\Settings\Pwr: PWRTelegram settings. +description: + +--- +# `danog\MadelineProto\Settings\Pwr` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +PWRTelegram settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getRequests(): bool` +* `setRequests(bool $requests): self` +* `getDbToken(): string` +* `setDbToken(string $dbToken): self` +* `hasChanged(): bool` + +## Methods: +### `getRequests(): bool` + +Get whether to try resolving usernames using PWRTelegram DB. + + + +### `setRequests(bool $requests): self` + +Set whether to try resolving usernames using PWRTelegram DB. + + +Parameters: +* `$requests`: `bool` Whether to try resolving usernames using PWRTelegram DB. + + + +### `getDbToken(): string` + +Get DB token. + + + +### `setDbToken(string $dbToken): self` + +Set DB token. + + +Parameters: +* `$dbToken`: `string` DB token. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/RPC.md b/docs/PHP/danog/MadelineProto/Settings/RPC.md new file mode 100644 index 00000000..b31aad9c --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/RPC.md @@ -0,0 +1,136 @@ +--- +title: danog\MadelineProto\Settings\RPC: RPC settings. +description: + +--- +# `danog\MadelineProto\Settings\RPC` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +RPC settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getRpcTimeout(): int` +* `setRpcTimeout(int $rpcTimeout): self` +* `getFloodTimeout(): int` +* `setFloodTimeout(int $floodTimeout): self` +* `getLimitIncoming(): int` +* `setLimitIncoming(int $limitIncoming): self` +* `getLimitOutgoing(): int` +* `setLimitOutgoing(int $limitOutgoing): self` +* `getLimitCallQueue(): int` +* `setLimitCallQueue(int $limitCallQueue): self` +* `getGzipEncodeIfGt(): int` +* `setGzipEncodeIfGt(int $gzipEncodeIfGt): self` +* `hasChanged(): bool` + +## Methods: +### `getRpcTimeout(): int` + +Get RPC timeout. + + + +### `setRpcTimeout(int $rpcTimeout): self` + +Set RPC timeout. + + +Parameters: +* `$rpcTimeout`: `int` RPC timeout. + + + +### `getFloodTimeout(): int` + +Get flood timeout: if FLOOD_WAIT_ time is bigger than this, throw exception instead of waiting asynchronously. + + + +### `setFloodTimeout(int $floodTimeout): self` + +Set flood timeout: if FLOOD_WAIT_ time is bigger than this, throw exception instead of waiting asynchronously. + + +Parameters: +* `$floodTimeout`: `int` Flood timeout: if FLOOD_WAIT_ time is bigger than this, throw exception instead of waiting asynchronously + + + +### `getLimitIncoming(): int` + +Get maximum number of messages to be stored in the incoming queue. + + + +### `setLimitIncoming(int $limitIncoming): self` + +Set maximum number of messages to be stored in the incoming queue. + + +Parameters: +* `$limitIncoming`: `int` Maximum number of messages to be stored in the incoming queue + + + +### `getLimitOutgoing(): int` + +Get maximum number of messages to be stored in the outgoing queue. + + + +### `setLimitOutgoing(int $limitOutgoing): self` + +Set maximum number of messages to be stored in the outgoing queue. + + +Parameters: +* `$limitOutgoing`: `int` Maximum number of messages to be stored in the outgoing queue + + + +### `getLimitCallQueue(): int` + +Get maximum number of messages to consider when using call queues. + + + +### `setLimitCallQueue(int $limitCallQueue): self` + +Set maximum number of messages to consider when using call queues. + + +Parameters: +* `$limitCallQueue`: `int` Maximum number of messages to consider when using call queues + + + +### `getGzipEncodeIfGt(): int` + +Get encode payload with GZIP if bigger than. + + + +### `setGzipEncodeIfGt(int $gzipEncodeIfGt): self` + +Set encode payload with GZIP if bigger than. + + +Parameters: +* `$gzipEncodeIfGt`: `int` Encode payload with GZIP if bigger than + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/SecretChats.md b/docs/PHP/danog/MadelineProto/Settings/SecretChats.md new file mode 100644 index 00000000..c71f6c4b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/SecretChats.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\SecretChats: Secret chat settings. +description: + +--- +# `danog\MadelineProto\Settings\SecretChats` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Secret chat settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getAccept(): bool|int[]` +* `setAccept(bool|int[] $accept): self` +* `hasChanged(): bool` + +## Methods: +### `getAccept(): bool|int[]` + +Get boolean or array of IDs. + + + +### `setAccept(bool|int[] $accept): self` + +Set boolean or array of IDs. + + +Parameters: +* `$accept`: `bool|int[]` Boolean or array of IDs + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Serialization.md b/docs/PHP/danog/MadelineProto/Settings/Serialization.md new file mode 100644 index 00000000..ad0b767e --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Serialization.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\Serialization: Serialization settings. +description: + +--- +# `danog\MadelineProto\Settings\Serialization` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Serialization settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getInterval(): int` +* `setInterval(int $interval): self` +* `hasChanged(): bool` + +## Methods: +### `getInterval(): int` + +Get serialization interval, in seconds. + + + +### `setInterval(int $interval): self` + +Set serialization interval, in seconds. + + +Parameters: +* `$interval`: `int` Serialization interval, in seconds. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/TLSchema.md b/docs/PHP/danog/MadelineProto/Settings/TLSchema.md new file mode 100644 index 00000000..fc495612 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/TLSchema.md @@ -0,0 +1,132 @@ +--- +title: danog\MadelineProto\Settings\TLSchema: TL schema settings. +description: + +--- +# `danog\MadelineProto\Settings\TLSchema` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TL schema settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `needsUpgrade(): bool` +* `upgrade(): void` +* `getLayer(): int` +* `setLayer(int $layer): self` +* `getMTProtoSchema(): string` +* `setMTProtoSchema(string $MTProtoSchema): self` +* `getAPISchema(): string` +* `setAPISchema(string $APISchema): self` +* `getSecretSchema(): string` +* `setSecretSchema(string $secretSchema): self` +* `getOther(): array` +* `setOther(array $other): self` +* `hasChanged(): bool` + +## Methods: +### `needsUpgrade(): bool` + +Returns whether the TL parser should re-parse the TL schemes. + + + +### `upgrade(): void` + +Signal that scheme was re-parsed. + + + +### `getLayer(): int` + +Get TL layer version. + + + +### `setLayer(int $layer): self` + +Set TL layer version. + + +Parameters: +* `$layer`: `int` TL layer version. + + + +### `getMTProtoSchema(): string` + +Get MTProto schema path. + + + +### `setMTProtoSchema(string $MTProtoSchema): self` + +Set MTProto schema path. + + +Parameters: +* `$MTProtoSchema`: `string` MTProto schema path. + + + +### `getAPISchema(): string` + +Get API schema path. + + + +### `setAPISchema(string $APISchema): self` + +Set API schema path. + + +Parameters: +* `$APISchema`: `string` API schema path. + + + +### `getSecretSchema(): string` + +Get secret schema path. + + + +### `setSecretSchema(string $secretSchema): self` + +Set secret schema path. + + +Parameters: +* `$secretSchema`: `string` Secret schema path. + + + +### `getOther(): array` + +Get the value of other. + + + +### `setOther(array $other): self` + +Set the value of other. + + +Parameters: +* `$other`: `array` + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Settings/Templates.md b/docs/PHP/danog/MadelineProto/Settings/Templates.md new file mode 100644 index 00000000..46b69f48 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Settings/Templates.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\Templates: Web and CLI template settings for login. +description: + +--- +# `danog\MadelineProto\Settings\Templates` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Web and CLI template settings for login. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getHtmlTemplate(): string` +* `setHtmlTemplate(string $htmlTemplate): self` +* `hasChanged(): bool` + +## Methods: +### `getHtmlTemplate(): string` + +Get web template used for querying app information. + + + +### `setHtmlTemplate(string $htmlTemplate): self` + +Set web template used for querying app information. + + +Parameters: +* `$htmlTemplate`: `string` Web template used for querying app information. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHP/danog/MadelineProto/Shutdown.md b/docs/PHP/danog/MadelineProto/Shutdown.md new file mode 100644 index 00000000..ad89b52e --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Shutdown.md @@ -0,0 +1,55 @@ +--- +title: danog\MadelineProto\Shutdown: Class that controls script shutdown. +description: + +--- +# `danog\MadelineProto\Shutdown` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Class that controls script shutdown. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `shutdown(): void` +* `addCallback(callable $callback, null|string $id): int|\string The callback ID` +* `removeCallback(null|string|int $id): \bool true if the callback was removed correctly, false otherwise` + +## Methods: +### `shutdown(): void` + +Function to be called on shutdown. + + + +### `addCallback(callable $callback, null|string $id): int|\string The callback ID` + +Add a callback for script shutdown. + + +Parameters: +* `$callback`: `callable` The callback to set +* `$id`: `null|string` The optional callback ID + + +Return value: The callback ID + + +### `removeCallback(null|string|int $id): \bool true if the callback was removed correctly, false otherwise` + +Remove a callback from the script shutdown callable list. + + +Parameters: +* `$id`: `null|string|int` The optional callback ID + + +Return value: true if the callback was removed correctly, false otherwise + + diff --git a/docs/PHP/danog/MadelineProto/Snitch.md b/docs/PHP/danog/MadelineProto/Snitch.md new file mode 100644 index 00000000..a64b1a1f --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Snitch.md @@ -0,0 +1,38 @@ +--- +title: danog\MadelineProto\Snitch: Snitch. +description: + +--- +# `danog\MadelineProto\Snitch` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Snitch. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* danog\MadelineProto\Snitch::MAX_NO_PHAR_STARTS: Maximum starts without a phar file. + +* danog\MadelineProto\Snitch::MAX_NO_LOG_STARTS: Maximum starts without a logfile. + + +## Method list: +* `logFile(string $file): void` + +## Methods: +### `logFile(string $file): void` + +Snitch on logfile. + + +Parameters: +* `$file`: `string` Logfile + + + diff --git a/docs/PHP/danog/MadelineProto/StrTools.md b/docs/PHP/danog/MadelineProto/StrTools.md new file mode 100644 index 00000000..513fa754 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/StrTools.md @@ -0,0 +1,133 @@ +--- +title: danog\MadelineProto\StrTools: Some tools. +description: + +--- +# `danog\MadelineProto\StrTools` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Some tools. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `markdownEscape(string $hwat): string` +* `typeEscape(string $type): string` +* `methodEscape(string $method): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getMimeFromFile(string $file): string` +* `getMimeFromBuffer(string $buffer): string` + +## Methods: +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/ADNLTransport/ADNLStream.md b/docs/PHP/danog/MadelineProto/Stream/ADNLTransport/ADNLStream.md new file mode 100644 index 00000000..3c87ac4e --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/ADNLTransport/ADNLStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\ADNLTransport\ADNLStream: ADNL stream wrapper. +description: Manages ADNL envelope + +--- +# `danog\MadelineProto\Stream\ADNLTransport\ADNLStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +ADNL stream wrapper. + +Manages ADNL envelope + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Async/Buffer.md b/docs/PHP/danog/MadelineProto/Stream/Async/Buffer.md new file mode 100644 index 00000000..c83c8ce5 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Async/Buffer.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Stream\Async\Buffer: Buffer helper trait. +description: Wraps the asynchronous generator methods with asynchronous promise-based methods + +--- +# `danog\MadelineProto\Stream\Async\Buffer` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Buffer helper trait. + +Wraps the asynchronous generator methods with asynchronous promise-based methods + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Stream/Async/BufferedStream.md b/docs/PHP/danog/MadelineProto/Stream/Async/BufferedStream.md new file mode 100644 index 00000000..4b1f678a --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Async/BufferedStream.md @@ -0,0 +1,54 @@ +--- +title: danog\MadelineProto\Stream\Async\BufferedStream: Buffered stream helper trait. +description: Wraps the asynchronous generator methods with asynchronous promise-based methods + +--- +# `danog\MadelineProto\Stream\Async\BufferedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Buffered stream helper trait. + +Wraps the asynchronous generator methods with asynchronous promise-based methods + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Async/RawStream.md b/docs/PHP/danog/MadelineProto/Stream/Async/RawStream.md new file mode 100644 index 00000000..e229f844 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Async/RawStream.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Stream\Async\RawStream: Raw stream helper trait. +description: Wraps the asynchronous generator methods with asynchronous promise-based methods + +--- +# `danog\MadelineProto\Stream\Async\RawStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Raw stream helper trait. + +Wraps the asynchronous generator methods with asynchronous promise-based methods + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Stream/BufferInterface.md b/docs/PHP/danog/MadelineProto/Stream/BufferInterface.md new file mode 100644 index 00000000..98db2cf8 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/BufferInterface.md @@ -0,0 +1,53 @@ +--- +title: danog\MadelineProto\Stream\BufferInterface: Buffer interface. +description: + +--- +# `danog\MadelineProto\Stream\BufferInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Buffer interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `bufferRead(int $length): \Amp\Promise` +* `bufferWrite(string $data): \Amp\Promise` + +## Methods: +### `bufferRead(int $length): \Amp\Promise` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` How much data to read + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferWrite(string $data): \Amp\Promise` + +Write data asynchronously. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/BufferedProxyStreamInterface.md b/docs/PHP/danog/MadelineProto/Stream/BufferedProxyStreamInterface.md new file mode 100644 index 00000000..b0404107 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/BufferedProxyStreamInterface.md @@ -0,0 +1,124 @@ +--- +title: danog\MadelineProto\Stream\BufferedProxyStreamInterface: Buffered proxy stream interface. +description: + +--- +# `danog\MadelineProto\Stream\BufferedProxyStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Buffered proxy stream interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getName(): string` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `setExtra(mixed $extra): void` + +## Methods: +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +Fully typed return value: +``` +\Amp\Promise<\danog\MadelineProto\Stream\BufferInterface> +``` +#### See also: +* [`\danog\MadelineProto\Stream\BufferInterface`: Buffer interface.](./BufferInterface.md) +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getName(): string` + +Get stream name. +Is supposed to return __CLASS__ + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +Get underlying stream resource. + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](./RawStreamInterface.md) + + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `setExtra(mixed $extra): void` + +Set extra proxy data. + + +Parameters: +* `$extra`: `mixed` Proxy data + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/BufferedStreamInterface.md b/docs/PHP/danog/MadelineProto/Stream/BufferedStreamInterface.md new file mode 100644 index 00000000..7f937ff7 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/BufferedStreamInterface.md @@ -0,0 +1,113 @@ +--- +title: danog\MadelineProto\Stream\BufferedStreamInterface: Buffered stream interface. +description: + +--- +# `danog\MadelineProto\Stream\BufferedStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Buffered stream interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getName(): string` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +Fully typed return value: +``` +\Amp\Promise<\danog\MadelineProto\Stream\BufferInterface> +``` +#### See also: +* [`\danog\MadelineProto\Stream\BufferInterface`: Buffer interface.](./BufferInterface.md) +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getName(): string` + +Get stream name. +Is supposed to return __CLASS__ + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +Get underlying stream resource. + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](./RawStreamInterface.md) + + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Common/BufferedRawStream.md b/docs/PHP/danog/MadelineProto/Stream/Common/BufferedRawStream.md new file mode 100644 index 00000000..bf8fd8f1 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Common/BufferedRawStream.md @@ -0,0 +1,191 @@ +--- +title: danog\MadelineProto\Stream\Common\BufferedRawStream: Buffered raw stream. +description: + +--- +# `danog\MadelineProto\Stream\Common\BufferedRawStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Buffered raw stream. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `disconnect(): void` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `bufferRead(int $length): \Amp\Promise` +* `bufferReadGenerator(int $length): \Generator` +* `bufferWrite(string $data): \Amp\Promise` +* `bufferClear(): string` +* `getSocket(): \Amp\Socket\Socket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getName(): string` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Asynchronously connect to a TCP/TLS server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `disconnect(): void` + +Async close. + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferRead(int $length): \Amp\Promise` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` Amount of data to read + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferReadGenerator(int $length): \Generator` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` Amount of data to read + + +#### See also: +* `\Generator` + + + + +### `bufferWrite(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferClear(): string` + +Get remaining data from buffer. + + + +### `getSocket(): \Amp\Socket\Socket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\Socket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getName(): string` + +Get class name. + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Common/CtrStream.md b/docs/PHP/danog/MadelineProto/Stream/Common/CtrStream.md new file mode 100644 index 00000000..de76c0ef --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Common/CtrStream.md @@ -0,0 +1,181 @@ +--- +title: danog\MadelineProto\Stream\Common\CtrStream: AES CTR stream wrapper. +description: Manages AES CTR encryption/decryption + +--- +# `danog\MadelineProto\Stream\Common\CtrStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +AES CTR stream wrapper. + +Manages AES CTR encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `bufferReadGenerator(\Amp\Promise $promise): \Generator That resolves with a string when the provided promise is resolved and the data is decrypted` +* `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `setExtra(array $data): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `bufferReadGenerator(\Amp\Promise $promise): \Generator That resolves with a string when the provided promise is resolved and the data is decrypted` + +Decrypts read data asynchronously. + + +Parameters: +* `$promise`: `\Amp\Promise` Promise that resolves with a string when new data is available or `null` if the stream has closed. + + +Return value: That resolves with a string when the provided promise is resolved and the data is decrypted + +#### See also: +* `\Amp\Promise` + + + + +### `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `setExtra(array $data): void` + +Set obfuscation keys/IVs. + + +Parameters: +* `$data`: `array` Keys + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Common/HashedBufferedStream.md b/docs/PHP/danog/MadelineProto/Stream/Common/HashedBufferedStream.md new file mode 100644 index 00000000..eec56104 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Common/HashedBufferedStream.md @@ -0,0 +1,249 @@ +--- +title: danog\MadelineProto\Stream\Common\HashedBufferedStream: Hash stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Common\HashedBufferedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Hash stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `startReadHash(): void` +* `checkReadHash(int $after): void` +* `getReadHash(): string` +* `hasReadHash(): bool` +* `startWriteHash(): void` +* `checkWriteHash(int $after): void` +* `getWriteHash(): string` +* `hasWriteHash(): bool` +* `bufferReadGenerator(int $length): \Generator That resolves with a string when the provided promise is resolved and the data is added to the hashing context` +* `setExtra(string $hash): void` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getReadBufferGenerator(int $length): \Generator` +* `getWriteBufferGenerator(int $length): \Generator` +* `bufferRead(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` +* `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `getSocket(): \Amp\Socket\Socket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `startReadHash(): void` + +Enable read hashing. + + + +### `checkReadHash(int $after): void` + +Check the read hash after N bytes are read. + + +Parameters: +* `$after`: `int` The number of bytes to read before checking the hash + + + +### `getReadHash(): string` + +Stop read hashing and get final hash. + + + +### `hasReadHash(): bool` + +Check if we are read hashing. + + + +### `startWriteHash(): void` + +Enable write hashing. + + + +### `checkWriteHash(int $after): void` + +Write the write hash after N bytes are read. + + +Parameters: +* `$after`: `int` The number of bytes to read before writing the hash + + + +### `getWriteHash(): string` + +Stop write hashing and get final hash. + + + +### `hasWriteHash(): bool` + +Check if we are write hashing. + + + +### `bufferReadGenerator(int $length): \Generator That resolves with a string when the provided promise is resolved and the data is added to the hashing context` + +Hashes read data asynchronously. + + +Parameters: +* `$length`: `int` Read and hash $length bytes + + +Return value: That resolves with a string when the provided promise is resolved and the data is added to the hashing context + + +### `setExtra(string $hash): void` + +Set the hash algorithm. + + +Parameters: +* `$hash`: `string` Algorithm name + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `bufferRead(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` + +Reads data from the stream. + + +Return value: Resolves with a string when new data is available or `null` if the stream has closed. + + +### `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `getSocket(): \Amp\Socket\Socket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\Socket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Common/SimpleBufferedRawStream.md b/docs/PHP/danog/MadelineProto/Stream/Common/SimpleBufferedRawStream.md new file mode 100644 index 00000000..d224eb57 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Common/SimpleBufferedRawStream.md @@ -0,0 +1,191 @@ +--- +title: danog\MadelineProto\Stream\Common\SimpleBufferedRawStream: Buffered raw stream. +description: + +--- +# `danog\MadelineProto\Stream\Common\SimpleBufferedRawStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Buffered raw stream. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `bufferReadGenerator(int $length): \Generator` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getName(): string` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `disconnect(): void` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `bufferRead(int $length): \Amp\Promise` +* `bufferWrite(string $data): \Amp\Promise` +* `bufferClear(): string` +* `getSocket(): \Amp\Socket\Socket` + +## Methods: +### `bufferReadGenerator(int $length): \Generator` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` Amount of data to read + + +#### See also: +* `\Generator` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getName(): string` + +Get class name. + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Asynchronously connect to a TCP/TLS server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `disconnect(): void` + +Async close. + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferRead(int $length): \Amp\Promise` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` Amount of data to read + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferWrite(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferClear(): string` + +Get remaining data from buffer. + + + +### `getSocket(): \Amp\Socket\Socket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\Socket` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Common/UdpBufferedStream.md b/docs/PHP/danog/MadelineProto/Stream/Common/UdpBufferedStream.md new file mode 100644 index 00000000..4eae7c72 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Common/UdpBufferedStream.md @@ -0,0 +1,164 @@ +--- +title: danog\MadelineProto\Stream\Common\UdpBufferedStream: UDP stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Common\UdpBufferedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +UDP stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getReadBufferGenerator(int $length): \Generator` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `close(): void` +* `getReadBuffer(int $length): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +Fully typed return value: +``` +\Generator|\Amp\Success> +``` +#### See also: +* `\Amp\Promise` +* `\Amp\Failure` +* `\Amp\Success` +* `\Generator` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `close(): void` + +Close. + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/ConnectionContext.md b/docs/PHP/danog/MadelineProto/Stream/ConnectionContext.md new file mode 100644 index 00000000..a2f72dcb --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/ConnectionContext.md @@ -0,0 +1,318 @@ +--- +title: danog\MadelineProto\Stream\ConnectionContext: Connection context class. +description: Is responsible for maintaining state about a certain connection to a DC. +That includes the Stream chain that is required to use the connection, the connection URI, and other connection-related data. + +--- +# `danog\MadelineProto\Stream\ConnectionContext` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Connection context class. + +Is responsible for maintaining state about a certain connection to a DC. +That includes the Stream chain that is required to use the connection, the connection URI, and other connection-related data. + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setSocketContext(\Amp\Socket\ConnectContext $socketContext): self` +* `getSocketContext(): \Amp\Socket\ConnectContext` +* `setUri(string|\Psr\Http\Message\UriInterface $uri): self` +* `getStringUri(): string` +* `getUri(): \Psr\Http\Message\UriInterface` +* `setCancellationToken(\Amp\CancellationToken $cancellationToken): self` +* `getCancellationToken(): \Amp\CancellationToken` +* `getCtx(): self` +* `setTest(bool $test): self` +* `isTest(): bool` +* `isMedia(): bool` +* `isCDN(): bool` +* `isDns(): bool` +* `setIsDns(bool $isDns): self` +* `secure(bool $secure): self` +* `isSecure(): bool` +* `setDc(string|int $dc): self` +* `getDc(): string|int` +* `getIntDc(): string|int` +* `setIpv6(bool $ipv6): self` +* `getIpv6(): bool` +* `addStream(string $streamName, mixed $extra): self` +* `setReadCallback(callable $callable): void` +* `hasReadCallback(): bool` +* `getReadCallback(): callable` +* `getStreamName(): string` +* `hasStreamName(string $stream): bool` +* `getStream(): \Generator<\danog\MadelineProto\Stream\StreamInterface>` +* `getInputClientProxy(): array` +* `getName(): string` + +## Methods: +### `setSocketContext(\Amp\Socket\ConnectContext $socketContext): self` + +Set the socket context. + + +Parameters: +* `$socketContext`: `\Amp\Socket\ConnectContext` + + +#### See also: +* `\Amp\Socket\ConnectContext` + + + + +### `getSocketContext(): \Amp\Socket\ConnectContext` + +Get the socket context. + + +#### See also: +* `\Amp\Socket\ConnectContext` + + + + +### `setUri(string|\Psr\Http\Message\UriInterface $uri): self` + +Set the connection URI. + + +Parameters: +* `$uri`: `string|\Psr\Http\Message\UriInterface` + + +#### See also: +* `\Psr\Http\Message\UriInterface` + + + + +### `getStringUri(): string` + +Get the URI as a string. + + + +### `getUri(): \Psr\Http\Message\UriInterface` + +Get the URI. + + +#### See also: +* `\Psr\Http\Message\UriInterface` + + + + +### `setCancellationToken(\Amp\CancellationToken $cancellationToken): self` + +Set the cancellation token. + + +Parameters: +* `$cancellationToken`: `\Amp\CancellationToken` + + +#### See also: +* `\Amp\CancellationToken` + + + + +### `getCancellationToken(): \Amp\CancellationToken` + +Get the cancellation token. + + +#### See also: +* `\Amp\CancellationToken` + + + + +### `getCtx(): self` + +Return a clone of the current connection context. + + + +### `setTest(bool $test): self` + +Set the test boolean. + + +Parameters: +* `$test`: `bool` + + + +### `isTest(): bool` + +Whether this is a test connection. + + + +### `isMedia(): bool` + +Whether this is a media connection. + + + +### `isCDN(): bool` + +Whether this is a CDN connection. + + + +### `isDns(): bool` + +Whether this connection context will only be used by the DNS client. + + + +### `setIsDns(bool $isDns): self` + +Whether this connection context will only be used by the DNS client. + + +Parameters: +* `$isDns`: `bool` + + + +### `secure(bool $secure): self` + +Set the secure boolean. + + +Parameters: +* `$secure`: `bool` + + + +### `isSecure(): bool` + +Whether to use TLS with socket connections. + + + +### `setDc(string|int $dc): self` + +Set the DC ID. + + +Parameters: +* `$dc`: `string|int` + + + +### `getDc(): string|int` + +Get the DC ID. + + + +### `getIntDc(): string|int` + +Get the int DC ID. + + + +### `setIpv6(bool $ipv6): self` + +Whether to use ipv6. + + +Parameters: +* `$ipv6`: `bool` + + + +### `getIpv6(): bool` + +Whether to use ipv6. + + + +### `addStream(string $streamName, mixed $extra): self` + +Add a stream to the stream chain. + + +Parameters: +* `$streamName`: `string` + Full type: + ``` + class-string + ``` +* `$extra`: `mixed` + + + +### `setReadCallback(callable $callable): void` + +Set read callback, called every time the socket reads at least a byte. + + +Parameters: +* `$callable`: `callable` Read callback + + + +### `hasReadCallback(): bool` + +Check if a read callback is present. + + + +### `getReadCallback(): callable` + +Get read callback. + + + +### `getStreamName(): string` + +Get the current stream name from the stream chain. + + + +### `hasStreamName(string $stream): bool` + +Check if has stream within stream chain. + + +Parameters: +* `$stream`: `string` Stream name + + + +### `getStream(): \Generator<\danog\MadelineProto\Stream\StreamInterface>` + +Get a stream from the stream chain. + + +#### See also: +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](./StreamInterface.md) +* `\Generator` + + + + +### `getInputClientProxy(): array` + +Get the inputClientProxy proxy MTProto object. + + + +### `getName(): string` + +Get a description "name" of the context. + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/MTProtoBufferInterface.md b/docs/PHP/danog/MadelineProto/Stream/MTProtoBufferInterface.md new file mode 100644 index 00000000..12576990 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/MTProtoBufferInterface.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Stream\MTProtoBufferInterface: MTProto buffer interface, for reading transport MTProto header info. +description: + +--- +# `danog\MadelineProto\Stream\MTProtoBufferInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MTProto buffer interface, for reading transport MTProto header info. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/AbridgedStream.md b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/AbridgedStream.md new file mode 100644 index 00000000..130b182d --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/AbridgedStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\AbridgedStream: Abridged stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\AbridgedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Abridged stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/FullStream.md b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/FullStream.md new file mode 100644 index 00000000..1fa057da --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/FullStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\FullStream: TCP full stream wrapper. +description: Manages obfuscated2 encryption/decryption + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\FullStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +TCP full stream wrapper. + +Manages obfuscated2 encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Stream to use as data source. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/HttpStream.md b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/HttpStream.md new file mode 100644 index 00000000..d929f58d --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/HttpStream.md @@ -0,0 +1,150 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\HttpStream: HTTP stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\HttpStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +HTTP stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `setExtra(array $extra): void` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `setExtra(array $extra): void` + +Set proxy data. + + +Parameters: +* `$extra`: `array` Proxy parameters + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/HttpsStream.md b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/HttpsStream.md new file mode 100644 index 00000000..311a9209 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/HttpsStream.md @@ -0,0 +1,150 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\HttpsStream: HTTPS stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\HttpsStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +HTTPS stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `setExtra(array $extra): void` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `setExtra(array $extra): void` + +Set proxy data. + + +Parameters: +* `$extra`: `array` Proxy parameters + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/IntermediatePaddedStream.md b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/IntermediatePaddedStream.md new file mode 100644 index 00000000..3bd4402b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/IntermediatePaddedStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\IntermediatePaddedStream: TCP Intermediate stream wrapper. +description: Manages obfuscated2 encryption/decryption + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\IntermediatePaddedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +TCP Intermediate stream wrapper. + +Manages obfuscated2 encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/IntermediateStream.md b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/IntermediateStream.md new file mode 100644 index 00000000..2daf2ecf --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/IntermediateStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\IntermediateStream: TCP Intermediate stream wrapper. +description: Manages obfuscated2 encryption/decryption + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\IntermediateStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +TCP Intermediate stream wrapper. + +Manages obfuscated2 encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/ObfuscatedStream.md b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/ObfuscatedStream.md new file mode 100644 index 00000000..ed8c5843 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/MTProtoTransport/ObfuscatedStream.md @@ -0,0 +1,181 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\ObfuscatedStream: Obfuscated2 stream wrapper. +description: Manages obfuscated2 encryption/decryption + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\ObfuscatedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Obfuscated2 stream wrapper. + +Manages obfuscated2 encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `setExtra(void $data): void` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `bufferReadGenerator(\Amp\Promise $promise): \Generator That resolves with a string when the provided promise is resolved and the data is decrypted` +* `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `setExtra(void $data): void` + +Does nothing. + + +Parameters: +* `$data`: `void` Nothing + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `bufferReadGenerator(\Amp\Promise $promise): \Generator That resolves with a string when the provided promise is resolved and the data is decrypted` + +Decrypts read data asynchronously. + + +Parameters: +* `$promise`: `\Amp\Promise` Promise that resolves with a string when new data is available or `null` if the stream has closed. + + +Return value: That resolves with a string when the provided promise is resolved and the data is decrypted + +#### See also: +* `\Amp\Promise` + + + + +### `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Proxy/HttpProxy.md b/docs/PHP/danog/MadelineProto/Stream/Proxy/HttpProxy.md new file mode 100644 index 00000000..0031ed23 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Proxy/HttpProxy.md @@ -0,0 +1,117 @@ +--- +title: danog\MadelineProto\Stream\Proxy\HttpProxy: HTTP proxy stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Proxy\HttpProxy` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +HTTP proxy stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getReadBuffer(int $length): \Amp\Promise` +* `setExtra(array $extra): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `setExtra(array $extra): void` + +Sets proxy data. + + +Parameters: +* `$extra`: `array` Proxy data + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Proxy/SocksProxy.md b/docs/PHP/danog/MadelineProto/Stream/Proxy/SocksProxy.md new file mode 100644 index 00000000..38b7fb28 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Proxy/SocksProxy.md @@ -0,0 +1,117 @@ +--- +title: danog\MadelineProto\Stream\Proxy\SocksProxy: Socks5 stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Proxy\SocksProxy` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Socks5 stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getReadBuffer(int $length): \Amp\Promise` +* `setExtra(array $extra): void` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `setExtra(array $extra): void` + +Sets proxy data. + + +Parameters: +* `$extra`: `array` Proxy data + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/ProxyStreamInterface.md b/docs/PHP/danog/MadelineProto/Stream/ProxyStreamInterface.md new file mode 100644 index 00000000..caaa2280 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/ProxyStreamInterface.md @@ -0,0 +1,32 @@ +--- +title: danog\MadelineProto\Stream\ProxyStreamInterface: Stream proxy interface. +description: + +--- +# `danog\MadelineProto\Stream\ProxyStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Stream proxy interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setExtra(mixed $extra): void` + +## Methods: +### `setExtra(mixed $extra): void` + +Set extra proxy data. + + +Parameters: +* `$extra`: `mixed` Proxy data + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/RawProxyStreamInterface.md b/docs/PHP/danog/MadelineProto/Stream/RawProxyStreamInterface.md new file mode 100644 index 00000000..f7120b05 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/RawProxyStreamInterface.md @@ -0,0 +1,114 @@ +--- +title: danog\MadelineProto\Stream\RawProxyStreamInterface: Raw stream proxy interface. +description: + +--- +# `danog\MadelineProto\Stream\RawProxyStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Raw stream proxy interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `read(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` +* `write(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `end(string $finalData): \Promise Succeeds once the data has been successfully written to the stream.` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `setExtra(mixed $extra): void` + +## Methods: +### `read(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` + +Reads data from the stream. + + +Return value: Resolves with a string when new data is available or `null` if the stream has closed. + +Fully typed return value: +``` +\Promise +``` +#### See also: +* `\Promise` + + + + +### `write(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `end(string $finalData): \Promise Succeeds once the data has been successfully written to the stream.` + +Marks the stream as no longer writable. Optionally writes a final data chunk before. Note that this is not the +same as forcefully closing the stream. This method waits for all pending writes to complete before closing the +stream. Socket streams implementing this interface should only close the writable side of the stream. + + +Parameters: +* `$finalData`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `setExtra(mixed $extra): void` + +Set extra proxy data. + + +Parameters: +* `$extra`: `mixed` Proxy data + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/RawStreamInterface.md b/docs/PHP/danog/MadelineProto/Stream/RawStreamInterface.md new file mode 100644 index 00000000..95f7a629 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/RawStreamInterface.md @@ -0,0 +1,103 @@ +--- +title: danog\MadelineProto\Stream\RawStreamInterface: Raw stream interface. +description: + +--- +# `danog\MadelineProto\Stream\RawStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Raw stream interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `read(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` +* `write(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `end(string $finalData): \Promise Succeeds once the data has been successfully written to the stream.` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `read(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` + +Reads data from the stream. + + +Return value: Resolves with a string when new data is available or `null` if the stream has closed. + +Fully typed return value: +``` +\Promise +``` +#### See also: +* `\Promise` + + + + +### `write(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `end(string $finalData): \Promise Succeeds once the data has been successfully written to the stream.` + +Marks the stream as no longer writable. Optionally writes a final data chunk before. Note that this is not the +same as forcefully closing the stream. This method waits for all pending writes to complete before closing the +stream. Socket streams implementing this interface should only close the writable side of the stream. + + +Parameters: +* `$finalData`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/ReadBufferInterface.md b/docs/PHP/danog/MadelineProto/Stream/ReadBufferInterface.md new file mode 100644 index 00000000..b54eac6c --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/ReadBufferInterface.md @@ -0,0 +1,37 @@ +--- +title: danog\MadelineProto\Stream\ReadBufferInterface: Read buffer interface. +description: + +--- +# `danog\MadelineProto\Stream\ReadBufferInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Read buffer interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `bufferRead(int $length): \Amp\Promise` + +## Methods: +### `bufferRead(int $length): \Amp\Promise` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` How much data to read + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/StreamInterface.md b/docs/PHP/danog/MadelineProto/Stream/StreamInterface.md new file mode 100644 index 00000000..e040cef7 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/StreamInterface.md @@ -0,0 +1,57 @@ +--- +title: danog\MadelineProto\Stream\StreamInterface: Generic stream interface. +description: + +--- +# `danog\MadelineProto\Stream\StreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Generic stream interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Transport/DefaultStream.md b/docs/PHP/danog/MadelineProto/Stream/Transport/DefaultStream.md new file mode 100644 index 00000000..75b3424a --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Transport/DefaultStream.md @@ -0,0 +1,87 @@ +--- +title: danog\MadelineProto\Stream\Transport\DefaultStream: Default stream wrapper. +description: Manages reading data in chunks + +--- +# `danog\MadelineProto\Stream\Transport\DefaultStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Default stream wrapper. + +Manages reading data in chunks + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getStream(): \Amp\Socket\EncryptableSocket` +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `disconnect(): void` +* `close(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `getStream(): \Amp\Socket\EncryptableSocket` + + + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `disconnect(): void` + +Close. + + + +### `close(): void` + +Close. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Transport/PremadeStream.md b/docs/PHP/danog/MadelineProto/Stream/Transport/PremadeStream.md new file mode 100644 index 00000000..ef97b94d --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Transport/PremadeStream.md @@ -0,0 +1,75 @@ +--- +title: danog\MadelineProto\Stream\Transport\PremadeStream: Premade stream wrapper. +description: Manages reading data in chunks + +--- +# `danog\MadelineProto\Stream\Transport\PremadeStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Premade stream wrapper. + +Manages reading data in chunks + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\Socket` +* `setExtra()` + +## Methods: +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `disconnect(): void` + +Async close. + + + +### `getSocket(): \Amp\Socket\Socket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\Socket` + + + + +### `setExtra()` + +{@inheritdoc} + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Transport/WsStream.md b/docs/PHP/danog/MadelineProto/Stream/Transport/WsStream.md new file mode 100644 index 00000000..442799d6 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Transport/WsStream.md @@ -0,0 +1,73 @@ +--- +title: danog\MadelineProto\Stream\Transport\WsStream: Websocket stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Transport\WsStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Websocket stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect()` +* `write(string $data): \Amp\Promise` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect()` + +Async close. + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/Transport/WssStream.md b/docs/PHP/danog/MadelineProto/Stream/Transport/WssStream.md new file mode 100644 index 00000000..24fd27c7 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/Transport/WssStream.md @@ -0,0 +1,73 @@ +--- +title: danog\MadelineProto\Stream\Transport\WssStream: Websocket TLS stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Transport\WssStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Websocket TLS stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect()` +* `write(string $data): \Amp\Promise` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect()` + +Async close. + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHP/danog/MadelineProto/Stream/WriteBufferInterface.md b/docs/PHP/danog/MadelineProto/Stream/WriteBufferInterface.md new file mode 100644 index 00000000..eaf97394 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Stream/WriteBufferInterface.md @@ -0,0 +1,37 @@ +--- +title: danog\MadelineProto\Stream\WriteBufferInterface: Write buffer interface. +description: + +--- +# `danog\MadelineProto\Stream\WriteBufferInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Write buffer interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `bufferWrite(string $data): \Amp\Promise` + +## Methods: +### `bufferWrite(string $data): \Amp\Promise` + +Write data asynchronously. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHP/danog/MadelineProto/TL/Conversion/Exception.md b/docs/PHP/danog/MadelineProto/TL/Conversion/Exception.md new file mode 100644 index 00000000..b79fd07b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TL/Conversion/Exception.md @@ -0,0 +1,62 @@ +--- +title: danog\MadelineProto\TL\Conversion\Exception: TL conversion exception. +description: + +--- +# `danog\MadelineProto\TL\Conversion\Exception` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +TL conversion exception. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHP/danog/MadelineProto/TL/Conversion/Extension.md b/docs/PHP/danog/MadelineProto/TL/Conversion/Extension.md new file mode 100644 index 00000000..1b475cde --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TL/Conversion/Extension.md @@ -0,0 +1,78 @@ +--- +title: danog\MadelineProto\TL\Conversion\Extension: Manages generation of extensions for files. +description: + +--- +# `danog\MadelineProto\TL\Conversion\Extension` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Manages generation of extensions for files. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMimeFromExtension(string $extension, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getMimeFromFile(string $file): string` +* `getMimeFromBuffer(string $buffer): string` + +## Methods: +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + diff --git a/docs/PHP/danog/MadelineProto/TL/Exception.md b/docs/PHP/danog/MadelineProto/TL/Exception.md new file mode 100644 index 00000000..8fecd0e4 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TL/Exception.md @@ -0,0 +1,62 @@ +--- +title: danog\MadelineProto\TL\Exception: TL deserialization exception. +description: + +--- +# `danog\MadelineProto\TL\Exception` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TL deserialization exception. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHP/danog/MadelineProto/TL/PrettyException.md b/docs/PHP/danog/MadelineProto/TL/PrettyException.md new file mode 100644 index 00000000..6e7834e5 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TL/PrettyException.md @@ -0,0 +1,62 @@ +--- +title: danog\MadelineProto\TL\PrettyException: Handle async stack traces. +description: + +--- +# `danog\MadelineProto\TL\PrettyException` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Handle async stack traces. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHP/danog/MadelineProto/TL/TL.md b/docs/PHP/danog/MadelineProto/TL/TL.md new file mode 100644 index 00000000..da3c3b5b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TL/TL.md @@ -0,0 +1,198 @@ +--- +title: danog\MadelineProto\TL\TL: TL serialization. +description: + +--- +# `danog\MadelineProto\TL\TL` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TL serialization. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getSecretLayer(): int` +* `getConstructors(bool $td): \danog\MadelineProto\TL\TLConstructors` +* `getMethods(bool $td): \danog\MadelineProto\TL\TLMethods` +* `getDescriptions(): array` +* `init(\danog\MadelineProto\Settings\TLSchema $files, \danog\MadelineProto\TL\TLCallback[] $objects): void` +* `getMethodNamespaces(): array` +* `getMethodsNamespaced(): array` +* `updateCallbacks(\danog\MadelineProto\TL\TLCallback[] $objects): void` +* `serializeObject(array $type, mixed $object, string $ctx, int $layer): \Generator` +* `serializeMethod(string $method, mixed $arguments): \Generator` +* `getLength(\resource|string $stream, array $type): int` +* `deserialize(string|\resource $stream, array $type): \Generator` + +## Methods: +### `getSecretLayer(): int` + +Get secret chat layer version. + + + +### `getConstructors(bool $td): \danog\MadelineProto\TL\TLConstructors` + +Get constructors. + + +Parameters: +* `$td`: `bool` + + +#### See also: +* `\danog\MadelineProto\TL\TLConstructors` + + + + +### `getMethods(bool $td): \danog\MadelineProto\TL\TLMethods` + +Get methods. + + +Parameters: +* `$td`: `bool` + + +#### See also: +* `\danog\MadelineProto\TL\TLMethods` + + + + +### `getDescriptions(): array` + +Get TL descriptions. + + + +### `init(\danog\MadelineProto\Settings\TLSchema $files, \danog\MadelineProto\TL\TLCallback[] $objects): void` + +Initialize TL parser. + + +Parameters: +* `$files`: `\danog\MadelineProto\Settings\TLSchema` Scheme files +* `$objects`: `\danog\MadelineProto\TL\TLCallback[]` TL Callback objects + + +#### See also: +* [`\danog\MadelineProto\Settings\TLSchema`: TL schema settings.](../Settings/TLSchema.md) +* [`\danog\MadelineProto\TL\TLCallback`: Interface for managing TL serialization callbacks.](./TLCallback.md) + + + + +### `getMethodNamespaces(): array` + +Get TL namespaces. + + + +### `getMethodsNamespaced(): array` + +Get namespaced methods (method => namespace). + + + +### `updateCallbacks(\danog\MadelineProto\TL\TLCallback[] $objects): void` + +Update TL callbacks. + + +Parameters: +* `$objects`: `\danog\MadelineProto\TL\TLCallback[]` TL callbacks + + +#### See also: +* [`\danog\MadelineProto\TL\TLCallback`: Interface for managing TL serialization callbacks.](./TLCallback.md) + + + + +### `serializeObject(array $type, mixed $object, string $ctx, int $layer): \Generator` + +Serialize TL object. + + +Parameters: +* `$type`: `array` TL type definition +* `$object`: `mixed` Object to serialize +* `$ctx`: `string` Context +* `$layer`: `int` Layer version + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Generator` + + + + +### `serializeMethod(string $method, mixed $arguments): \Generator` + +Serialize method. + + +Parameters: +* `$method`: `string` Method name +* `$arguments`: `mixed` Arguments + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, string> +``` +#### See also: +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `getLength(\resource|string $stream, array $type): int` + +Get length of TL payload. + + +Parameters: +* `$stream`: `\resource|string` Stream +* `$type`: `array` Type identifier + + +#### See also: +* `\resource` + + + + +### `deserialize(string|\resource $stream, array $type): \Generator` + +Deserialize TL object. + + +Parameters: +* `$stream`: `string|\resource` Stream +* `$type`: `array` Type identifier + + +#### See also: +* `\resource` +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/TL/TLCallback.md b/docs/PHP/danog/MadelineProto/TL/TLCallback.md new file mode 100644 index 00000000..b5374e56 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TL/TLCallback.md @@ -0,0 +1,64 @@ +--- +title: danog\MadelineProto\TL\TLCallback: Interface for managing TL serialization callbacks. +description: + +--- +# `danog\MadelineProto\TL\TLCallback` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Interface for managing TL serialization callbacks. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMethodCallbacks(): array` +* `getMethodBeforeCallbacks(): array` +* `getConstructorCallbacks(): array` +* `getConstructorBeforeCallbacks(): array` +* `getConstructorSerializeCallbacks(): array` +* `getTypeMismatchCallbacks(): array` + +## Methods: +### `getMethodCallbacks(): array` + +Called after serialization of method. +Pass the method name and arguments + + +### `getMethodBeforeCallbacks(): array` + +Called right before serialization of method starts. +Pass the method name + + +### `getConstructorCallbacks(): array` + +Called right after deserialization of object, passing the final object. + + + +### `getConstructorBeforeCallbacks(): array` + +Called right before deserialization of object. +Pass only the constructor name + + +### `getConstructorSerializeCallbacks(): array` + +Called right before serialization of constructor. +Passed the object, will return a modified version. + + +### `getTypeMismatchCallbacks(): array` + +Called if objects of the specified type cannot be serialized. +Passed the unserializable object, +will try to convert it to an object of the proper type. + + diff --git a/docs/PHP/danog/MadelineProto/TL/Types/Button.md b/docs/PHP/danog/MadelineProto/TL/Types/Button.md new file mode 100644 index 00000000..36daafb6 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TL/Types/Button.md @@ -0,0 +1,84 @@ +--- +title: danog\MadelineProto\TL\Types\Button: Clickable button. +description: + +--- +# `danog\MadelineProto\TL\Types\Button` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Clickable button. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `click(bool $donotwait): mixed` +* `jsonSerialize(): array` +* `offsetSet( $name, mixed $value): void` +* `offsetGet( $name): mixed` +* `offsetUnset( $name): void` +* `offsetExists( $name): bool` + +## Methods: +### `click(bool $donotwait): mixed` + +Click on button. + + +Parameters: +* `$donotwait`: `bool` Whether to wait for the result of the method + + + +### `jsonSerialize(): array` + +Serialize button. + + + +### `offsetSet( $name, mixed $value): void` + +Set button info. + + +Parameters: +* `$name`: `` Offset +* `$value`: `mixed` Value + + + +### `offsetGet( $name): mixed` + +Get button info. + + +Parameters: +* `$name`: `` Field name + + + +### `offsetUnset( $name): void` + +Unset button info. + + +Parameters: +* `$name`: `` Offset + + + +### `offsetExists( $name): bool` + +Check if button field exists. + + +Parameters: +* `$name`: `` Offset + + + diff --git a/docs/PHP/danog/MadelineProto/TL/Types/Bytes.md b/docs/PHP/danog/MadelineProto/TL/Types/Bytes.md new file mode 100644 index 00000000..9a7e2836 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TL/Types/Bytes.md @@ -0,0 +1,73 @@ +--- +title: danog\MadelineProto\TL\Types\Bytes: Bytes wrapper. +description: + +--- +# `danog\MadelineProto\TL\Types\Bytes` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Bytes wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `jsonSerialize(): array` +* `offsetSet(int|null $offset, string $value): void` +* `offsetGet(int $offset): string` +* `offsetUnset(int $offset): void` +* `offsetExists(int $offset): bool` + +## Methods: +### `jsonSerialize(): array` + +Obtain values for JSON-encoding. + + + +### `offsetSet(int|null $offset, string $value): void` + +Set char at offset. + + +Parameters: +* `$offset`: `int|null` Offset +* `$value`: `string` Char + + + +### `offsetGet(int $offset): string` + +Get char at offset. + + +Parameters: +* `$offset`: `int` Name + + + +### `offsetUnset(int $offset): void` + +Unset char at offset. + + +Parameters: +* `$offset`: `int` Offset + + + +### `offsetExists(int $offset): bool` + +Check if char at offset exists. + + +Parameters: +* `$offset`: `int` Offset + + + diff --git a/docs/PHP/danog/MadelineProto/TON/API.md b/docs/PHP/danog/MadelineProto/TON/API.md new file mode 100644 index 00000000..25022c4b --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TON/API.md @@ -0,0 +1,870 @@ +--- +title: danog\MadelineProto\TON\API: TON API. +description: + +--- +# `danog\MadelineProto\TON\API` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TON API. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` +* `all((\Generator|\Promise)[] $promises): \Amp\Promise` +* `any((\Promise|\Generator)[] $promises): \Amp\Promise` +* `arr(mixed $params): array` +* `base64urlDecode(string $data): string` +* `base64urlEncode(string $data): string` +* `botAPItoMTProto(array $parameters): \Amp\Promise` +* `call(\Generator|\Promise|mixed $promise): \Amp\Promise` +* `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` +* `callForkDefer(\Generator|\Promise $promise): void` +* `connect(string $config): \Amp\Promise` +* `echo(string $string): \Amp\Promise` +* `end(array $what): mixed` +* `first((\Promise|\Generator)[] $promises): \Amp\Promise` +* `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` +* `genVectorHash(array $ints): \int Vector hash` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getMethodNamespaces(): mixed` +* `getMimeFromBuffer(string $buffer): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getMimeFromFile(string $file): string` +* `getVar(object $obj, string $var): mixed` +* `hasVar(object $obj, string $var): bool` +* `inflateStripped(string $stripped): \string JPG payload` +* `isAltervista(): bool` +* `isArrayOrAlike(mixed $var): bool` +* `logger(string $param, int $level, string $file): mixed` +* `loop(callable $func): \Amp\Promise` +* `markdownEscape(string $hwat): string` +* `methodCall(string $methodName, array $args): \Amp\Promise` +* `methodEscape(string $method): string` +* `packDouble(float $value): string` +* `packSignedInt(int $value): string` +* `packSignedLong(int $value): string` +* `packUnsignedInt(int $value): string` +* `posmod(int $a, int $b): \int Modulo` +* `random(int $length): \string Random string` +* `randomInt(int $modulus): int` +* `readLine(string $prompt): \Amp\Promise` +* `rethrow(\Throwable $e, string $file): void` +* `rleDecode(string $string): string` +* `rleEncode(string $string): string` +* `setVar(object $obj, string $var, mixed $val): void` +* `sleep(int|float $time): \Amp\Promise` +* `some((\Promise|\Generator)[] $promises): \Amp\Promise` +* `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` +* `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `typeEscape(string $type): string` +* `unpackDouble(string $value): float` +* `unpackSignedInt(string $value): int` +* `unpackSignedLong(string $value): int` +* `unpackSignedLongString(string $value): string` +* `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` +* `async(bool $async): void` +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` + +## Methods: +### `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` + +Call promise $b after promise $a. + + +Parameters: +* `$a`: `\Generator|\Promise` Promise A +* `$b`: `\Generator|\Promise` Promise B + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `all((\Generator|\Promise)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when all promises succeed, and fails if any promise fails. +Returned promise succeeds with an array of values used to succeed each contained promise, with keys corresponding to the array of promises. + +Parameters: +* `$promises`: `(\Generator|\Promise)[]` Promises + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `any((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that is resolved when all promises are resolved. The returned promise will not fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `arr(mixed $params): array` + +Create array. + + +Parameters: +* `$params`: `mixed` Params + + + +### `base64urlDecode(string $data): string` + +base64URL decode. + + +Parameters: +* `$data`: `string` Data to decode + + + +### `base64urlEncode(string $data): string` + +Base64URL encode. + + +Parameters: +* `$data`: `string` Data to encode + + + +### `botAPItoMTProto(array $parameters): \Amp\Promise` + +Convert parameters. + + +Parameters: +* `$parameters`: `array` Parameters + + +#### See also: +* `\Amp\Promise` + + + + +### `call(\Generator|\Promise|mixed $promise): \Amp\Promise` + +Convert generator, promise or any other value to a promise. + + +Parameters: +* `$promise`: `\Generator|\Promise|mixed` + Full type: + ``` + \Generator|\Promise<\TReturn>|\TReturn + ``` + + +Fully typed return value: +``` +\Promise<\TReturn> +``` +#### See also: +* `\Generator` +* `\Promise` +* `\TReturn` +* `\Amp\Promise` + + + + +### `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` + +Call promise in background. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve +* `$actual`: `?\Generator|\Promise` Promise to resolve instead of $promise +* `$file`: `string` File + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `callForkDefer(\Generator|\Promise $promise): void` + +Call promise in background, deferring execution. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `connect(string $config): \Amp\Promise` + +Connect to the lite endpoints specified in the config file. + + +Parameters: +* `$config`: `string` Path to config file + + +#### See also: +* `\Amp\Promise` + + + + +### `echo(string $string): \Amp\Promise` + +Asynchronously write to stdout/browser. + + +Parameters: +* `$string`: `string` Message to echo + + +#### See also: +* `\Amp\Promise` + + + + +### `end(array $what): mixed` + +Get final element of array. + + +Parameters: +* `$what`: `array` Array + + + +### `first((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when the first promise succeeds, and fails only if all promises fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` + +Asynchronously lock a file +Resolves with a callbable that MUST eventually be called in order to release the lock. + + +Parameters: +* `$file`: `string` File to lock +* `$operation`: `int` Locking mode +* `$polling`: `float` Polling interval +* `$token`: `?\Promise` Cancellation token +* `$failureCb`: `?callable` Failure callback, called only once if the first locking attempt fails. + + +#### See also: +* `\Promise` +* `\Amp\Promise` + + + + +### `genVectorHash(array $ints): \int Vector hash` + +Generate MTProto vector hash. + + +Parameters: +* `$ints`: `array` IDs + + +Return value: Vector hash + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getMethodNamespaces(): mixed` + +Get TL method namespaces. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getVar(object $obj, string $var): mixed` + +Accesses a private variable from an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `hasVar(object $obj, string $var): bool` + +Checks private property exists in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `inflateStripped(string $stripped): \string JPG payload` + +Inflate stripped photosize to full JPG payload. + + +Parameters: +* `$stripped`: `string` Stripped photosize + + +Return value: JPG payload + + +### `isAltervista(): bool` + +Whether this is altervista. + + + +### `isArrayOrAlike(mixed $var): bool` + +Check if is array or similar (traversable && countable && arrayAccess). + + +Parameters: +* `$var`: `mixed` Value to check + + + +### `logger(string $param, int $level, string $file): mixed` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `loop(callable $func): \Amp\Promise` + +Asynchronously run async callable. + + +Parameters: +* `$func`: `callable` Function + + +#### See also: +* `\Amp\Promise` + + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `methodCall(string $methodName, array $args): \Amp\Promise` + +Call lite method. + + +Parameters: +* `$methodName`: `string` Method name +* `$args`: `array` Arguments + + +#### See also: +* `\Amp\Promise` + + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `packDouble(float $value): string` + +Convert double to binary version. + + +Parameters: +* `$value`: `float` Value to convert + + + +### `packSignedInt(int $value): string` + +Convert integer to base256 signed int. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packSignedLong(int $value): string` + +Convert integer to base256 long. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packUnsignedInt(int $value): string` + +Convert value to unsigned base256 int. + + +Parameters: +* `$value`: `int` Value + + + +### `posmod(int $a, int $b): \int Modulo` + +Positive modulo +Works just like the % (modulus) operator, only returns always a postive number. + + +Parameters: +* `$a`: `int` A +* `$b`: `int` B + + +Return value: Modulo + + +### `random(int $length): \string Random string` + +Get random string of specified length. + + +Parameters: +* `$length`: `int` Length + + +Return value: Random string + + +### `randomInt(int $modulus): int` + +Get random integer. + + +Parameters: +* `$modulus`: `int` Modulus + + + +### `readLine(string $prompt): \Amp\Promise` + +Asynchronously read line. + + +Parameters: +* `$prompt`: `string` Prompt + + +#### See also: +* `\Amp\Promise` + + + + +### `rethrow(\Throwable $e, string $file): void` + +Rethrow error catched in strand. + + +Parameters: +* `$e`: `\Throwable` Exception +* `$file`: `string` File where the strand started + + +#### See also: +* `\Throwable` + + + + +### `rleDecode(string $string): string` + +null-byte RLE decode. + + +Parameters: +* `$string`: `string` Data to decode + + + +### `rleEncode(string $string): string` + +null-byte RLE encode. + + +Parameters: +* `$string`: `string` Data to encode + + + +### `setVar(object $obj, string $var, mixed $val): void` + +Sets a private variable in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name +* `$val`: `mixed` Attribute value + + + +### `sleep(int|float $time): \Amp\Promise` + +Asynchronously sleep. + + +Parameters: +* `$time`: `int|float` Number of seconds to sleep for + + +#### See also: +* `\Amp\Promise` + + + + +### `some((\Promise|\Generator)[] $promises): \Amp\Promise` + +Resolves with a two-item array delineating successful and failed Promise results. +The returned promise will only fail if the given number of required promises fail. + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` + +Create an artificial timeout for any \Generator or Promise. + + +Parameters: +* `$promise`: `\Generator|\Promise` +* `$timeout`: `int` + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` + +Creates an artificial timeout for any `Promise`. +If the promise is resolved before the timeout expires, the result is returned + +If the timeout expires before the promise is resolved, a default value is returned + +Parameters: +* `$promise`: `\Promise|\Generator` Promise to which the timeout is applied. + Full type: + ``` + \Promise<\TReturn>|\TGenerator + ``` +* `$timeout`: `int` Timeout in milliseconds. +* `$default`: `mixed` + Full type: + ``` + \TReturnAlt + ``` + + +#### See also: +* `\Promise` +* `\Generator` +* `\TReturn` +* `\TGenerator` +* `\TReturnAlt` +* `\Amp\Promise` + + + + +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `unpackDouble(string $value): float` + +Unpack binary double. + + +Parameters: +* `$value`: `string` Value to unpack + + + +### `unpackSignedInt(string $value): int` + +Unpack base256 signed int. + + +Parameters: +* `$value`: `string` base256 int + + + +### `unpackSignedLong(string $value): int` + +Unpack base256 signed long. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unpackSignedLongString(string $value): string` + +Unpack base256 signed long to string. + + +Parameters: +* `$value`: `string` base256 long + + + +### `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` + +Synchronously wait for a promise|generator. + + +Parameters: +* `$promise`: `\Generator|\Promise` The promise to wait for +* `$ignoreSignal`: `bool` Whether to ignore shutdown signals + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `async(bool $async): void` + +Enable or disable async. + + +Parameters: +* `$async`: `bool` Whether to enable or disable async + + + +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + diff --git a/docs/PHP/danog/MadelineProto/TON/Lite.md b/docs/PHP/danog/MadelineProto/TON/Lite.md new file mode 100644 index 00000000..42b222ab --- /dev/null +++ b/docs/PHP/danog/MadelineProto/TON/Lite.md @@ -0,0 +1,106 @@ +--- +title: danog\MadelineProto\TON\Lite: TON API. +description: + +--- +# `danog\MadelineProto\TON\Lite` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TON API. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(string $config): \Generator` +* `logger(string $param, int $level, string $file): void` +* `methodCall(string $methodName, array $args): \Generator` +* `loop(callable $func): \Generator` +* `botAPItoMTProto(array $parameters): \Generator` +* `getMethodNamespaces(): array` + +## Methods: +### `connect(string $config): \Generator` + +Connect to the lite endpoints specified in the config file. + + +Parameters: +* `$config`: `string` Path to config file + + +#### See also: +* `\Generator` + + + + +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `methodCall(string $methodName, array $args): \Generator` + +Call lite method. + + +Parameters: +* `$methodName`: `string` Method name +* `$args`: `array` Arguments + + +#### See also: +* `\Generator` + + + + +### `loop(callable $func): \Generator` + +Asynchronously run async callable. + + +Parameters: +* `$func`: `callable` Function + + +#### See also: +* `\Generator` + + + + +### `botAPItoMTProto(array $parameters): \Generator` + +Convert parameters. + + +Parameters: +* `$parameters`: `array` Parameters + + +#### See also: +* `\Generator` + + + + +### `getMethodNamespaces(): array` + +Get TL method namespaces. + + + diff --git a/docs/PHP/danog/MadelineProto/Tools.md b/docs/PHP/danog/MadelineProto/Tools.md new file mode 100644 index 00000000..95b4faec --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Tools.md @@ -0,0 +1,709 @@ +--- +title: danog\MadelineProto\Tools: Some tools. +description: + +--- +# `danog\MadelineProto\Tools` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Some tools. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `genVectorHash(array $ints): \int Vector hash` +* `randomInt(int $modulus): int` +* `random(int $length): \string Random string` +* `posmod(int $a, int $b): \int Modulo` +* `unpackSignedInt(string $value): int` +* `unpackSignedLong(string $value): int` +* `unpackSignedLongString(string $value): string` +* `packSignedInt(int $value): string` +* `packSignedLong(int $value): string` +* `packUnsignedInt(int $value): string` +* `packDouble(float $value): string` +* `unpackDouble(string $value): float` +* `wait(\Generator|\Amp\Promise $promise, bool $ignoreSignal): mixed` +* `all((\Generator|\Amp\Promise)[] $promises): \Amp\Promise` +* `any((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` +* `some((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` +* `first((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` +* `timeout(\Generator|\Amp\Promise $promise, int $timeout): \Amp\Promise` +* `timeoutWithDefault(\Amp\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Amp\Promise<\TReturnAlt>` +* `call(\Generator|\Amp\Promise|mixed $promise): \Amp\Promise` +* `callFork(\Generator|\Amp\Promise $promise, ?\Generator|\Amp\Promise $actual, string $file): \Amp\Promise|mixed` +* `callForkDefer(\Generator|\Amp\Promise $promise): void` +* `rethrow(\Throwable $e, string $file): void` +* `after(\Generator|\Amp\Promise $a, \Generator|\Amp\Promise $b): \Amp\Promise` +* `flock(string $file, int $operation, float $polling, ?\Amp\Promise $token, ?callable $failureCb): \Amp\Promise` +* `sleep(int|float $time): \Amp\Promise` +* `readLine(string $prompt): \Amp\Promise` +* `echo(string $string): \Amp\Promise` +* `isArrayOrAlike(mixed $var): bool` +* `arr(mixed $params): array` +* `base64urlDecode(string $data): string` +* `base64urlEncode(string $data): string` +* `rleDecode(string $string): string` +* `rleEncode(string $string): string` +* `inflateStripped(string $stripped): \string JPG payload` +* `end(array $what): mixed` +* `isAltervista(): bool` +* `hasVar(object $obj, string $var): bool` +* `getVar(object $obj, string $var): mixed` +* `setVar(object $obj, string $var, mixed $val): void` +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `markdownEscape(string $hwat): string` +* `typeEscape(string $type): string` +* `methodEscape(string $method): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getMimeFromFile(string $file): string` +* `getMimeFromBuffer(string $buffer): string` + +## Methods: +### `genVectorHash(array $ints): \int Vector hash` + +Generate MTProto vector hash. + + +Parameters: +* `$ints`: `array` IDs + + +Return value: Vector hash + + +### `randomInt(int $modulus): int` + +Get random integer. + + +Parameters: +* `$modulus`: `int` Modulus + + + +### `random(int $length): \string Random string` + +Get random string of specified length. + + +Parameters: +* `$length`: `int` Length + + +Return value: Random string + + +### `posmod(int $a, int $b): \int Modulo` + +Positive modulo +Works just like the % (modulus) operator, only returns always a postive number. + + +Parameters: +* `$a`: `int` A +* `$b`: `int` B + + +Return value: Modulo + + +### `unpackSignedInt(string $value): int` + +Unpack base256 signed int. + + +Parameters: +* `$value`: `string` base256 int + + + +### `unpackSignedLong(string $value): int` + +Unpack base256 signed long. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unpackSignedLongString(string $value): string` + +Unpack base256 signed long to string. + + +Parameters: +* `$value`: `string` base256 long + + + +### `packSignedInt(int $value): string` + +Convert integer to base256 signed int. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packSignedLong(int $value): string` + +Convert integer to base256 long. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packUnsignedInt(int $value): string` + +Convert value to unsigned base256 int. + + +Parameters: +* `$value`: `int` Value + + + +### `packDouble(float $value): string` + +Convert double to binary version. + + +Parameters: +* `$value`: `float` Value to convert + + + +### `unpackDouble(string $value): float` + +Unpack binary double. + + +Parameters: +* `$value`: `string` Value to unpack + + + +### `wait(\Generator|\Amp\Promise $promise, bool $ignoreSignal): mixed` + +Synchronously wait for a promise|generator. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise` The promise to wait for +* `$ignoreSignal`: `bool` Whether to ignore shutdown signals + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `all((\Generator|\Amp\Promise)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when all promises succeed, and fails if any promise fails. +Returned promise succeeds with an array of values used to succeed each contained promise, with keys corresponding to the array of promises. + +Parameters: +* `$promises`: `(\Generator|\Amp\Promise)[]` Promises + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `any((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that is resolved when all promises are resolved. The returned promise will not fail. + + +Parameters: +* `$promises`: `(\Amp\Promise|\Generator)[]` Promises + + +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `some((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` + +Resolves with a two-item array delineating successful and failed Promise results. +The returned promise will only fail if the given number of required promises fail. + +Parameters: +* `$promises`: `(\Amp\Promise|\Generator)[]` Promises + + +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `first((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when the first promise succeeds, and fails only if all promises fail. + + +Parameters: +* `$promises`: `(\Amp\Promise|\Generator)[]` Promises + + +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `timeout(\Generator|\Amp\Promise $promise, int $timeout): \Amp\Promise` + +Create an artificial timeout for any \Generator or Promise. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise` +* `$timeout`: `int` + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `timeoutWithDefault(\Amp\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Amp\Promise<\TReturnAlt>` + +Creates an artificial timeout for any `Promise`. +If the promise is resolved before the timeout expires, the result is returned + +If the timeout expires before the promise is resolved, a default value is returned + +Parameters: +* `$promise`: `\Amp\Promise|\Generator` Promise to which the timeout is applied. + Full type: + ``` + \Amp\Promise<\TReturn>|\TGenerator + ``` +* `$timeout`: `int` Timeout in milliseconds. +* `$default`: `mixed` + Full type: + ``` + \TReturnAlt + ``` + + +#### See also: +* `\Amp\Promise` +* `\Generator` +* `\TReturn` +* `\TGenerator` +* `\TReturnAlt` + + + + +### `call(\Generator|\Amp\Promise|mixed $promise): \Amp\Promise` + +Convert generator, promise or any other value to a promise. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise|mixed` + Full type: + ``` + \Generator|\Amp\Promise<\TReturn>|\TReturn + ``` + + +Fully typed return value: +``` +\Amp\Promise<\TReturn> +``` +#### See also: +* `\Generator` +* `\Amp\Promise` +* `\TReturn` + + + + +### `callFork(\Generator|\Amp\Promise $promise, ?\Generator|\Amp\Promise $actual, string $file): \Amp\Promise|mixed` + +Call promise in background. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise` Promise to resolve +* `$actual`: `?\Generator|\Amp\Promise` Promise to resolve instead of $promise +* `$file`: `string` File + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `callForkDefer(\Generator|\Amp\Promise $promise): void` + +Call promise in background, deferring execution. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise` Promise to resolve + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `rethrow(\Throwable $e, string $file): void` + +Rethrow error catched in strand. + + +Parameters: +* `$e`: `\Throwable` Exception +* `$file`: `string` File where the strand started + + +#### See also: +* `\Throwable` + + + + +### `after(\Generator|\Amp\Promise $a, \Generator|\Amp\Promise $b): \Amp\Promise` + +Call promise $b after promise $a. + + +Parameters: +* `$a`: `\Generator|\Amp\Promise` Promise A +* `$b`: `\Generator|\Amp\Promise` Promise B + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `flock(string $file, int $operation, float $polling, ?\Amp\Promise $token, ?callable $failureCb): \Amp\Promise` + +Asynchronously lock a file +Resolves with a callbable that MUST eventually be called in order to release the lock. + + +Parameters: +* `$file`: `string` File to lock +* `$operation`: `int` Locking mode +* `$polling`: `float` Polling interval +* `$token`: `?\Amp\Promise` Cancellation token +* `$failureCb`: `?callable` Failure callback, called only once if the first locking attempt fails. + + +#### See also: +* `\Amp\Promise` + + + + +### `sleep(int|float $time): \Amp\Promise` + +Asynchronously sleep. + + +Parameters: +* `$time`: `int|float` Number of seconds to sleep for + + +#### See also: +* `\Amp\Promise` + + + + +### `readLine(string $prompt): \Amp\Promise` + +Asynchronously read line. + + +Parameters: +* `$prompt`: `string` Prompt + + +#### See also: +* `\Amp\Promise` + + + + +### `echo(string $string): \Amp\Promise` + +Asynchronously write to stdout/browser. + + +Parameters: +* `$string`: `string` Message to echo + + +#### See also: +* `\Amp\Promise` + + + + +### `isArrayOrAlike(mixed $var): bool` + +Check if is array or similar (traversable && countable && arrayAccess). + + +Parameters: +* `$var`: `mixed` Value to check + + + +### `arr(mixed $params): array` + +Create array. + + +Parameters: +* `$params`: `mixed` Params + + + +### `base64urlDecode(string $data): string` + +base64URL decode. + + +Parameters: +* `$data`: `string` Data to decode + + + +### `base64urlEncode(string $data): string` + +Base64URL encode. + + +Parameters: +* `$data`: `string` Data to encode + + + +### `rleDecode(string $string): string` + +null-byte RLE decode. + + +Parameters: +* `$string`: `string` Data to decode + + + +### `rleEncode(string $string): string` + +null-byte RLE encode. + + +Parameters: +* `$string`: `string` Data to encode + + + +### `inflateStripped(string $stripped): \string JPG payload` + +Inflate stripped photosize to full JPG payload. + + +Parameters: +* `$stripped`: `string` Stripped photosize + + +Return value: JPG payload + + +### `end(array $what): mixed` + +Get final element of array. + + +Parameters: +* `$what`: `array` Array + + + +### `isAltervista(): bool` + +Whether this is altervista. + + + +### `hasVar(object $obj, string $var): bool` + +Checks private property exists in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `getVar(object $obj, string $var): mixed` + +Accesses a private variable from an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `setVar(object $obj, string $var, mixed $val): void` + +Sets a private variable in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name +* `$val`: `mixed` Attribute value + + + +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + diff --git a/docs/PHP/danog/MadelineProto/VoIP/AuthKeyHandler.md b/docs/PHP/danog/MadelineProto/VoIP/AuthKeyHandler.md new file mode 100644 index 00000000..52d477ad --- /dev/null +++ b/docs/PHP/danog/MadelineProto/VoIP/AuthKeyHandler.md @@ -0,0 +1,128 @@ +--- +title: danog\MadelineProto\VoIP\AuthKeyHandler: Manages the creation of the authorization key. +description: https://core.telegram.org/mtproto/auth_key +https://core.telegram.org/mtproto/samples-auth_key + +--- +# `danog\MadelineProto\VoIP\AuthKeyHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages the creation of the authorization key. + +https://core.telegram.org/mtproto/auth_key +https://core.telegram.org/mtproto/samples-auth_key + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `requestCall(mixed $user): \Generator` +* `acceptCall(array $call): \Generator` +* `confirmCall(array $params): \Generator` +* `completeCall(array $params): \Generator` +* `callStatus(int $id): int` +* `getCall(int $call): array` +* `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Generator` + +## Methods: +### `requestCall(mixed $user): \Generator` + +Request VoIP call. + + +Parameters: +* `$user`: `mixed` User + + +#### See also: +* `\Generator` + + + + +### `acceptCall(array $call): \Generator` + +Accept call. + + +Parameters: +* `$call`: `array` Call + + +#### See also: +* `\Generator` + + + + +### `confirmCall(array $params): \Generator` + +Confirm call. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Generator` + + + + +### `completeCall(array $params): \Generator` + +Complete call handshake. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Generator` + + + + +### `callStatus(int $id): int` + +Get call status. + + +Parameters: +* `$id`: `int` Call ID + + + +### `getCall(int $call): array` + +Get call info. + + +Parameters: +* `$call`: `int` Call ID + + + +### `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Generator` + +Discard call. + + +Parameters: +* `$call`: `array` Call +* `$reason`: `array` +* `$rating`: `array` Rating +* `$need_debug`: `bool` Need debug? + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/VoIPServerConfig.md b/docs/PHP/danog/MadelineProto/VoIPServerConfig.md new file mode 100644 index 00000000..d25780ea --- /dev/null +++ b/docs/PHP/danog/MadelineProto/VoIPServerConfig.md @@ -0,0 +1,68 @@ +--- +title: danog\MadelineProto\VoIPServerConfig: Manages storage of VoIP server config. +description: + +--- +# `danog\MadelineProto\VoIPServerConfig` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Manages storage of VoIP server config. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `update(array $config): void` +* `get(): \array The settings` +* `updateDefault(array $configDefault): void` +* `getDefault(): \array The settings` +* `getFinal(): void` + +## Methods: +### `update(array $config): void` + +Update shared call settings. + + +Parameters: +* `$config`: `array` The settings + + + +### `get(): \array The settings` + +Get shared call settings. + + +Return value: The settings + + +### `updateDefault(array $configDefault): void` + +Update default shared call settings. + + +Parameters: +* `$configDefault`: `array` The settings + + + +### `getDefault(): \array The settings` + +Get default shared call settings. + + +Return value: The settings + + +### `getFinal(): void` + +Get final settings. + + + diff --git a/docs/PHP/danog/MadelineProto/Wrappers/Callback.md b/docs/PHP/danog/MadelineProto/Wrappers/Callback.md new file mode 100644 index 00000000..2868e1c9 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Wrappers/Callback.md @@ -0,0 +1,32 @@ +--- +title: danog\MadelineProto\Wrappers\Callback: Manages logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Callback` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setCallback(callable $callback): void` + +## Methods: +### `setCallback(callable $callback): void` + +Set update handling callback. + + +Parameters: +* `$callback`: `callable` Callback + + + diff --git a/docs/PHP/danog/MadelineProto/Wrappers/DialogHandler.md b/docs/PHP/danog/MadelineProto/Wrappers/DialogHandler.md new file mode 100644 index 00000000..fabd94e2 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Wrappers/DialogHandler.md @@ -0,0 +1,60 @@ +--- +title: danog\MadelineProto\Wrappers\DialogHandler: Dialog handler. +description: + +--- +# `danog\MadelineProto\Wrappers\DialogHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Dialog handler. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getDialogs(bool $force): \Generator` +* `getFullDialogs(bool $force): \Generator` + +## Methods: +### `getDialogs(bool $force): \Generator` + +Get dialog peers. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +Fully typed return value: +``` +\Generator, mixed, list> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFullDialogs(bool $force): \Generator` + +Get full info of all dialogs. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Wrappers/Events.md b/docs/PHP/danog/MadelineProto/Wrappers/Events.md new file mode 100644 index 00000000..5f1699b1 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Wrappers/Events.md @@ -0,0 +1,70 @@ +--- +title: danog\MadelineProto\Wrappers\Events: Event handler. +description: + +--- +# `danog\MadelineProto\Wrappers\Events` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Event handler. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Generator` +* `unsetEventHandler(bool $disableUpdateHandling): void` +* `getEventHandler(): \danog\MadelineProto\EventHandler` +* `hasEventHandler(): bool` + +## Methods: +### `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Generator` + +Set event handler. + + +Parameters: +* `$eventHandler`: `class-string<\danog\MadelineProto\EventHandler>` Event handler + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](../EventHandler.md) +* `\Generator` + + + + +### `unsetEventHandler(bool $disableUpdateHandling): void` + +Unset event handler. + + +Parameters: +* `$disableUpdateHandling`: `bool` Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler) + + + +### `getEventHandler(): \danog\MadelineProto\EventHandler` + +Get event handler. + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](../EventHandler.md) + + + + +### `hasEventHandler(): bool` + +Check if an event handler instance is present. + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Wrappers/Login.md b/docs/PHP/danog/MadelineProto/Wrappers/Login.md new file mode 100644 index 00000000..d183f039 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Wrappers/Login.md @@ -0,0 +1,165 @@ +--- +title: danog\MadelineProto\Wrappers\Login: Manages logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Login` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `logout(): \Generator` +* `botLogin(string $token): \Generator` +* `phoneLogin(string $number, int $sms_type): \Generator` +* `completePhoneLogin(string $code): \Generator` +* `importAuthorization(mixed $authorization): \Generator` +* `exportAuthorization(): \Generator` +* `completeSignup(string $first_name, string $last_name): \Generator` +* `complete2faLogin(string $password): \Generator` +* `update2fa(array $params): \Generator` + +## Methods: +### `logout(): \Generator` + +Log out currently logged in user. + + +#### See also: +* `\Generator` + + + + +### `botLogin(string $token): \Generator` + +Login as bot. + + +Parameters: +* `$token`: `string` Bot token + + +#### See also: +* `\Generator` + + + + +### `phoneLogin(string $number, int $sms_type): \Generator` + +Login as user. + + +Parameters: +* `$number`: `string` Phone number +* `$sms_type`: `int` SMS type + + +#### See also: +* `\Generator` + + + + +### `completePhoneLogin(string $code): \Generator` + +Complet user login using login code. + + +Parameters: +* `$code`: `string` Login code + + +#### See also: +* `\Generator` + + + + +### `importAuthorization(mixed $authorization): \Generator` + +Import authorization. + + +Parameters: +* `$authorization`: `mixed` Authorization info + + +#### See also: +* `\Generator` + + + + +### `exportAuthorization(): \Generator` + +Export authorization. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Generator` + + + + +### `completeSignup(string $first_name, string $last_name): \Generator` + +Complete signup to Telegram. + + +Parameters: +* `$first_name`: `string` First name +* `$last_name`: `string` Last name + + +#### See also: +* `\Generator` + + + + +### `complete2faLogin(string $password): \Generator` + +Complete 2FA login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Generator` + + + + +### `update2fa(array $params): \Generator` + +Update the 2FA password. +The params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` The params + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Wrappers/Loop.md b/docs/PHP/danog/MadelineProto/Wrappers/Loop.md new file mode 100644 index 00000000..3134d1ed --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Wrappers/Loop.md @@ -0,0 +1,83 @@ +--- +title: danog\MadelineProto\Wrappers\Loop: Manages logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Loop` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initSelfRestart(): void` +* `loop(callable|null $callback): \Generator` +* `stop(): void` +* `restart(): void` +* `loopFork(): \Amp\Promise` +* `closeConnection(string $message): void` + +## Methods: +### `initSelfRestart(): void` + +Initialize self-restart hack. + + + +### `loop(callable|null $callback): \Generator` + +Start MadelineProto's update handling loop, or run the provided async callable. + + +Parameters: +* `$callback`: `callable|null` Async callable to run + + +#### See also: +* `\Generator` + + + + +### `stop(): void` + +Stop update loop. + + + +### `restart(): void` + +Restart update loop. + + + +### `loopFork(): \Amp\Promise` + +Start MadelineProto's update handling loop in background. + + +#### See also: +* `\Amp\Promise` + + + + +### `closeConnection(string $message): void` + +Close connection with client, connected via web. + + +Parameters: +* `$message`: `string` Message + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Wrappers/Start.md b/docs/PHP/danog/MadelineProto/Wrappers/Start.md new file mode 100644 index 00000000..770b8c24 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Wrappers/Start.md @@ -0,0 +1,35 @@ +--- +title: danog\MadelineProto\Wrappers\Start: Manages simple logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Start` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages simple logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `start(): \Generator` + +## Methods: +### `start(): \Generator` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHP/danog/MadelineProto/Wrappers/TOS.md b/docs/PHP/danog/MadelineProto/Wrappers/TOS.md new file mode 100644 index 00000000..17fa7a50 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Wrappers/TOS.md @@ -0,0 +1,57 @@ +--- +title: danog\MadelineProto\Wrappers\TOS: Manages terms of service. +description: + +--- +# `danog\MadelineProto\Wrappers\TOS` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages terms of service. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `checkTos(): \Generator` +* `acceptTos(): \Generator` +* `declineTos(): \Generator` + +## Methods: +### `checkTos(): \Generator` + +Check for terms of service update. + + +#### See also: +* `\Generator` + + + + +### `acceptTos(): \Generator` + +Accept terms of service update. + + +#### See also: +* `\Generator` + + + + +### `declineTos(): \Generator` + +Decline terms of service update. +THIS WILL DELETE YOUR ACCOUNT! + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHP/danog/MadelineProto/Wrappers/Webhook.md b/docs/PHP/danog/MadelineProto/Wrappers/Webhook.md new file mode 100644 index 00000000..2a66a7c5 --- /dev/null +++ b/docs/PHP/danog/MadelineProto/Wrappers/Webhook.md @@ -0,0 +1,35 @@ +--- +title: danog\MadelineProto\Wrappers\Webhook: Manages logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Webhook` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setWebhook(string $hook_url, string $pem_path): void` + +## Methods: +### `setWebhook(string $hook_url, string $pem_path): void` + +Set webhook update handler. + + +Parameters: +* `$hook_url`: `string` Webhook URL +* `$pem_path`: `string` PEM path for self-signed certificate + + + +## Properties +* `$settings`: `\Settings` \ No newline at end of file diff --git a/docs/PHP/index.md b/docs/PHP/index.md new file mode 100644 index 00000000..d51b03d5 --- /dev/null +++ b/docs/PHP/index.md @@ -0,0 +1,81 @@ +--- +title: danog/madelineproto +description: PHP implementation of telegram's MTProto protocol. +--- +# `danog/madelineproto` + +PHP implementation of telegram's MTProto protocol. + + + +## Abstract classes +* [\danog\MadelineProto\EventHandler: Event handler.](danog/MadelineProto/EventHandler.md) +* [\danog\MadelineProto\FileCallbackInterface: File callback interface.](danog/MadelineProto/FileCallbackInterface.md) +* [\danog\MadelineProto\StrTools: Some tools.](danog/MadelineProto/StrTools.md) +* [\danog\MadelineProto\Tools: Some tools.](danog/MadelineProto/Tools.md) +* [\danog\MadelineProto\Db\DbArray: DB array interface.](danog/MadelineProto/Db/DbArray.md) +* [\danog\MadelineProto\Db\DbPropertiesFactory: This factory class initializes the correct database backend for MadelineProto.](danog/MadelineProto/Db/DbPropertiesFactory.md) +* [\danog\MadelineProto\Db\DriverArray: Array caching trait.](danog/MadelineProto/Db/DriverArray.md) +* [\danog\MadelineProto\Db\SqlArray: Generic SQL database backend.](danog/MadelineProto/Db/SqlArray.md) +* [\danog\MadelineProto\Settings\DatabaseAbstract: Base class for storage backends.](danog/MadelineProto/Settings/DatabaseAbstract.md) +* [\danog\MadelineProto\Settings\Database\DatabaseAbstract: Base class for database backends.](danog/MadelineProto/Settings/Database/DatabaseAbstract.md) +* [\danog\MadelineProto\Settings\Database\SqlAbstract: Generic db backend settings.](danog/MadelineProto/Settings/Database/SqlAbstract.md) +* [\danog\MadelineProto\TL\Conversion\Extension: Manages generation of extensions for files.](danog/MadelineProto/TL/Conversion/Extension.md) + +## Classes +* [\danog\MadelineProto\API: Main API wrapper for MadelineProto.](danog/MadelineProto/API.md) +* [\danog\MadelineProto\Coroutine: Creates a promise from a generator function yielding promises.](danog/MadelineProto/Coroutine.md) +* [\danog\MadelineProto\Exception: Basic exception.](danog/MadelineProto/Exception.md) +* [\danog\MadelineProto\API: Main API wrapper for MadelineProto.](danog/MadelineProto/API.md) +* [\danog\MadelineProto\FileCallback: File callback interface.](danog/MadelineProto/FileCallback.md) +* [\danog\MadelineProto\Logger: Logger class.](danog/MadelineProto/Logger.md) +* [\danog\MadelineProto\Lua: Lua interface.](danog/MadelineProto/Lua.md) +* [\danog\MadelineProto\MTProto: Manages all of the mtproto stuff.](danog/MadelineProto/MTProto.md) +* [\danog\MadelineProto\MyTelegramOrgWrapper: Wrapper for my.telegram.org.](danog/MadelineProto/MyTelegramOrgWrapper.md) +* [\danog\MadelineProto\PTSException: Internal error indicating a problem with Telegram's servers.](danog/MadelineProto/PTSException.md) +* [\danog\MadelineProto\PsrLogger: PSR-3 wrapper for MadelineProto's Logger.](danog/MadelineProto/PsrLogger.md) +* [\danog\MadelineProto\RPCErrorException: Indicates an error returned by Telegram's API.](danog/MadelineProto/RPCErrorException.md) +* [\danog\MadelineProto\ResponseException: Indicates an error thrown when an unexpected response is received from telegram's servers.](danog/MadelineProto/ResponseException.md) +* [\danog\MadelineProto\SecurityException: Indicates a security error.](danog/MadelineProto/SecurityException.md) +* [\danog\MadelineProto\Settings: Settings class used for configuring MadelineProto.](danog/MadelineProto/Settings.md) +* [\danog\MadelineProto\Shutdown: Class that controls script shutdown.](danog/MadelineProto/Shutdown.md) +* [\danog\MadelineProto\VoIPServerConfig: Manages storage of VoIP server config.](danog/MadelineProto/VoIPServerConfig.md) +* [\danog\MadelineProto\Db\MemoryArray: Memory database backend.](danog/MadelineProto/Db/MemoryArray.md) +* [\danog\MadelineProto\Db\MysqlArray: MySQL database backend.](danog/MadelineProto/Db/MysqlArray.md) +* [\danog\MadelineProto\Db\PostgresArray: Postgres database backend.](danog/MadelineProto/Db/PostgresArray.md) +* [\danog\MadelineProto\Db\RedisArray: Redis database backend.](danog/MadelineProto/Db/RedisArray.md) +* [\danog\MadelineProto\Db\Driver\Mysql: MySQL driver wrapper.](danog/MadelineProto/Db/Driver/Mysql.md) +* [\danog\MadelineProto\Db\Driver\Postgres: Postgres driver wrapper.](danog/MadelineProto/Db/Driver/Postgres.md) +* [\danog\MadelineProto\Db\Driver\Redis: Redis driver wrapper.](danog/MadelineProto/Db/Driver/Redis.md) +* [\danog\MadelineProto\Files\Server: MadelineProto fileserver.](danog/MadelineProto/Files/Server.md) +* [\danog\MadelineProto\MTProtoTools\CombinedUpdatesState: Stores multiple update states.](danog/MadelineProto/MTProtoTools/CombinedUpdatesState.md) +* [\danog\MadelineProto\MTProtoTools\ResponseInfo: Obtain response information for file to server.](danog/MadelineProto/MTProtoTools/ResponseInfo.md) +* [\danog\MadelineProto\Settings\AppInfo: App information.](danog/MadelineProto/Settings/AppInfo.md) +* [\danog\MadelineProto\Settings\Auth: Cryptography settings.](danog/MadelineProto/Settings/Auth.md) +* [\danog\MadelineProto\Settings\Connection: Connection settings.](danog/MadelineProto/Settings/Connection.md) +* [\danog\MadelineProto\Settings\Files: File management settings.](danog/MadelineProto/Settings/Files.md) +* [\danog\MadelineProto\Settings\Ipc: IPC server settings.](danog/MadelineProto/Settings/Ipc.md) +* [\danog\MadelineProto\Settings\Logger: Logger settings.](danog/MadelineProto/Settings/Logger.md) +* [\danog\MadelineProto\Settings\Peer: Peer database settings.](danog/MadelineProto/Settings/Peer.md) +* [\danog\MadelineProto\Settings\Pwr: PWRTelegram settings.](danog/MadelineProto/Settings/Pwr.md) +* [\danog\MadelineProto\Settings\RPC: RPC settings.](danog/MadelineProto/Settings/RPC.md) +* [\danog\MadelineProto\Settings\SecretChats: Secret chat settings.](danog/MadelineProto/Settings/SecretChats.md) +* [\danog\MadelineProto\Settings\Serialization: Serialization settings.](danog/MadelineProto/Settings/Serialization.md) +* [\danog\MadelineProto\Settings\TLSchema: TL schema settings.](danog/MadelineProto/Settings/TLSchema.md) +* [\danog\MadelineProto\Settings\Templates: Web and CLI template settings for login.](danog/MadelineProto/Settings/Templates.md) +* [\danog\MadelineProto\Settings\Database\Memory: Memory backend settings.](danog/MadelineProto/Settings/Database/Memory.md) +* [\danog\MadelineProto\Settings\Database\Mysql: MySQL backend settings.](danog/MadelineProto/Settings/Database/Mysql.md) +* [\danog\MadelineProto\Settings\Database\Postgres: Postgres backend settings.](danog/MadelineProto/Settings/Database/Postgres.md) +* [\danog\MadelineProto\Settings\Database\Redis: Redis backend settings.](danog/MadelineProto/Settings/Database/Redis.md) +* [\danog\MadelineProto\TL\Exception: TL deserialization exception.](danog/MadelineProto/TL/Exception.md) +* [\danog\MadelineProto\TL\Conversion\Exception: TL conversion exception.](danog/MadelineProto/TL/Conversion/Exception.md) +* [\danog\MadelineProto\TL\Types\Button: Clickable button.](danog/MadelineProto/TL/Types/Button.md) +* [\danog\MadelineProto\TL\Types\Bytes: Bytes wrapper.](danog/MadelineProto/TL/Types/Bytes.md) +* [\danog\MadelineProto\TON\API: TON API.](danog/MadelineProto/TON/API.md) + +## Traits +* [\danog\MadelineProto\Db\DbPropertiesTrait: Include this trait and call DbPropertiesTrait::initDb to use MadelineProto's database backend for properties.](danog/MadelineProto/Db/DbPropertiesTrait.md) + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/API.md b/docs/PHPInternal/danog/MadelineProto/API.md new file mode 100644 index 00000000..db23ce7c --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/API.md @@ -0,0 +1,2767 @@ +--- +title: danog\MadelineProto\API: Main API wrapper for MadelineProto. +description: + +--- +# `danog\MadelineProto\API` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Main API wrapper for MadelineProto. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\API::RELEASE`: Release version. + +* `danog\MadelineProto\API::NOT_LOGGED_IN`: We're not logged in. + +* `danog\MadelineProto\API::WAITING_CODE`: We're waiting for the login code. + +* `danog\MadelineProto\API::WAITING_SIGNUP`: We're waiting for parameters to sign up. + +* `danog\MadelineProto\API::WAITING_PASSWORD`: We're waiting for the 2FA password. + +* `danog\MadelineProto\API::LOGGED_IN`: We're logged in. + +* `danog\MadelineProto\API::SECRET_EMPTY`: Secret chat was not found. + +* `danog\MadelineProto\API::SECRET_REQUESTED`: Secret chat was requested. + +* `danog\MadelineProto\API::SECRET_READY`: Secret chat was found. + + +## Method list: +* `startAndLoop(string $eventHandler): void` +* `startAndLoopMulti(\danog\MadelineProto\API[] $instances, string[]|string $eventHandler): void` +* `startAndLoopAsync(string $eventHandler): \Generator` +* `MTProtoToBotAPI(array $data): \Amp\Promise` +* `MTProtoToTd(mixed $params): \Amp\Promise` +* `MTProtoToTdcli(mixed $params): \Amp\Promise` +* `acceptCall(array $call): \Amp\Promise` +* `acceptSecretChat(array $params): \Amp\Promise` +* `acceptTos(): \Amp\Promise` +* `addUser(array $user): \Amp\Promise` +* `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` +* `all((\Generator|\Promise)[] $promises): \Amp\Promise` +* `any((\Promise|\Generator)[] $promises): \Amp\Promise` +* `arr(mixed $params): array` +* `base64urlDecode(string $data): string` +* `base64urlEncode(string $data): string` +* `botAPIToMTProto(array $arguments): \Amp\Promise` +* `botLogin(string $token): \Amp\Promise` +* `call(\Generator|\Promise|mixed $promise): \Amp\Promise` +* `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` +* `callForkDefer(\Generator|\Promise $promise): void` +* `callStatus(int $id): mixed` +* `checkTos(): \Amp\Promise` +* `cleanup(): \Amp\Promise` +* `closeConnection(string $message): void` +* `complete2faLogin(string $password): \Amp\Promise` +* `completeCall(array $params): \Amp\Promise` +* `completePhoneLogin(string $code): \Amp\Promise` +* `completeSignup(string $first_name, string $last_name): \Amp\Promise` +* `confirmCall(array $params): \Amp\Promise` +* `connectToAllDcs(bool $reconnectAll): \Amp\Promise` +* `declineTos(): \Amp\Promise` +* `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Amp\Promise` +* `discardSecretChat(int $chat): \Amp\Promise` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Amp\Promise` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Amp\Promise` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Amp\Promise` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Amp\Promise Downloaded file path` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Amp\Promise Returned response` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Amp\Promise` +* `echo(string $string): \Amp\Promise` +* `end(array $what): mixed` +* `exportAuthorization(): \Amp\Promise` +* `extractBotAPIFile(array $info): ?array` +* `fileGetContents(string $url): \Amp\Promise` +* `first((\Promise|\Generator)[] $promises): \Amp\Promise` +* `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` +* `fromSupergroup(int $id): float|int` +* `fullChatLastUpdated(mixed $id): \Amp\Promise` +* `fullGetSelf(): \Amp\Promise` +* `genVectorHash(array $ints): \int Vector hash` +* `getAllMethods(): mixed` +* `getAuthorization(): mixed` +* `getCachedConfig(): mixed` +* `getCall(int $call): mixed` +* `getCdnConfig(string $datacenter): \Amp\Promise` +* `getConfig(array $config, array $options): \Amp\Promise` +* `getDNSClient(): mixed` +* `getDataCenterConnections(): mixed` +* `getDataCenterId(): int|string` +* `getDialogs(bool $force): \Amp\Promise` +* `getDownloadInfo(mixed $messageMedia): \Amp\Promise` +* `getEventHandler(): mixed` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getFileInfo(mixed $constructor): \Amp\Promise` +* `getFolderId(mixed $id): ?int` +* `getFullDialogs(bool $force): \Amp\Promise` +* `getFullInfo(mixed $id): \Amp\Promise FullInfo object` +* `getHTTPClient(): mixed` +* `getHint(): mixed` +* `getId(mixed $id): int` +* `getInfo(mixed $id, bool $recursive): \Amp\Promise Info object` +* `getLogger()` +* `getMethodNamespaces(): mixed` +* `getMethodsNamespaced(): mixed` +* `getMimeFromBuffer(string $buffer): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getMimeFromFile(string $file): string` +* `getPropicInfo(mixed $messageMedia): \Amp\Promise` +* `getPsrLogger()` +* `getPwrChat(mixed $id): \Amp\Promise Chat object` +* `getSecretChat(array|int $chat): mixed` +* `getSelf(): array|bool` +* `getSettings(): mixed` +* `getTL(): mixed` +* `getVar(object $obj, string $var): mixed` +* `getWebTemplate(): mixed` +* `hasAllAuth(): mixed` +* `hasEventHandler(): mixed` +* `hasReportPeers(): mixed` +* `hasSecretChat(array|int $chat): mixed` +* `hasVar(object $obj, string $var): bool` +* `importAuthorization(mixed $authorization): \Amp\Promise` +* `inflateStripped(string $stripped): \string JPG payload` +* `initSelfRestart(): mixed` +* `isAltervista(): bool` +* `isArrayOrAlike(mixed $var): bool` +* `isIpc(): mixed` +* `isSupergroup(int $id): bool` +* `logger(string $param, int $level, string $file): mixed` +* `logout(): \Amp\Promise` +* `loop(callable|null $callback): \Amp\Promise` +* `loopFork(): \Amp\Promise` +* `markdownEscape(string $hwat): string` +* `mbStrSplit(string $text, int $length): array` +* `mbStrlen(string $text): float|int` +* `mbSubstr(string $text, int $offset, ?int $length): string` +* `methodCall(string $method, array|\Generator $args, array $aargs): \Amp\Promise` +* `methodCallWrite(string $method, array|\Generator $args, array $aargs): \Amp\Promise` +* `methodEscape(string $method): string` +* `packDouble(float $value): string` +* `packSignedInt(int $value): string` +* `packSignedLong(int $value): string` +* `packUnsignedInt(int $value): string` +* `peerIsset(mixed $id): \Amp\Promise` +* `phoneLogin(string $number, int $sms_type): \Amp\Promise` +* `posmod(int $a, int $b): \int Modulo` +* `random(int $length): \string Random string` +* `randomInt(int $modulus): int` +* `readLine(string $prompt): \Amp\Promise` +* `rekey(int $chat): \Amp\Promise` +* `report(string $message, string $parseMode): \Amp\Promise` +* `requestCall(mixed $user): \Amp\Promise` +* `requestSecretChat(mixed $user): \Amp\Promise` +* `resetUpdateState(): mixed` +* `resolveUsername(string $username): \Amp\Promise` +* `restart(): void` +* `rethrow(\Throwable $e, string $file): void` +* `rleDecode(string $string): string` +* `rleEncode(string $string): string` +* `secretChatStatus(int $chat): mixed` +* `serializeAll(): void` +* `setCallback(callable $callback): mixed` +* `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Amp\Promise` +* `setNoop(): mixed` +* `setReportPeers(int|string $userOrId): \Amp\Promise` +* `setVar(object $obj, string $var, mixed $val): void` +* `setWebTemplate(string $template): mixed` +* `setWebhook(string $hook_url, string $pem_path): mixed` +* `setupLogger(): mixed` +* `sleep(int|float $time): \Amp\Promise` +* `some((\Promise|\Generator)[] $promises): \Amp\Promise` +* `start(): \Amp\Promise` +* `stop(): void` +* `tdToMTProto(array $params): \Amp\Promise` +* `tdToTdcli(mixed $params): mixed` +* `tdcliToTd(array $params, array $key): mixed` +* `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` +* `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `toSupergroup(int $id): float|int` +* `typeEscape(string $type): string` +* `unpackDouble(string $value): float` +* `unpackFileId(string $fileId): mixed` +* `unpackSignedInt(string $value): int` +* `unpackSignedLong(string $value): int` +* `unpackSignedLongString(string $value): string` +* `unsetEventHandler(bool $disableUpdateHandling): mixed` +* `update2fa(array $params): \Amp\Promise` +* `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Amp\Promise` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Amp\Promise` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Amp\Promise` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` +* `async(bool $async): void` +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` +* `getWebAPITemplate(): string` +* `setWebAPITemplate(): void` + +## Methods: +### `startAndLoop(string $eventHandler): void` + +Start MadelineProto and the event handler (enables async). +Also initializes error reporting, catching and reporting all errors surfacing from the event loop. + +Parameters: +* `$eventHandler`: `string` Event handler class name + + + +### `startAndLoopMulti(\danog\MadelineProto\API[] $instances, string[]|string $eventHandler): void` + +Start multiple instances of MadelineProto and the event handlers (enables async). + + +Parameters: +* `$instances`: `\danog\MadelineProto\API[]` Instances of madeline +* `$eventHandler`: `string[]|string` Event handler(s) + + + +### `startAndLoopAsync(string $eventHandler): \Generator` + +Start MadelineProto and the event handler (enables async). +Also initializes error reporting, catching and reporting all errors surfacing from the event loop. + +Parameters: +* `$eventHandler`: `string` Event handler class name + + +#### See also: +* `\Generator` + + + + +### `MTProtoToBotAPI(array $data): \Amp\Promise` + +Convert MTProto parameters to bot API parameters. + + +Parameters: +* `$data`: `array` Data + + +#### See also: +* `\Amp\Promise` + + + + +### `MTProtoToTd(mixed $params): \Amp\Promise` + +MTProto to TD params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `MTProtoToTdcli(mixed $params): \Amp\Promise` + +MTProto to TDCLI params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptCall(array $call): \Amp\Promise` + +Accept call. + + +Parameters: +* `$call`: `array` Call + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptSecretChat(array $params): \Amp\Promise` + +Accept secret chat. + + +Parameters: +* `$params`: `array` Secret chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptTos(): \Amp\Promise` + +Accept terms of service update. + + +#### See also: +* `\Amp\Promise` + + + + +### `addUser(array $user): \Amp\Promise` + +Add user info. + + +Parameters: +* `$user`: `array` User info + + +#### See also: +* `\Amp\Promise` + + + + +### `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` + +Call promise $b after promise $a. + + +Parameters: +* `$a`: `\Generator|\Promise` Promise A +* `$b`: `\Generator|\Promise` Promise B + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `all((\Generator|\Promise)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when all promises succeed, and fails if any promise fails. +Returned promise succeeds with an array of values used to succeed each contained promise, with keys corresponding to the array of promises. + +Parameters: +* `$promises`: `(\Generator|\Promise)[]` Promises + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `any((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that is resolved when all promises are resolved. The returned promise will not fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `arr(mixed $params): array` + +Create array. + + +Parameters: +* `$params`: `mixed` Params + + + +### `base64urlDecode(string $data): string` + +base64URL decode. + + +Parameters: +* `$data`: `string` Data to decode + + + +### `base64urlEncode(string $data): string` + +Base64URL encode. + + +Parameters: +* `$data`: `string` Data to encode + + + +### `botAPIToMTProto(array $arguments): \Amp\Promise` + +Convert bot API parameters to MTProto parameters. + + +Parameters: +* `$arguments`: `array` Arguments + + +#### See also: +* `\Amp\Promise` + + + + +### `botLogin(string $token): \Amp\Promise` + +Login as bot. + + +Parameters: +* `$token`: `string` Bot token + + +#### See also: +* `\Amp\Promise` + + + + +### `call(\Generator|\Promise|mixed $promise): \Amp\Promise` + +Convert generator, promise or any other value to a promise. + + +Parameters: +* `$promise`: `\Generator|\Promise|mixed` + Full type: + ``` + \Generator|\Promise<\TReturn>|\TReturn + ``` + + +Fully typed return value: +``` +\Promise<\TReturn> +``` +#### See also: +* `\Generator` +* `\Promise` +* `\TReturn` +* `\Amp\Promise` + + + + +### `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` + +Call promise in background. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve +* `$actual`: `?\Generator|\Promise` Promise to resolve instead of $promise +* `$file`: `string` File + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `callForkDefer(\Generator|\Promise $promise): void` + +Call promise in background, deferring execution. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `callStatus(int $id): mixed` + +Get call status. + + +Parameters: +* `$id`: `int` Call ID + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `checkTos(): \Amp\Promise` + +Check for terms of service update. + + +#### See also: +* `\Amp\Promise` + + + + +### `cleanup(): \Amp\Promise` + +Cleanup memory and session file. + + +#### See also: +* `\Amp\Promise` + + + + +### `closeConnection(string $message): void` + +Close connection with client, connected via web. + + +Parameters: +* `$message`: `string` Message + + + +### `complete2faLogin(string $password): \Amp\Promise` + +Complete 2FA login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Amp\Promise` + + + + +### `completeCall(array $params): \Amp\Promise` + +Complete call handshake. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `completePhoneLogin(string $code): \Amp\Promise` + +Complet user login using login code. + + +Parameters: +* `$code`: `string` Login code + + +#### See also: +* `\Amp\Promise` + + + + +### `completeSignup(string $first_name, string $last_name): \Amp\Promise` + +Complete signup to Telegram. + + +Parameters: +* `$first_name`: `string` First name +* `$last_name`: `string` Last name + + +#### See also: +* `\Amp\Promise` + + + + +### `confirmCall(array $params): \Amp\Promise` + +Confirm call. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `connectToAllDcs(bool $reconnectAll): \Amp\Promise` + +Connects to all datacenters and if necessary creates authorization keys, binds them and writes client info. + + +Parameters: +* `$reconnectAll`: `bool` Whether to reconnect to all DCs + + +#### See also: +* `\Amp\Promise` + + + + +### `declineTos(): \Amp\Promise` + +Decline terms of service update. +THIS WILL DELETE YOUR ACCOUNT! + +#### See also: +* `\Amp\Promise` + + + + +### `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Amp\Promise` + +Discard call. + + +Parameters: +* `$call`: `array` Call +* `$reason`: `array` +* `$rating`: `array` Rating +* `$need_debug`: `bool` Need debug? + + +#### See also: +* `\Amp\Promise` + + + + +### `discardSecretChat(int $chat): \Amp\Promise` + +Discard secret chat. + + +Parameters: +* `$chat`: `int` Secret chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Amp\Promise` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Amp\Promise` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Amp\Promise` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Amp\Promise` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Amp\Promise Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Amp\Promise Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Amp\Promise<\Amp\Http\Server\Response> +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Amp\Promise` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Amp\Promise` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `echo(string $string): \Amp\Promise` + +Asynchronously write to stdout/browser. + + +Parameters: +* `$string`: `string` Message to echo + + +#### See also: +* `\Amp\Promise` + + + + +### `end(array $what): mixed` + +Get final element of array. + + +Parameters: +* `$what`: `array` Array + + + +### `exportAuthorization(): \Amp\Promise` + +Export authorization. + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `extractBotAPIFile(array $info): ?array` + +Extract file info from bot API message. + + +Parameters: +* `$info`: `array` Bot API message object + + + +### `fileGetContents(string $url): \Amp\Promise` + +Get contents of remote file asynchronously. + + +Parameters: +* `$url`: `string` URL + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `first((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when the first promise succeeds, and fails only if all promises fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` + +Asynchronously lock a file +Resolves with a callbable that MUST eventually be called in order to release the lock. + + +Parameters: +* `$file`: `string` File to lock +* `$operation`: `int` Locking mode +* `$polling`: `float` Polling interval +* `$token`: `?\Promise` Cancellation token +* `$failureCb`: `?callable` Failure callback, called only once if the first locking attempt fails. + + +#### See also: +* `\Promise` +* `\Amp\Promise` + + + + +### `fromSupergroup(int $id): float|int` + +Convert bot API channel ID to MTProto channel ID. + + +Parameters: +* `$id`: `int` Bot API channel ID + + + +### `fullChatLastUpdated(mixed $id): \Amp\Promise` + +When were full info for this chat last cached. + + +Parameters: +* `$id`: `mixed` Chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `fullGetSelf(): \Amp\Promise` + +Get info about the logged-in user, not cached. + + +#### See also: +* `\Amp\Promise` + + + + +### `genVectorHash(array $ints): \int Vector hash` + +Generate MTProto vector hash. + + +Parameters: +* `$ints`: `array` IDs + + +Return value: Vector hash + + +### `getAllMethods(): mixed` + +Get full list of MTProto and API methods. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getAuthorization(): mixed` + +Get authorization info. + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCachedConfig(): mixed` + +Get cached server-side config. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCall(int $call): mixed` + +Get call info. + + +Parameters: +* `$call`: `int` Call ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCdnConfig(string $datacenter): \Amp\Promise` + +Store RSA keys for CDN datacenters. + + +Parameters: +* `$datacenter`: `string` DC ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getConfig(array $config, array $options): \Amp\Promise` + +Get cached (or eventually re-fetch) server-side config. + + +Parameters: +* `$config`: `array` Current config +* `$options`: `array` Options for method call + + +#### See also: +* `\Amp\Promise` + + + + +### `getDNSClient(): mixed` + +Get async DNS client. + + +Fully typed return value: +``` +\Amp\Dns\Resolver|\Amp\Promise<\Amp\Dns\Resolver> +``` +#### See also: +* `\Amp\Dns\Resolver` +* `\Amp\Promise` + + + + +### `getDataCenterConnections(): mixed` + +Get all datacenter connections. + + +Fully typed return value: +``` +array<\danog\MadelineProto\DataCenterConnection>|\Amp\Promise> +``` +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) +* `\Amp\Promise` + + + + +### `getDataCenterId(): int|string` + +Get main DC ID. + + + +### `getDialogs(bool $force): \Amp\Promise` + +Get dialog peers. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\Amp\Promise` + + + + +### `getDownloadInfo(mixed $messageMedia): \Amp\Promise` + +Get download info of file +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getEventHandler(): mixed` + +Get event handler. + + +Fully typed return value: +``` +\danog\MadelineProto\EventHandler|\Amp\Promise<\danog\MadelineProto\EventHandler> +``` +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Amp\Promise` + + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getFileInfo(mixed $constructor): \Amp\Promise` + +Get info about file. + + +Parameters: +* `$constructor`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getFolderId(mixed $id): ?int` + +Get folder ID from object. + + +Parameters: +* `$id`: `mixed` Object + + + +### `getFullDialogs(bool $force): \Amp\Promise` + +Get full info of all dialogs. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +#### See also: +* `\Amp\Promise` + + + + +### `getFullInfo(mixed $id): \Amp\Promise FullInfo object` + +Get full info about peer, returns an FullInfo object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: FullInfo object + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [https://docs.madelineproto.xyz/FullInfo.html](https://docs.madelineproto.xyz/FullInfo.html) +* `\Amp\Promise` + + + + +### `getHTTPClient(): mixed` + +Get async HTTP client. + + +Fully typed return value: +``` +\Amp\Http\Client\HttpClient|\Amp\Promise<\Amp\Http\Client\HttpClient> +``` +#### See also: +* `\Amp\Http\Client\HttpClient` +* `\Amp\Promise` + + + + +### `getHint(): mixed` + +Get current password hint. + + +Fully typed return value: +``` +string|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getId(mixed $id): int` + +Get bot API ID from peer object. + + +Parameters: +* `$id`: `mixed` Peer + + + +### `getInfo(mixed $id, bool $recursive): \Amp\Promise Info object` + +Get info about peer, returns an Info object. + + +Parameters: +* `$id`: `mixed` Peer +* `$recursive`: `bool` Internal + + +Return value: Info object + +Fully typed return value: +``` +\Generator|array, mixed, array{InputPeer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}, Peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}, DialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, NotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputDialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputNotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, bot_api_id: int|string, user_id?: int, chat_id?: int, channel_id?: int, InputUser?: array{_: string, user_id?: int, access_hash?: mixed, min?: bool}, InputChannel?: array{_: string, channel_id: int, access_hash: mixed, min: bool}, type: string}> +``` +#### See also: +* [https://docs.madelineproto.xyz/Info.html](https://docs.madelineproto.xyz/Info.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `getLogger()` + +Get logger. + + + +### `getMethodNamespaces(): mixed` + +Get TL namespaces. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMethodsNamespaced(): mixed` + +Get namespaced methods (method => namespace). + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getPropicInfo(mixed $messageMedia): \Amp\Promise` + +Get download info of the propic of a user +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getPsrLogger()` + +Get PSR logger. + + + +### `getPwrChat(mixed $id): \Amp\Promise Chat object` + +Get full info about peer (including full list of channel members), returns a Chat object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: Chat object + +#### See also: +* [https://docs.madelineproto.xyz/Chat.html](https://docs.madelineproto.xyz/Chat.html) + + + + +### `getSecretChat(array|int $chat): mixed` + +Get secret chat. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getSelf(): array|bool` + +Get info about the logged-in user, cached. + + + +### `getSettings(): mixed` + +Return current settings. + + +Fully typed return value: +``` +\danog\MadelineProto\Settings|\Amp\Promise<\danog\MadelineProto\Settings> +``` +#### See also: +* [`\danog\MadelineProto\Settings`: Settings class used for configuring MadelineProto.](./Settings.md) +* `\Amp\Promise` + + + + +### `getTL(): mixed` + +Get TL serializer. + + +Fully typed return value: +``` +\danog\MadelineProto\TL\TL|\Amp\Promise<\danog\MadelineProto\TL\TL> +``` +#### See also: +* [`\danog\MadelineProto\TL\TL`: TL serialization.](./TL/TL.md) +* `\Amp\Promise` + + + + +### `getVar(object $obj, string $var): mixed` + +Accesses a private variable from an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `getWebTemplate(): mixed` + +Get web template. + + +Fully typed return value: +``` +string|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasAllAuth(): mixed` + +Checks whether all datacenters are authorized. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasEventHandler(): mixed` + +Check if an event handler instance is present. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasReportPeers(): mixed` + +Check if has report peers. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasSecretChat(array|int $chat): mixed` + +Check whether secret chat exists. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasVar(object $obj, string $var): bool` + +Checks private property exists in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `importAuthorization(mixed $authorization): \Amp\Promise` + +Import authorization. + + +Parameters: +* `$authorization`: `mixed` Authorization info + + +#### See also: +* `\Amp\Promise` + + + + +### `inflateStripped(string $stripped): \string JPG payload` + +Inflate stripped photosize to full JPG payload. + + +Parameters: +* `$stripped`: `string` Stripped photosize + + +Return value: JPG payload + + +### `initSelfRestart(): mixed` + +Initialize self-restart hack. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `isAltervista(): bool` + +Whether this is altervista. + + + +### `isArrayOrAlike(mixed $var): bool` + +Check if is array or similar (traversable && countable && arrayAccess). + + +Parameters: +* `$var`: `mixed` Value to check + + + +### `isIpc(): mixed` + +Whether we're an IPC client instance. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `isSupergroup(int $id): bool` + +Check whether provided bot API ID is a channel. + + +Parameters: +* `$id`: `int` Bot API ID + + + +### `logger(string $param, int $level, string $file): mixed` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `logout(): \Amp\Promise` + +Log out currently logged in user. + + +#### See also: +* `\Amp\Promise` + + + + +### `loop(callable|null $callback): \Amp\Promise` + +Start MadelineProto's update handling loop, or run the provided async callable. + + +Parameters: +* `$callback`: `callable|null` Async callable to run + + +#### See also: +* `\Amp\Promise` + + + + +### `loopFork(): \Amp\Promise` + +Start MadelineProto's update handling loop in background. + + +#### See also: +* `\Amp\Promise` + + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `mbStrSplit(string $text, int $length): array` + +Telegram UTF-8 multibyte split. + + +Parameters: +* `$text`: `string` Text +* `$length`: `int` Length + + + +### `mbStrlen(string $text): float|int` + +Get Telegram UTF-8 length of string. + + +Parameters: +* `$text`: `string` Text + + + +### `mbSubstr(string $text, int $offset, ?int $length): string` + +Telegram UTF-8 multibyte substring. + + +Parameters: +* `$text`: `string` Text to substring +* `$offset`: `int` Offset +* `$length`: `?int` Length + + + +### `methodCall(string $method, array|\Generator $args, array $aargs): \Amp\Promise` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `methodCallWrite(string $method, array|\Generator $args, array $aargs): \Amp\Promise` + +Call method and make sure it is asynchronously sent. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `packDouble(float $value): string` + +Convert double to binary version. + + +Parameters: +* `$value`: `float` Value to convert + + + +### `packSignedInt(int $value): string` + +Convert integer to base256 signed int. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packSignedLong(int $value): string` + +Convert integer to base256 long. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packUnsignedInt(int $value): string` + +Convert value to unsigned base256 int. + + +Parameters: +* `$value`: `int` Value + + + +### `peerIsset(mixed $id): \Amp\Promise` + +Check if peer is present in internal peer database. + + +Parameters: +* `$id`: `mixed` Peer + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `phoneLogin(string $number, int $sms_type): \Amp\Promise` + +Login as user. + + +Parameters: +* `$number`: `string` Phone number +* `$sms_type`: `int` SMS type + + +#### See also: +* `\Amp\Promise` + + + + +### `posmod(int $a, int $b): \int Modulo` + +Positive modulo +Works just like the % (modulus) operator, only returns always a postive number. + + +Parameters: +* `$a`: `int` A +* `$b`: `int` B + + +Return value: Modulo + + +### `random(int $length): \string Random string` + +Get random string of specified length. + + +Parameters: +* `$length`: `int` Length + + +Return value: Random string + + +### `randomInt(int $modulus): int` + +Get random integer. + + +Parameters: +* `$modulus`: `int` Modulus + + + +### `readLine(string $prompt): \Amp\Promise` + +Asynchronously read line. + + +Parameters: +* `$prompt`: `string` Prompt + + +#### See also: +* `\Amp\Promise` + + + + +### `rekey(int $chat): \Amp\Promise` + +Rekey secret chat. + + +Parameters: +* `$chat`: `int` Secret chat to rekey + + +#### See also: +* `\Amp\Promise` + + + + +### `report(string $message, string $parseMode): \Amp\Promise` + +Report an error to the previously set peer. + + +Parameters: +* `$message`: `string` Error to report +* `$parseMode`: `string` Parse mode + + +#### See also: +* `\Amp\Promise` + + + + +### `requestCall(mixed $user): \Amp\Promise` + +Request VoIP call. + + +Parameters: +* `$user`: `mixed` User + + +#### See also: +* `\Amp\Promise` + + + + +### `requestSecretChat(mixed $user): \Amp\Promise` + +Request secret chat. + + +Parameters: +* `$user`: `mixed` User to start secret chat with + + +#### See also: +* `\Amp\Promise` + + + + +### `resetUpdateState(): mixed` + +Reset the update state and fetch all updates from the beginning. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `resolveUsername(string $username): \Amp\Promise` + +Resolve username (use getInfo instead). + + +Parameters: +* `$username`: `string` Username + + +#### See also: +* `\Amp\Promise` + + + + +### `restart(): void` + +Restart update loop. + + + +### `rethrow(\Throwable $e, string $file): void` + +Rethrow error catched in strand. + + +Parameters: +* `$e`: `\Throwable` Exception +* `$file`: `string` File where the strand started + + +#### See also: +* `\Throwable` + + + + +### `rleDecode(string $string): string` + +null-byte RLE decode. + + +Parameters: +* `$string`: `string` Data to decode + + + +### `rleEncode(string $string): string` + +null-byte RLE encode. + + +Parameters: +* `$string`: `string` Data to encode + + + +### `secretChatStatus(int $chat): mixed` + +Get secret chat status. + + +Parameters: +* `$chat`: `int` Chat ID + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `serializeAll(): void` + +Serialize all instances. +CALLED ONLY ON SHUTDOWN. + + +### `setCallback(callable $callback): mixed` + +Set update handling callback. + + +Parameters: +* `$callback`: `callable` Callback + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Amp\Promise` + +Set event handler. + + +Parameters: +* `$eventHandler`: `class-string<\danog\MadelineProto\EventHandler>` Event handler + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Amp\Promise` + + + + +### `setNoop(): mixed` + +Set NOOP update handler, ignoring all updates. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setReportPeers(int|string $userOrId): \Amp\Promise` + +Set peer(s) where to send errors occurred in the event loop. + + +Parameters: +* `$userOrId`: `int|string` Username(s) or peer ID(s) + + +#### See also: +* `\Amp\Promise` + + + + +### `setVar(object $obj, string $var, mixed $val): void` + +Sets a private variable in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name +* `$val`: `mixed` Attribute value + + + +### `setWebTemplate(string $template): mixed` + +Set web template. + + +Parameters: +* `$template`: `string` Template + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setWebhook(string $hook_url, string $pem_path): mixed` + +Set webhook update handler. + + +Parameters: +* `$hook_url`: `string` Webhook URL +* `$pem_path`: `string` PEM path for self-signed certificate + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setupLogger(): mixed` + +Setup logger. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `sleep(int|float $time): \Amp\Promise` + +Asynchronously sleep. + + +Parameters: +* `$time`: `int|float` Number of seconds to sleep for + + +#### See also: +* `\Amp\Promise` + + + + +### `some((\Promise|\Generator)[] $promises): \Amp\Promise` + +Resolves with a two-item array delineating successful and failed Promise results. +The returned promise will only fail if the given number of required promises fail. + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `start(): \Amp\Promise` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Amp\Promise` + + + + +### `stop(): void` + +Stop update loop. + + + +### `tdToMTProto(array $params): \Amp\Promise` + +Convert TD to MTProto parameters. + + +Parameters: +* `$params`: `array` Parameters + + +#### See also: +* `\Amp\Promise` + + + + +### `tdToTdcli(mixed $params): mixed` + +Convert TD parameters to tdcli. + + +Parameters: +* `$params`: `mixed` Parameters + + + +### `tdcliToTd(array $params, array $key): mixed` + +Convert tdcli parameters to tdcli. + + +Parameters: +* `$params`: `array` Params +* `$key`: `array` Key + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` + +Create an artificial timeout for any \Generator or Promise. + + +Parameters: +* `$promise`: `\Generator|\Promise` +* `$timeout`: `int` + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` + +Creates an artificial timeout for any `Promise`. +If the promise is resolved before the timeout expires, the result is returned + +If the timeout expires before the promise is resolved, a default value is returned + +Parameters: +* `$promise`: `\Promise|\Generator` Promise to which the timeout is applied. + Full type: + ``` + \Promise<\TReturn>|\TGenerator + ``` +* `$timeout`: `int` Timeout in milliseconds. +* `$default`: `mixed` + Full type: + ``` + \TReturnAlt + ``` + + +#### See also: +* `\Promise` +* `\Generator` +* `\TReturn` +* `\TGenerator` +* `\TReturnAlt` +* `\Amp\Promise` + + + + +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `toSupergroup(int $id): float|int` + +Convert MTProto channel ID to bot API channel ID. + + +Parameters: +* `$id`: `int` MTProto channel ID + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `unpackDouble(string $value): float` + +Unpack binary double. + + +Parameters: +* `$value`: `string` Value to unpack + + + +### `unpackFileId(string $fileId): mixed` + +Unpack bot API file ID. + + +Parameters: +* `$fileId`: `string` Bot API file ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `unpackSignedInt(string $value): int` + +Unpack base256 signed int. + + +Parameters: +* `$value`: `string` base256 int + + + +### `unpackSignedLong(string $value): int` + +Unpack base256 signed long. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unpackSignedLongString(string $value): string` + +Unpack base256 signed long to string. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unsetEventHandler(bool $disableUpdateHandling): mixed` + +Unset event handler. + + +Parameters: +* `$disableUpdateHandling`: `bool` Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler) + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `update2fa(array $params): \Amp\Promise` + +Update the 2FA password. +The params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` The params + + +#### See also: +* `\Amp\Promise` + + + + +### `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Amp\Promise` + +Parse, update and store settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` +* `\Amp\Promise` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Amp\Promise` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Amp\Promise` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Amp\Promise` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` + +Synchronously wait for a promise|generator. + + +Parameters: +* `$promise`: `\Generator|\Promise` The promise to wait for +* `$ignoreSignal`: `bool` Whether to ignore shutdown signals + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `async(bool $async): void` + +Enable or disable async. + + +Parameters: +* `$async`: `bool` Whether to enable or disable async + + + +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + +### `getWebAPITemplate(): string` + +Get web API login HTML template string. + + + +### `setWebAPITemplate(): void` + +Set web API login HTML template string. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/ApiWrappers/Start.md b/docs/PHPInternal/danog/MadelineProto/ApiWrappers/Start.md new file mode 100644 index 00000000..a9799798 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/ApiWrappers/Start.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\ApiWrappers\Start: Manages simple logging in and out. +description: + +--- +# `danog\MadelineProto\ApiWrappers\Start` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages simple logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Async/AsyncConstruct.md b/docs/PHPInternal/danog/MadelineProto/Async/AsyncConstruct.md new file mode 100644 index 00000000..f0693c35 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Async/AsyncConstruct.md @@ -0,0 +1,58 @@ +--- +title: danog\MadelineProto\Async\AsyncConstruct: Async constructor class. +description: Manages asynchronous construction and wakeup of classes + +--- +# `danog\MadelineProto\Async\AsyncConstruct` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Async constructor class. + +Manages asynchronous construction and wakeup of classes + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` + +## Methods: +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Connection.md b/docs/PHPInternal/danog/MadelineProto/Connection.md new file mode 100644 index 00000000..250cd83b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Connection.md @@ -0,0 +1,481 @@ +--- +title: danog\MadelineProto\Connection: Connection class. +description: Manages connection to Telegram datacenters + +--- +# `danog\MadelineProto\Connection` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Connection class. + +Manages connection to Telegram datacenters + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `needReconnect(bool $needsReconnect): void` +* `shouldReconnect(): bool` +* `writing(bool $writing): void` +* `reading(bool $reading): void` +* `haveRead(): void` +* `getLastChunk(): float` +* `httpReceived(): void` +* `countHttpReceived(): int` +* `httpSent(): void` +* `countHttpSent(): int` +* `getID(): int` +* `getDatacenterID(): string` +* `getCtx(): \danog\MadelineProto\Stream\ConnectionContext` +* `isHttp(): bool` +* `isMedia(): bool` +* `isCDN(): bool` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `sendMessage(array $message, bool $flush): \Generator` +* `flush(): void` +* `pingHttpWaiter(): void` +* `setExtra(\danog\MadelineProto\DataCenterConnection $extra, int $id): void` +* `getExtra(): \danog\MadelineProto\MTProto` +* `getShared(): \danog\MadelineProto\DataCenterConnection` +* `disconnect(bool $temporary): void` +* `reconnect(): \Generator` +* `getName(): string` +* `resetSession(): void` +* `createSession(): void` +* `backupSession(): array` +* `ackOutgoingMessageId(string|int $message_id): bool` +* `gotResponseForOutgoingMessageId(string|int $message_id): bool` +* `ackIncomingMessageId(string|int $message_id): bool` +* `hasPendingCalls(): bool` +* `getPendingCalls(): array` +* `handleReject(array $request, \Throwable $data): void` +* `handleResponse(): void` +* `methodRecall(string $watcherId, array $args): void` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` +* `objectCall(string $object, array $args, array $aargs): \Generator` +* `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +## Methods: +### `needReconnect(bool $needsReconnect): void` + +Indicate if this socket needs to be reconnected. + + +Parameters: +* `$needsReconnect`: `bool` Whether the socket has to be reconnected + + + +### `shouldReconnect(): bool` + +Whether this sockets needs to be reconnected. + + + +### `writing(bool $writing): void` + +Set writing boolean. + + +Parameters: +* `$writing`: `bool` + + + +### `reading(bool $reading): void` + +Set reading boolean. + + +Parameters: +* `$reading`: `bool` + + + +### `haveRead(): void` + +Tell the class that we have read a chunk of data from the socket. + + + +### `getLastChunk(): float` + +Get the receive date of the latest chunk of data from the socket. + + + +### `httpReceived(): void` + +Indicate a received HTTP response. + + + +### `countHttpReceived(): int` + +Count received HTTP responses. + + + +### `httpSent(): void` + +Indicate a sent HTTP request. + + + +### `countHttpSent(): int` + +Count sent HTTP requests. + + + +### `getID(): int` + +Get connection ID. + + + +### `getDatacenterID(): string` + +Get datacenter concatenated with connection ID. + + + +### `getCtx(): \danog\MadelineProto\Stream\ConnectionContext` + +Get connection context. + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./Stream/ConnectionContext.md) + + + + +### `isHttp(): bool` + +Check if is an HTTP connection. + + + +### `isMedia(): bool` + +Check if is a media connection. + + + +### `isCDN(): bool` + +Check if is a CDN connection. + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connects to a telegram DC using the specified protocol, proxy and connection parameters. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./Stream/ConnectionContext.md) +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](./Stream/StreamInterface.md) +* `\Generator` + + + + +### `sendMessage(array $message, bool $flush): \Generator` + +Send an MTProto message. +Structure of message array: +[ + // only in outgoing messages + 'body' => deserialized body, (optional if container) + 'serialized_body' => 'serialized body', (optional if container) + 'contentRelated' => bool, + '_' => 'predicate', + 'promise' => deferred promise that gets resolved when a response to the message is received (optional), + 'send_promise' => deferred promise that gets resolved when the message is sent (optional), + 'file' => bool (optional), + 'type' => 'type' (optional), + 'queue' => queue ID (optional), + 'container' => [message ids] (optional), + + // only in incoming messages + 'content' => deserialized body, + 'seq_no' => number (optional), + 'from_container' => bool (optional), + + // can be present in both + 'response' => message id (optional), + 'msg_id' => message id (optional), + 'sent' => timestamp, + 'tries' => number +] + +Parameters: +* `$message`: `array` The message to send +* `$flush`: `bool` Whether to flush the message right away + + +#### See also: +* `\Generator` + + + + +### `flush(): void` + +Flush pending packets. + + + +### `pingHttpWaiter(): void` + +Resume HttpWaiter. + + + +### `setExtra(\danog\MadelineProto\DataCenterConnection $extra, int $id): void` + +Connect main instance. + + +Parameters: +* `$extra`: `\danog\MadelineProto\DataCenterConnection` Shared instance +* `$id`: `int` Connection ID + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `getExtra(): \danog\MadelineProto\MTProto` + +Get main instance. + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `getShared(): \danog\MadelineProto\DataCenterConnection` + +Get shared connection instance. + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `disconnect(bool $temporary): void` + +Disconnect from DC. + + +Parameters: +* `$temporary`: `bool` Whether the disconnection is temporary, triggered by the reconnect method + + + +### `reconnect(): \Generator` + +Reconnect to DC. + + +#### See also: +* `\Generator` + + + + +### `getName(): string` + +Get name. + + + +### `resetSession(): void` + +Reset MTProto session. + + + +### `createSession(): void` + +Create MTProto session if needed. + + + +### `backupSession(): array` + +Backup eventual unsent messages before session deletion. + + + +### `ackOutgoingMessageId(string|int $message_id): bool` + +Acknowledge outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message Id + + + +### `gotResponseForOutgoingMessageId(string|int $message_id): bool` + +We have gotten response for outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `ackIncomingMessageId(string|int $message_id): bool` + +Acknowledge incoming message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `hasPendingCalls(): bool` + +Check if there are some pending calls. + + + +### `getPendingCalls(): array` + +Get all pending calls (also clear pending state requests). + + + +### `handleReject(array $request, \Throwable $data): void` + +Reject request with exception. + + +Parameters: +* `$request`: `array` Request +* `$data`: `\Throwable` Exception + + +#### See also: +* `\Throwable` + + + + +### `handleResponse(): void` + + + + + +### `methodRecall(string $watcherId, array $args): void` + +Recall method. + + +Parameters: +* `$watcherId`: `string` Watcher ID for defer +* `$args`: `array` Args + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent (generator). + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `objectCall(string $object, array $args, array $aargs): \Generator` + +Send object and make sure it is asynchronously sent (generator). + + +Parameters: +* `$object`: `string` Object name +* `$args`: `array` Arguments +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +Send state info for message IDs. + + +Parameters: +* `$req_msg_id`: `string|int` Message ID of msgs_state_req that initiated this +* `$msg_ids`: `array` Message IDs to send info about + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Coroutine.md b/docs/PHPInternal/danog/MadelineProto/Coroutine.md new file mode 100644 index 00000000..4c5560f9 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Coroutine.md @@ -0,0 +1,85 @@ +--- +title: danog\MadelineProto\Coroutine: Creates a promise from a generator function yielding promises. +description: When a promise is yielded, execution of the generator is interrupted until the promise is resolved. A success +value is sent into the generator, while a failure reason is thrown into the generator. Using a coroutine, +asynchronous code can be written without callbacks and be structured like synchronous code. + +--- +# `danog\MadelineProto\Coroutine` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Creates a promise from a generator function yielding promises. + +When a promise is yielded, execution of the generator is interrupted until the promise is resolved. A success +value is sent into the generator, while a failure reason is thrown into the generator. Using a coroutine, +asynchronous code can be written without callbacks and be structured like synchronous code. + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `fail(\Throwable $reason): void` +* `offsetGet(mixed $offset): \Amp\Promise` +* `getTrace(): array` +* `getFrame(): array` +* `jsonSerialize(): string` +* `onResolve()` + +## Methods: +### `fail(\Throwable $reason): void` + + + + +Parameters: +* `$reason`: `\Throwable` Failure reason. + + +#### See also: +* `\Throwable` + + + + +### `offsetGet(mixed $offset): \Amp\Promise` + +Get data at an array offset asynchronously. + + +Parameters: +* `$offset`: `mixed` Offset + + +#### See also: +* `\Amp\Promise` + + + + +### `getTrace(): array` + +Get current stack trace for running coroutine. + + + +### `getFrame(): array` + +Get current execution frame. + + + +### `jsonSerialize(): string` + +Obtain. + + + +### `onResolve()` + + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/DataCenter.md b/docs/PHPInternal/danog/MadelineProto/DataCenter.md new file mode 100644 index 00000000..0d240a63 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/DataCenter.md @@ -0,0 +1,285 @@ +--- +title: danog\MadelineProto\DataCenter: Manages datacenters. +description: + +--- +# `danog\MadelineProto\DataCenter` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Manages datacenters. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setDataCenterConnections(array $saved): void` +* `setVoIPEndpoints(array $endpoints): void` +* `dcConnect(string $dc_number, int $id): \Generator` +* `generateContexts(int $dc_number, string $uri, \Amp\Socket\ConnectContext $context): array` +* `getAPI(): \danog\MadelineProto\MTProto` +* `getHTTPClient(): \Amp\Http\Client\HttpClient` +* `getCookieJar(): \Amp\Http\Client\Cookie\CookieJar` +* `getDNSClient(): \Amp\Dns\Resolver` +* `getNonProxiedDNSClient(): \Amp\Dns\Resolver` +* `fileGetContents(string $url): \Generator` +* `getAuthConnection(string $dc): \danog\MadelineProto\Connection` +* `getConnection(string $dc): \danog\MadelineProto\Connection` +* `waitGetConnection(string $dc): \Generator` +* `getDataCenterConnection(string $dc): \danog\MadelineProto\DataCenterConnection` +* `getDataCenterConnections(): array` +* `has(string $dc): bool` +* `isHttp(string $datacenter): bool` +* `byIPAddress(string $datacenter): bool` +* `getDcs(bool $all): array` + +## Methods: +### `setDataCenterConnections(array $saved): void` + +Set auth key information from saved auth array. + + +Parameters: +* `$saved`: `array` Saved auth array + + + +### `setVoIPEndpoints(array $endpoints): void` + +Set VoIP endpoints. + + +Parameters: +* `$endpoints`: `array` Endpoints + + + +### `dcConnect(string $dc_number, int $id): \Generator` + +Connect to specified DC. + + +Parameters: +* `$dc_number`: `string` DC to connect to +* `$id`: `int` Connection ID to re-establish (optional) + + +#### See also: +* `\Generator` + + + + +### `generateContexts(int $dc_number, string $uri, \Amp\Socket\ConnectContext $context): array` + +Generate contexts. + + +Parameters: +* `$dc_number`: `int` DC ID to generate contexts for +* `$uri`: `string` URI +* `$context`: `\Amp\Socket\ConnectContext` Connection context + + +#### See also: +* `\Amp\Socket\ConnectContext` + + + + +### `getAPI(): \danog\MadelineProto\MTProto` + +Get main API. + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `getHTTPClient(): \Amp\Http\Client\HttpClient` + +Get async HTTP client. + + +#### See also: +* `\Amp\Http\Client\HttpClient` + + + + +### `getCookieJar(): \Amp\Http\Client\Cookie\CookieJar` + +Get async HTTP client cookies. + + +#### See also: +* `\Amp\Http\Client\Cookie\CookieJar` + + + + +### `getDNSClient(): \Amp\Dns\Resolver` + +Get DNS over HTTPS async DNS client. + + +#### See also: +* `\Amp\Dns\Resolver` + + + + +### `getNonProxiedDNSClient(): \Amp\Dns\Resolver` + +Get non-proxied DNS over HTTPS async DNS client. + + +#### See also: +* `\Amp\Dns\Resolver` + + + + +### `fileGetContents(string $url): \Generator` + +Get contents of file. + + +Parameters: +* `$url`: `string` URL to fetch + + +Fully typed return value: +``` +\Generator, mixed, string> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getAuthConnection(string $dc): \danog\MadelineProto\Connection` + +Get Connection instance for authorization. + + +Parameters: +* `$dc`: `string` DC ID + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) + + + + +### `getConnection(string $dc): \danog\MadelineProto\Connection` + +Get Connection instance. + + +Parameters: +* `$dc`: `string` DC ID + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) + + + + +### `waitGetConnection(string $dc): \Generator` + +Get Connection instance asynchronously. + + +Parameters: +* `$dc`: `string` DC ID + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) +* `\Generator` + + + + +### `getDataCenterConnection(string $dc): \danog\MadelineProto\DataCenterConnection` + +Get DataCenterConnection instance. + + +Parameters: +* `$dc`: `string` DC ID + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `getDataCenterConnections(): array` + +Get all DataCenterConnection instances. + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `has(string $dc): bool` + +Check if a DC is present. + + +Parameters: +* `$dc`: `string` DC ID + + + +### `isHttp(string $datacenter): bool` + +Check if connected to datacenter using HTTP. + + +Parameters: +* `$datacenter`: `string` DC ID + + + +### `byIPAddress(string $datacenter): bool` + +Check if connected to datacenter directly using IP address. + + +Parameters: +* `$datacenter`: `string` DC ID + + + +### `getDcs(bool $all): array` + +Get all DC IDs. + + +Parameters: +* `$all`: `bool` Whether to get all possible DC IDs, or only connected ones + + + diff --git a/docs/PHPInternal/danog/MadelineProto/DataCenterConnection.md b/docs/PHPInternal/danog/MadelineProto/DataCenterConnection.md new file mode 100644 index 00000000..92b33878 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/DataCenterConnection.md @@ -0,0 +1,478 @@ +--- +title: danog\MadelineProto\DataCenterConnection: Datacenter connection. +description: + +--- +# `danog\MadelineProto\DataCenterConnection` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Datacenter connection. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\DataCenterConnection::READ_WEIGHT`: + +* `danog\MadelineProto\DataCenterConnection::READ_WEIGHT_MEDIA`: + +* `danog\MadelineProto\DataCenterConnection::WRITE_WEIGHT`: + + +## Method list: +* `needReconnect(bool $needsReconnect): void` +* `shouldReconnect(): bool` +* `getAuthKey(bool $temp): \danog\MadelineProto\MTProto\AuthKey` +* `hasAuthKey(bool $temp): bool` +* `setAuthKey(\danog\MadelineProto\MTProto\AuthKey|null $key, bool $temp): void` +* `getTempAuthKey(): \danog\MadelineProto\MTProto\TempAuthKey` +* `getPermAuthKey(): \danog\MadelineProto\MTProto\PermAuthKey` +* `hasTempAuthKey(): bool` +* `hasPermAuthKey(): bool` +* `setTempAuthKey(\danog\MadelineProto\MTProto\TempAuthKey|null $key): void` +* `setPermAuthKey(\danog\MadelineProto\MTProto\PermAuthKey|null $key): void` +* `bind(bool $pfs): void` +* `isBound(): bool` +* `isAuthorized(): bool` +* `authorized(bool $authorized): void` +* `link(string $dc): void` +* `resetSession(): void` +* `createSession(): void` +* `flush(): void` +* `getCtx(): \danog\MadelineProto\Stream\ConnectionContext` +* `hasCtx(): bool` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx, int $id): \Generator` +* `signalDisconnect(int $id): void` +* `disconnect(): void` +* `reconnect(): \Generator` +* `restoreBackup(): void` +* `getAuthConnection(): \danog\MadelineProto\Connection` +* `hasConnection(int $id): bool|int` +* `waitGetConnection(): \Generator` +* `getConnection(int $id): \danog\MadelineProto\Connection` +* `even(): void` +* `reading(bool $reading, int $x): void` +* `writing(bool $writing, int $x): void` +* `setExtra(\danog\MadelineProto\MTProto $API): void` +* `getExtra(): \danog\MadelineProto\MTProto` +* `isHttp(): bool` +* `byIPAddress(): bool` +* `isMedia(): bool` +* `isCDN(): bool` +* `getSettings(): \danog\MadelineProto\Settings\Connection` +* `getGenericSettings(): \danog\MadelineProto\Settings` +* `jsonSerialize(): array` + +## Methods: +### `needReconnect(bool $needsReconnect): void` + +Indicate if this socket needs to be reconnected. + + +Parameters: +* `$needsReconnect`: `bool` Whether the socket has to be reconnected + + + +### `shouldReconnect(): bool` + +Whether this sockets needs to be reconnected. + + + +### `getAuthKey(bool $temp): \danog\MadelineProto\MTProto\AuthKey` + +Get auth key. + + +Parameters: +* `$temp`: `bool` Whether to fetch the temporary auth key + + +#### See also: +* [`\danog\MadelineProto\MTProto\AuthKey`: MTProto auth key.](./MTProto/AuthKey.md) + + + + +### `hasAuthKey(bool $temp): bool` + +Check if auth key is present. + + +Parameters: +* `$temp`: `bool` + + + +### `setAuthKey(\danog\MadelineProto\MTProto\AuthKey|null $key, bool $temp): void` + +Set auth key. + + +Parameters: +* `$key`: `\danog\MadelineProto\MTProto\AuthKey|null` The auth key +* `$temp`: `bool` + + +#### See also: +* [`\danog\MadelineProto\MTProto\AuthKey`: MTProto auth key.](./MTProto/AuthKey.md) + + + + +### `getTempAuthKey(): \danog\MadelineProto\MTProto\TempAuthKey` + +Get temporary authorization key. + + +#### See also: +* [`\danog\MadelineProto\MTProto\TempAuthKey`: MTProto temporary auth key.](./MTProto/TempAuthKey.md) + + + + +### `getPermAuthKey(): \danog\MadelineProto\MTProto\PermAuthKey` + +Get permanent authorization key. + + +#### See also: +* [`\danog\MadelineProto\MTProto\PermAuthKey`: MTProto permanent auth key.](./MTProto/PermAuthKey.md) + + + + +### `hasTempAuthKey(): bool` + +Check if has temporary authorization key. + + + +### `hasPermAuthKey(): bool` + +Check if has permanent authorization key. + + + +### `setTempAuthKey(\danog\MadelineProto\MTProto\TempAuthKey|null $key): void` + +Set temporary authorization key. + + +Parameters: +* `$key`: `\danog\MadelineProto\MTProto\TempAuthKey|null` Auth key + + +#### See also: +* [`\danog\MadelineProto\MTProto\TempAuthKey`: MTProto temporary auth key.](./MTProto/TempAuthKey.md) + + + + +### `setPermAuthKey(\danog\MadelineProto\MTProto\PermAuthKey|null $key): void` + +Set permanent authorization key. + + +Parameters: +* `$key`: `\danog\MadelineProto\MTProto\PermAuthKey|null` Auth key + + +#### See also: +* [`\danog\MadelineProto\MTProto\PermAuthKey`: MTProto permanent auth key.](./MTProto/PermAuthKey.md) + + + + +### `bind(bool $pfs): void` + +Bind temporary and permanent auth keys. + + +Parameters: +* `$pfs`: `bool` Whether to bind using PFS + + + +### `isBound(): bool` + +Check if auth keys are bound. + + + +### `isAuthorized(): bool` + +Check if we are logged in. + + + +### `authorized(bool $authorized): void` + +Set the authorized boolean. + + +Parameters: +* `$authorized`: `bool` Whether we are authorized + + + +### `link(string $dc): void` + +Link permanent authorization info of main DC to media DC. + + +Parameters: +* `$dc`: `string` Main DC ID + + + +### `resetSession(): void` + +Reset MTProto sessions. + + + +### `createSession(): void` + +Create MTProto sessions if needed. + + + +### `flush(): void` + +Flush all pending packets. + + + +### `getCtx(): \danog\MadelineProto\Stream\ConnectionContext` + +Get connection context. + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./Stream/ConnectionContext.md) + + + + +### `hasCtx(): bool` + +Has connection context? + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx, int $id): \Generator` + +Connect function. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context +* `$id`: `int` Optional connection ID to reconnect + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./Stream/ConnectionContext.md) +* `\Generator` + + + + +### `signalDisconnect(int $id): void` + +Signal that a connection ID disconnected. + + +Parameters: +* `$id`: `int` Connection ID + + + +### `disconnect(): void` + +Close all connections to DC. + + + +### `reconnect(): \Generator` + +Reconnect to DC. + + +#### See also: +* `\Generator` + + + + +### `restoreBackup(): void` + +Restore backed up messages. + + + +### `getAuthConnection(): \danog\MadelineProto\Connection` + +Get connection for authorization. + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) + + + + +### `hasConnection(int $id): bool|int` + +Check if any connection is available. + + +Parameters: +* `$id`: `int` Connection ID + + + +### `waitGetConnection(): \Generator` + +Get best socket in round robin, asynchronously. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) +* `\Generator` + + + + +### `getConnection(int $id): \danog\MadelineProto\Connection` + +Get best socket in round robin. + + +Parameters: +* `$id`: `int` Connection ID, for manual fetching + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](./Connection.md) + + + + +### `even(): void` + +Even out round robin values. + + + +### `reading(bool $reading, int $x): void` + +Indicate that one of the sockets is busy reading. + + +Parameters: +* `$reading`: `bool` Whether we're busy reading +* `$x`: `int` Connection ID + + + +### `writing(bool $writing, int $x): void` + +Indicate that one of the sockets is busy writing. + + +Parameters: +* `$writing`: `bool` Whether we're busy writing +* `$x`: `int` Connection ID + + + +### `setExtra(\danog\MadelineProto\MTProto $API): void` + +Set main instance. + + +Parameters: +* `$API`: `\danog\MadelineProto\MTProto` Main instance + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `getExtra(): \danog\MadelineProto\MTProto` + +Get main instance. + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `isHttp(): bool` + +Check if is an HTTP connection. + + + +### `byIPAddress(): bool` + +Check if is connected directly by IP address. + + + +### `isMedia(): bool` + +Check if is a media connection. + + + +### `isCDN(): bool` + +Check if is a CDN connection. + + + +### `getSettings(): \danog\MadelineProto\Settings\Connection` + +Get DC-specific settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Connection`: Connection settings.](./Settings/Connection.md) + + + + +### `getGenericSettings(): \danog\MadelineProto\Settings` + +Get global settings. + + +#### See also: +* [`\danog\MadelineProto\Settings`: Settings class used for configuring MadelineProto.](./Settings.md) + + + + +### `jsonSerialize(): array` + +JSON serialize function. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/ArrayCacheTrait.md b/docs/PHPInternal/danog/MadelineProto/Db/ArrayCacheTrait.md new file mode 100644 index 00000000..03bcbeb7 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/ArrayCacheTrait.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Db\ArrayCacheTrait: Array caching trait. +description: + +--- +# `danog\MadelineProto\Db\ArrayCacheTrait` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Array caching trait. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Db/DbArray.md b/docs/PHPInternal/danog/MadelineProto/Db/DbArray.md new file mode 100644 index 00000000..0383aa6f --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/DbArray.md @@ -0,0 +1,154 @@ +--- +title: danog\MadelineProto\Db\DbArray: DB array interface. +description: + +--- +# `danog\MadelineProto\Db\DbArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +DB array interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getArrayCopy(): \Amp\Promise` +* `isset(string|int $key): \Amp\Promise` +* `offsetGet(string|int $index): \Amp\Promise` +* `offsetSet(string|int $index, mixed $value): void` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Amp\Promise` +* `getIterator()` +* `getInstance(string $table, null|\danog\MadelineProto\Db\DbType|array $value, \danog\MadelineProto\Settings\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `getArrayCopy(): \Amp\Promise` + +Get Array copy. + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `isset(string|int $key): \Amp\Promise` + +Check if element is set. + + +Parameters: +* `$key`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `offsetGet(string|int $index): \Amp\Promise` + +Get element. + + +Parameters: +* `$index`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise<\T> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `offsetSet(string|int $index, mixed $value): void` + +Set element. + + +Parameters: +* `$index`: `string|int` +* `$value`: `mixed` + Full type: + ``` + \T + ``` + + +#### See also: +* `\T` + + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset element. + + +Parameters: +* `$index`: `string|int` Offset + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Amp\Promise` + +Count number of elements. + + +#### See also: +* `\Amp\Promise` + + + + +### `getIterator()` + +Get iterator. + + + +### `getInstance(string $table, null|\danog\MadelineProto\Db\DbType|array $value, \danog\MadelineProto\Settings\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `null|\danog\MadelineProto\Db\DbType|array` +* `$settings`: `\danog\MadelineProto\Settings\DatabaseAbstract` + + +#### See also: +* [`\danog\MadelineProto\Settings\DatabaseAbstract`: Base class for storage backends.](../Settings/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/DbPropertiesFactory.md b/docs/PHPInternal/danog/MadelineProto/Db/DbPropertiesFactory.md new file mode 100644 index 00000000..d41e54cd --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/DbPropertiesFactory.md @@ -0,0 +1,23 @@ +--- +title: danog\MadelineProto\Db\DbPropertiesFactory: This factory class initializes the correct database backend for MadelineProto. +description: + +--- +# `danog\MadelineProto\Db\DbPropertiesFactory` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +This factory class initializes the correct database backend for MadelineProto. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Db\DbPropertiesFactory::TYPE_ARRAY`: Indicates a simple K-V array stored in a database backend. + + Values can be objects or other arrays, but when lots of nesting is required, it's best to split the array into multiple arrays. + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/DbPropertiesTrait.md b/docs/PHPInternal/danog/MadelineProto/Db/DbPropertiesTrait.md new file mode 100644 index 00000000..6acb1655 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/DbPropertiesTrait.md @@ -0,0 +1,24 @@ +--- +title: danog\MadelineProto\Db\DbPropertiesTrait: Include this trait and call DbPropertiesTrait::initDb to use MadelineProto's database backend for properties. +description: You will have to define a `$dbProperties` static array property, with a list of properties you want to store to a database. + +--- +# `danog\MadelineProto\Db\DbPropertiesTrait` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Include this trait and call DbPropertiesTrait::initDb to use MadelineProto's database backend for properties. + +You will have to define a `$dbProperties` static array property, with a list of properties you want to store to a database. + +#### See also: +* [For a list of allowed property types](./DbPropertiesFactory.md) + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). ## Properties +* `$dbProperties`: `array` \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Db/Driver/Mysql.md b/docs/PHPInternal/danog/MadelineProto/Db/Driver/Mysql.md new file mode 100644 index 00000000..d9b69a86 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/Driver/Mysql.md @@ -0,0 +1,44 @@ +--- +title: danog\MadelineProto\Db\Driver\Mysql: MySQL driver wrapper. +description: + +--- +# `danog\MadelineProto\Db\Driver\Mysql` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +MySQL driver wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator<\Amp\Mysql\Pool>` + +## Methods: +### `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator<\Amp\Mysql\Pool>` + + + + +Parameters: +* `$host`: `string` +* `$port`: `int` +* `$user`: `string` +* `$password`: `string` +* `$db`: `string` +* `$maxConnections`: `int` +* `$idleTimeout`: `int` + + +#### See also: +* `\Amp\Mysql\Pool` +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/Driver/Postgres.md b/docs/PHPInternal/danog/MadelineProto/Db/Driver/Postgres.md new file mode 100644 index 00000000..3bc5b957 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/Driver/Postgres.md @@ -0,0 +1,44 @@ +--- +title: danog\MadelineProto\Db\Driver\Postgres: Postgres driver wrapper. +description: + +--- +# `danog\MadelineProto\Db\Driver\Postgres` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Postgres driver wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator<\Amp\Postgres\Pool>` + +## Methods: +### `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator<\Amp\Postgres\Pool>` + + + + +Parameters: +* `$host`: `string` +* `$port`: `int` +* `$user`: `string` +* `$password`: `string` +* `$db`: `string` +* `$maxConnections`: `int` +* `$idleTimeout`: `int` + + +#### See also: +* `\Amp\Postgres\Pool` +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/Driver/Redis.md b/docs/PHPInternal/danog/MadelineProto/Db/Driver/Redis.md new file mode 100644 index 00000000..e504c0d2 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/Driver/Redis.md @@ -0,0 +1,49 @@ +--- +title: danog\MadelineProto\Db\Driver\Redis: Redis driver wrapper. +description: + +--- +# `danog\MadelineProto\Db\Driver\Redis` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Redis driver wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator` + +## Methods: +### `getConnection(string $host, int $port, string $user, string $password, string $db, int $maxConnections, int $idleTimeout): \Generator` + + + + +Parameters: +* `$host`: `string` +* `$port`: `int` +* `$user`: `string` +* `$password`: `string` +* `$db`: `string` +* `$maxConnections`: `int` +* `$idleTimeout`: `int` + + +Fully typed return value: +``` +\Generator, mixed, \Amp\Redis\Redis> +``` +#### See also: +* `\Amp\Promise` +* `\Amp\Redis\Redis` +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/DriverArray.md b/docs/PHPInternal/danog/MadelineProto/Db/DriverArray.md new file mode 100644 index 00000000..0b77f424 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/DriverArray.md @@ -0,0 +1,154 @@ +--- +title: danog\MadelineProto\Db\DriverArray: Array caching trait. +description: + +--- +# `danog\MadelineProto\Db\DriverArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Array caching trait. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getArrayCopy(): \Amp\Promise` +* `isset(string|int $key): \Amp\Promise` +* `offsetGet(string|int $index): \Amp\Promise` +* `offsetSet(string|int $index, mixed $value): void` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Amp\Promise` +* `getIterator()` +* `getInstance(string $table, null|\danog\MadelineProto\Db\DbType|array $value, \danog\MadelineProto\Settings\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `getArrayCopy(): \Amp\Promise` + +Get Array copy. + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `isset(string|int $key): \Amp\Promise` + +Check if element is set. + + +Parameters: +* `$key`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `offsetGet(string|int $index): \Amp\Promise` + +Get element. + + +Parameters: +* `$index`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise<\T> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `offsetSet(string|int $index, mixed $value): void` + +Set element. + + +Parameters: +* `$index`: `string|int` +* `$value`: `mixed` + Full type: + ``` + \T + ``` + + +#### See also: +* `\T` + + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset element. + + +Parameters: +* `$index`: `string|int` Offset + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Amp\Promise` + +Count number of elements. + + +#### See also: +* `\Amp\Promise` + + + + +### `getIterator()` + +Get iterator. + + + +### `getInstance(string $table, null|\danog\MadelineProto\Db\DbType|array $value, \danog\MadelineProto\Settings\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `null|\danog\MadelineProto\Db\DbType|array` +* `$settings`: `\danog\MadelineProto\Settings\DatabaseAbstract` + + +#### See also: +* [`\danog\MadelineProto\Settings\DatabaseAbstract`: Base class for storage backends.](../Settings/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/MemoryArray.md b/docs/PHPInternal/danog/MadelineProto/Db/MemoryArray.md new file mode 100644 index 00000000..4a10822b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/MemoryArray.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Db\MemoryArray: Memory database backend. +description: + +--- +# `danog\MadelineProto\Db\MemoryArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Memory database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Db\MemoryArray::STD_PROP_LIST`: + +* `danog\MadelineProto\Db\MemoryArray::ARRAY_AS_PROPS`: + + +## Method list: +* `getInstance(string $table, mixed $value, \danog\MadelineProto\Settings\Database\Memory $settings): \Amp\Promise` + +## Methods: +### `getInstance(string $table, mixed $value, \danog\MadelineProto\Settings\Database\Memory $settings): \Amp\Promise` + +Get instance. + + +Parameters: +* `$table`: `string` +* `$value`: `mixed` +* `$settings`: `\danog\MadelineProto\Settings\Database\Memory` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Memory`: Memory backend settings.](../Settings/Database/Memory.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/MysqlArray.md b/docs/PHPInternal/danog/MadelineProto/Db/MysqlArray.md new file mode 100644 index 00000000..63ce89f9 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/MysqlArray.md @@ -0,0 +1,131 @@ +--- +title: danog\MadelineProto\Db\MysqlArray: MySQL database backend. +description: + +--- +# `danog\MadelineProto\Db\MysqlArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MySQL database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetSet(string|int $index, $value)` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `initConnection(\danog\MadelineProto\Settings\Database\Mysql $settings): \Generator` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetSet(string|int $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string|int`

+The index to set for. +

+* `$value`: `` + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string|int`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `initConnection(\danog\MadelineProto\Settings\Database\Mysql $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Mysql` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Mysql`: MySQL backend settings.](../Settings/Database/Mysql.md) +* `\Generator` + + + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/NullCache/MysqlArray.md b/docs/PHPInternal/danog/MadelineProto/Db/NullCache/MysqlArray.md new file mode 100644 index 00000000..cc9184a1 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/NullCache/MysqlArray.md @@ -0,0 +1,131 @@ +--- +title: danog\MadelineProto\Db\NullCache\MysqlArray: MySQL database backend, no caching. +description: + +--- +# `danog\MadelineProto\Db\NullCache\MysqlArray` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +MySQL database backend, no caching. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetSet(string|int $index, $value)` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `initConnection(\danog\MadelineProto\Settings\Database\Mysql $settings): \Generator` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetSet(string|int $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string|int`

+The index to set for. +

+* `$value`: `` + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string|int`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `initConnection(\danog\MadelineProto\Settings\Database\Mysql $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Mysql` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Mysql`: MySQL backend settings.](../Settings/Database/Mysql.md) +* `\Generator` + + + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/NullCache/PostgresArray.md b/docs/PHPInternal/danog/MadelineProto/Db/NullCache/PostgresArray.md new file mode 100644 index 00000000..34f0a08b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/NullCache/PostgresArray.md @@ -0,0 +1,143 @@ +--- +title: danog\MadelineProto\Db\NullCache\PostgresArray: Postgres database backend, no caching. +description: + +--- +# `danog\MadelineProto\Db\NullCache\PostgresArray` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Postgres database backend, no caching. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `initConnection(\danog\MadelineProto\Settings\Database\Postgres $settings): \Generator` +* `offsetSet(string $index, $value)` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetUnset(string $index): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `initConnection(\danog\MadelineProto\Settings\Database\Postgres $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Postgres` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Postgres`: Postgres backend settings.](../Settings/Database/Postgres.md) +* `\Generator` + + + + +### `offsetSet(string $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string`

+The index to set for. +

+* `$value`: `` + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetUnset(string $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get array copy. + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/NullCache/RedisArray.md b/docs/PHPInternal/danog/MadelineProto/Db/NullCache/RedisArray.md new file mode 100644 index 00000000..bd4b79a7 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/NullCache/RedisArray.md @@ -0,0 +1,143 @@ +--- +title: danog\MadelineProto\Db\NullCache\RedisArray: Redis database backend, no caching. +description: + +--- +# `danog\MadelineProto\Db\NullCache\RedisArray` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Redis database backend, no caching. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `initConnection(\danog\MadelineProto\Settings\Database\Redis $settings): \Generator` +* `offsetSet(string $index, $value)` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetUnset(string $index): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `initConnection(\danog\MadelineProto\Settings\Database\Redis $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Redis` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Redis`: Redis backend settings.](../Settings/Database/Redis.md) +* `\Generator` + + + + +### `offsetSet(string $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string`

+The index to set for. +

+* `$value`: `` + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetUnset(string $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get array copy. + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/PostgresArray.md b/docs/PHPInternal/danog/MadelineProto/Db/PostgresArray.md new file mode 100644 index 00000000..89abcd42 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/PostgresArray.md @@ -0,0 +1,143 @@ +--- +title: danog\MadelineProto\Db\PostgresArray: Postgres database backend. +description: + +--- +# `danog\MadelineProto\Db\PostgresArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Postgres database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `initConnection(\danog\MadelineProto\Settings\Database\Postgres $settings): \Generator` +* `offsetSet(string $index, $value)` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetUnset(string $index): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `initConnection(\danog\MadelineProto\Settings\Database\Postgres $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Postgres` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Postgres`: Postgres backend settings.](../Settings/Database/Postgres.md) +* `\Generator` + + + + +### `offsetSet(string $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string`

+The index to set for. +

+* `$value`: `` + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetUnset(string $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get array copy. + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/RedisArray.md b/docs/PHPInternal/danog/MadelineProto/Db/RedisArray.md new file mode 100644 index 00000000..42fedaf2 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/RedisArray.md @@ -0,0 +1,143 @@ +--- +title: danog\MadelineProto\Db\RedisArray: Redis database backend. +description: + +--- +# `danog\MadelineProto\Db\RedisArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Redis database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initStartup(): \Generator` +* `initConnection(\danog\MadelineProto\Settings\Database\Redis $settings): \Generator` +* `offsetSet(string $index, $value)` +* `isset( $key): \Promise true if the offset exists, otherwise false` +* `offsetUnset(string $index): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + +## Methods: +### `initStartup(): \Generator` + +Initialize on startup. + + +#### See also: +* `\Generator` + + + + +### `initConnection(\danog\MadelineProto\Settings\Database\Redis $settings): \Generator` + +Initialize connection. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Database\Redis` + + +#### See also: +* [`\danog\MadelineProto\Settings\Database\Redis`: Redis backend settings.](../Settings/Database/Redis.md) +* `\Generator` + + + + +### `offsetSet(string $index, $value)` + +Set value for an offset. + + +Parameters: +* `$index`: `string`

+The index to set for. +

+* `$value`: `` + + + +### `isset( $key): \Promise true if the offset exists, otherwise false` + +Check if key isset. + + +Parameters: +* `$key`: `` + + +Return value: true if the offset exists, otherwise false + + +### `offsetUnset(string $index): \Amp\Promise` + +Unset value for an offset. + + +Parameters: +* `$index`: `string`

+The offset to unset. +

+ + +#### See also: +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get array copy. + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Promise The number of elements or public properties in the associated +array or object, respectively.` + +Count elements. + + +Return value: The number of elements or public properties in the associated +array or object, respectively. + + +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Db/SqlArray.md b/docs/PHPInternal/danog/MadelineProto/Db/SqlArray.md new file mode 100644 index 00000000..88a27287 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Db/SqlArray.md @@ -0,0 +1,159 @@ +--- +title: danog\MadelineProto\Db\SqlArray: Generic SQL database backend. +description: + +--- +# `danog\MadelineProto\Db\SqlArray` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Generic SQL database backend. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` +* `getArrayCopy(): \Amp\Promise` +* `isset(string|int $key): \Amp\Promise` +* `offsetGet(string|int $index): \Amp\Promise` +* `offsetSet(string|int $index, mixed $value): void` +* `offsetUnset(string|int $index): \Amp\Promise` +* `count(): \Amp\Promise` +* `getIterator()` + +## Methods: +### `getInstance(string $table, \danog\MadelineProto\Db\DbArray|array|null $value, \danog\MadelineProto\Settings\Database\DatabaseAbstract $settings): \Amp\Promise` + + + + +Parameters: +* `$table`: `string` +* `$value`: `\danog\MadelineProto\Db\DbArray|array|null` +* `$settings`: `\danog\MadelineProto\Settings\Database\DatabaseAbstract` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\Db\DbArray`: DB array interface.](./DbArray.md) +* [`\danog\MadelineProto\Settings\Database\DatabaseAbstract`: Base class for database backends.](../Settings/Database/DatabaseAbstract.md) +* `\Amp\Promise` + + + + +### `getArrayCopy(): \Amp\Promise` + +Get Array copy. + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `isset(string|int $key): \Amp\Promise` + +Check if element is set. + + +Parameters: +* `$key`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `offsetGet(string|int $index): \Amp\Promise` + +Get element. + + +Parameters: +* `$index`: `string|int` + + +Fully typed return value: +``` +\Amp\Promise<\T> +``` +#### See also: +* `\T` +* `\Amp\Promise` + + + + +### `offsetSet(string|int $index, mixed $value): void` + +Set element. + + +Parameters: +* `$index`: `string|int` +* `$value`: `mixed` + Full type: + ``` + \T + ``` + + +#### See also: +* `\T` + + + + +### `offsetUnset(string|int $index): \Amp\Promise` + +Unset element. + + +Parameters: +* `$index`: `string|int` Offset + + +#### See also: +* `\Amp\Promise` + + + + +### `count(): \Amp\Promise` + +Count number of elements. + + +#### See also: +* `\Amp\Promise` + + + + +### `getIterator()` + +Get iterator. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/EventHandler.md b/docs/PHPInternal/danog/MadelineProto/EventHandler.md new file mode 100644 index 00000000..f45bd2c0 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/EventHandler.md @@ -0,0 +1,2713 @@ +--- +title: danog\MadelineProto\EventHandler: Event handler. +description: + +--- +# `danog\MadelineProto\EventHandler` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Event handler. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getReportPeers(): array|string|int` +* `getAPI(): \danog\MadelineProto\MTProto` +* `MTProtoToBotAPI(array $data): \Amp\Promise` +* `MTProtoToTd(mixed $params): \Amp\Promise` +* `MTProtoToTdcli(mixed $params): \Amp\Promise` +* `acceptCall(array $call): \Amp\Promise` +* `acceptSecretChat(array $params): \Amp\Promise` +* `acceptTos(): \Amp\Promise` +* `addUser(array $user): \Amp\Promise` +* `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` +* `all((\Generator|\Promise)[] $promises): \Amp\Promise` +* `any((\Promise|\Generator)[] $promises): \Amp\Promise` +* `arr(mixed $params): array` +* `base64urlDecode(string $data): string` +* `base64urlEncode(string $data): string` +* `botAPIToMTProto(array $arguments): \Amp\Promise` +* `botLogin(string $token): \Amp\Promise` +* `call(\Generator|\Promise|mixed $promise): \Amp\Promise` +* `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` +* `callForkDefer(\Generator|\Promise $promise): void` +* `callStatus(int $id): mixed` +* `checkTos(): \Amp\Promise` +* `cleanup(): \Amp\Promise` +* `closeConnection(string $message): void` +* `complete2faLogin(string $password): \Amp\Promise` +* `completeCall(array $params): \Amp\Promise` +* `completePhoneLogin(string $code): \Amp\Promise` +* `completeSignup(string $first_name, string $last_name): \Amp\Promise` +* `confirmCall(array $params): \Amp\Promise` +* `connectToAllDcs(bool $reconnectAll): \Amp\Promise` +* `declineTos(): \Amp\Promise` +* `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Amp\Promise` +* `discardSecretChat(int $chat): \Amp\Promise` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Amp\Promise` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Amp\Promise` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Amp\Promise` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Amp\Promise Downloaded file path` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Amp\Promise Returned response` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Amp\Promise` +* `echo(string $string): \Amp\Promise` +* `end(array $what): mixed` +* `exportAuthorization(): \Amp\Promise` +* `extractBotAPIFile(array $info): ?array` +* `fileGetContents(string $url): \Amp\Promise` +* `first((\Promise|\Generator)[] $promises): \Amp\Promise` +* `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` +* `fromSupergroup(int $id): float|int` +* `fullChatLastUpdated(mixed $id): \Amp\Promise` +* `fullGetSelf(): \Amp\Promise` +* `genVectorHash(array $ints): \int Vector hash` +* `getAllMethods(): mixed` +* `getAuthorization(): mixed` +* `getCachedConfig(): mixed` +* `getCall(int $call): mixed` +* `getCdnConfig(string $datacenter): \Amp\Promise` +* `getConfig(array $config, array $options): \Amp\Promise` +* `getDNSClient(): mixed` +* `getDataCenterConnections(): mixed` +* `getDataCenterId(): int|string` +* `getDialogs(bool $force): \Amp\Promise` +* `getDownloadInfo(mixed $messageMedia): \Amp\Promise` +* `getEventHandler(): mixed` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getFileInfo(mixed $constructor): \Amp\Promise` +* `getFolderId(mixed $id): ?int` +* `getFullDialogs(bool $force): \Amp\Promise` +* `getFullInfo(mixed $id): \Amp\Promise FullInfo object` +* `getHTTPClient(): mixed` +* `getHint(): mixed` +* `getId(mixed $id): int` +* `getInfo(mixed $id, bool $recursive): \Amp\Promise Info object` +* `getLogger()` +* `getMethodNamespaces(): mixed` +* `getMethodsNamespaced(): mixed` +* `getMimeFromBuffer(string $buffer): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getMimeFromFile(string $file): string` +* `getPropicInfo(mixed $messageMedia): \Amp\Promise` +* `getPsrLogger()` +* `getPwrChat(mixed $id): \Amp\Promise Chat object` +* `getSecretChat(array|int $chat): mixed` +* `getSelf(): array|bool` +* `getSettings(): mixed` +* `getTL(): mixed` +* `getVar(object $obj, string $var): mixed` +* `getWebTemplate(): mixed` +* `hasAllAuth(): mixed` +* `hasEventHandler(): mixed` +* `hasReportPeers(): mixed` +* `hasSecretChat(array|int $chat): mixed` +* `hasVar(object $obj, string $var): bool` +* `importAuthorization(mixed $authorization): \Amp\Promise` +* `inflateStripped(string $stripped): \string JPG payload` +* `initSelfRestart(): mixed` +* `isAltervista(): bool` +* `isArrayOrAlike(mixed $var): bool` +* `isIpc(): mixed` +* `isSupergroup(int $id): bool` +* `logger(string $param, int $level, string $file): mixed` +* `logout(): \Amp\Promise` +* `loop(callable|null $callback): \Amp\Promise` +* `loopFork(): \Amp\Promise` +* `markdownEscape(string $hwat): string` +* `mbStrSplit(string $text, int $length): array` +* `mbStrlen(string $text): float|int` +* `mbSubstr(string $text, int $offset, ?int $length): string` +* `methodCall(string $method, array|\Generator $args, array $aargs): \Amp\Promise` +* `methodCallWrite(string $method, array|\Generator $args, array $aargs): \Amp\Promise` +* `methodEscape(string $method): string` +* `packDouble(float $value): string` +* `packSignedInt(int $value): string` +* `packSignedLong(int $value): string` +* `packUnsignedInt(int $value): string` +* `peerIsset(mixed $id): \Amp\Promise` +* `phoneLogin(string $number, int $sms_type): \Amp\Promise` +* `posmod(int $a, int $b): \int Modulo` +* `random(int $length): \string Random string` +* `randomInt(int $modulus): int` +* `readLine(string $prompt): \Amp\Promise` +* `rekey(int $chat): \Amp\Promise` +* `report(string $message, string $parseMode): \Amp\Promise` +* `requestCall(mixed $user): \Amp\Promise` +* `requestSecretChat(mixed $user): \Amp\Promise` +* `resetUpdateState(): mixed` +* `resolveUsername(string $username): \Amp\Promise` +* `restart(): void` +* `rethrow(\Throwable $e, string $file): void` +* `rleDecode(string $string): string` +* `rleEncode(string $string): string` +* `secretChatStatus(int $chat): mixed` +* `serializeAll(): void` +* `setCallback(callable $callback): mixed` +* `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Amp\Promise` +* `setNoop(): mixed` +* `setReportPeers(int|string $userOrId): \Amp\Promise` +* `setVar(object $obj, string $var, mixed $val): void` +* `setWebTemplate(string $template): mixed` +* `setWebhook(string $hook_url, string $pem_path): mixed` +* `setupLogger(): mixed` +* `sleep(int|float $time): \Amp\Promise` +* `some((\Promise|\Generator)[] $promises): \Amp\Promise` +* `start(): \Amp\Promise` +* `stop(): void` +* `tdToMTProto(array $params): \Amp\Promise` +* `tdToTdcli(mixed $params): mixed` +* `tdcliToTd(array $params, array $key): mixed` +* `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` +* `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `toSupergroup(int $id): float|int` +* `typeEscape(string $type): string` +* `unpackDouble(string $value): float` +* `unpackFileId(string $fileId): mixed` +* `unpackSignedInt(string $value): int` +* `unpackSignedLong(string $value): int` +* `unpackSignedLongString(string $value): string` +* `unsetEventHandler(bool $disableUpdateHandling): mixed` +* `update2fa(array $params): \Amp\Promise` +* `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Amp\Promise` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Amp\Promise` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Amp\Promise` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Amp\Promise` +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` +* `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` +* `async(bool $async): void` +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` + +## Methods: +### `getReportPeers(): array|string|int` + +Get peers where to send error reports. + + + +### `getAPI(): \danog\MadelineProto\MTProto` + +Get API instance. + + +#### See also: +* [`\danog\MadelineProto\MTProto`: Manages all of the mtproto stuff.](./MTProto.md) + + + + +### `MTProtoToBotAPI(array $data): \Amp\Promise` + +Convert MTProto parameters to bot API parameters. + + +Parameters: +* `$data`: `array` Data + + +#### See also: +* `\Amp\Promise` + + + + +### `MTProtoToTd(mixed $params): \Amp\Promise` + +MTProto to TD params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `MTProtoToTdcli(mixed $params): \Amp\Promise` + +MTProto to TDCLI params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptCall(array $call): \Amp\Promise` + +Accept call. + + +Parameters: +* `$call`: `array` Call + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptSecretChat(array $params): \Amp\Promise` + +Accept secret chat. + + +Parameters: +* `$params`: `array` Secret chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `acceptTos(): \Amp\Promise` + +Accept terms of service update. + + +#### See also: +* `\Amp\Promise` + + + + +### `addUser(array $user): \Amp\Promise` + +Add user info. + + +Parameters: +* `$user`: `array` User info + + +#### See also: +* `\Amp\Promise` + + + + +### `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` + +Call promise $b after promise $a. + + +Parameters: +* `$a`: `\Generator|\Promise` Promise A +* `$b`: `\Generator|\Promise` Promise B + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `all((\Generator|\Promise)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when all promises succeed, and fails if any promise fails. +Returned promise succeeds with an array of values used to succeed each contained promise, with keys corresponding to the array of promises. + +Parameters: +* `$promises`: `(\Generator|\Promise)[]` Promises + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `any((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that is resolved when all promises are resolved. The returned promise will not fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `arr(mixed $params): array` + +Create array. + + +Parameters: +* `$params`: `mixed` Params + + + +### `base64urlDecode(string $data): string` + +base64URL decode. + + +Parameters: +* `$data`: `string` Data to decode + + + +### `base64urlEncode(string $data): string` + +Base64URL encode. + + +Parameters: +* `$data`: `string` Data to encode + + + +### `botAPIToMTProto(array $arguments): \Amp\Promise` + +Convert bot API parameters to MTProto parameters. + + +Parameters: +* `$arguments`: `array` Arguments + + +#### See also: +* `\Amp\Promise` + + + + +### `botLogin(string $token): \Amp\Promise` + +Login as bot. + + +Parameters: +* `$token`: `string` Bot token + + +#### See also: +* `\Amp\Promise` + + + + +### `call(\Generator|\Promise|mixed $promise): \Amp\Promise` + +Convert generator, promise or any other value to a promise. + + +Parameters: +* `$promise`: `\Generator|\Promise|mixed` + Full type: + ``` + \Generator|\Promise<\TReturn>|\TReturn + ``` + + +Fully typed return value: +``` +\Promise<\TReturn> +``` +#### See also: +* `\Generator` +* `\Promise` +* `\TReturn` +* `\Amp\Promise` + + + + +### `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` + +Call promise in background. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve +* `$actual`: `?\Generator|\Promise` Promise to resolve instead of $promise +* `$file`: `string` File + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `callForkDefer(\Generator|\Promise $promise): void` + +Call promise in background, deferring execution. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `callStatus(int $id): mixed` + +Get call status. + + +Parameters: +* `$id`: `int` Call ID + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `checkTos(): \Amp\Promise` + +Check for terms of service update. + + +#### See also: +* `\Amp\Promise` + + + + +### `cleanup(): \Amp\Promise` + +Cleanup memory and session file. + + +#### See also: +* `\Amp\Promise` + + + + +### `closeConnection(string $message): void` + +Close connection with client, connected via web. + + +Parameters: +* `$message`: `string` Message + + + +### `complete2faLogin(string $password): \Amp\Promise` + +Complete 2FA login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Amp\Promise` + + + + +### `completeCall(array $params): \Amp\Promise` + +Complete call handshake. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `completePhoneLogin(string $code): \Amp\Promise` + +Complet user login using login code. + + +Parameters: +* `$code`: `string` Login code + + +#### See also: +* `\Amp\Promise` + + + + +### `completeSignup(string $first_name, string $last_name): \Amp\Promise` + +Complete signup to Telegram. + + +Parameters: +* `$first_name`: `string` First name +* `$last_name`: `string` Last name + + +#### See also: +* `\Amp\Promise` + + + + +### `confirmCall(array $params): \Amp\Promise` + +Confirm call. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Amp\Promise` + + + + +### `connectToAllDcs(bool $reconnectAll): \Amp\Promise` + +Connects to all datacenters and if necessary creates authorization keys, binds them and writes client info. + + +Parameters: +* `$reconnectAll`: `bool` Whether to reconnect to all DCs + + +#### See also: +* `\Amp\Promise` + + + + +### `declineTos(): \Amp\Promise` + +Decline terms of service update. +THIS WILL DELETE YOUR ACCOUNT! + +#### See also: +* `\Amp\Promise` + + + + +### `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Amp\Promise` + +Discard call. + + +Parameters: +* `$call`: `array` Call +* `$reason`: `array` +* `$rating`: `array` Rating +* `$need_debug`: `bool` Need debug? + + +#### See also: +* `\Amp\Promise` + + + + +### `discardSecretChat(int $chat): \Amp\Promise` + +Discard secret chat. + + +Parameters: +* `$chat`: `int` Secret chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Amp\Promise` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Amp\Promise` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Amp\Promise` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Amp\Promise` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Amp\Promise Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Amp\Promise Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Amp\Promise<\Amp\Http\Server\Response> +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Amp\Promise` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Amp\Promise` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `echo(string $string): \Amp\Promise` + +Asynchronously write to stdout/browser. + + +Parameters: +* `$string`: `string` Message to echo + + +#### See also: +* `\Amp\Promise` + + + + +### `end(array $what): mixed` + +Get final element of array. + + +Parameters: +* `$what`: `array` Array + + + +### `exportAuthorization(): \Amp\Promise` + +Export authorization. + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `extractBotAPIFile(array $info): ?array` + +Extract file info from bot API message. + + +Parameters: +* `$info`: `array` Bot API message object + + + +### `fileGetContents(string $url): \Amp\Promise` + +Get contents of remote file asynchronously. + + +Parameters: +* `$url`: `string` URL + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `first((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when the first promise succeeds, and fails only if all promises fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` + +Asynchronously lock a file +Resolves with a callbable that MUST eventually be called in order to release the lock. + + +Parameters: +* `$file`: `string` File to lock +* `$operation`: `int` Locking mode +* `$polling`: `float` Polling interval +* `$token`: `?\Promise` Cancellation token +* `$failureCb`: `?callable` Failure callback, called only once if the first locking attempt fails. + + +#### See also: +* `\Promise` +* `\Amp\Promise` + + + + +### `fromSupergroup(int $id): float|int` + +Convert bot API channel ID to MTProto channel ID. + + +Parameters: +* `$id`: `int` Bot API channel ID + + + +### `fullChatLastUpdated(mixed $id): \Amp\Promise` + +When were full info for this chat last cached. + + +Parameters: +* `$id`: `mixed` Chat ID + + +#### See also: +* `\Amp\Promise` + + + + +### `fullGetSelf(): \Amp\Promise` + +Get info about the logged-in user, not cached. + + +#### See also: +* `\Amp\Promise` + + + + +### `genVectorHash(array $ints): \int Vector hash` + +Generate MTProto vector hash. + + +Parameters: +* `$ints`: `array` IDs + + +Return value: Vector hash + + +### `getAllMethods(): mixed` + +Get full list of MTProto and API methods. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getAuthorization(): mixed` + +Get authorization info. + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCachedConfig(): mixed` + +Get cached server-side config. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCall(int $call): mixed` + +Get call info. + + +Parameters: +* `$call`: `int` Call ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getCdnConfig(string $datacenter): \Amp\Promise` + +Store RSA keys for CDN datacenters. + + +Parameters: +* `$datacenter`: `string` DC ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getConfig(array $config, array $options): \Amp\Promise` + +Get cached (or eventually re-fetch) server-side config. + + +Parameters: +* `$config`: `array` Current config +* `$options`: `array` Options for method call + + +#### See also: +* `\Amp\Promise` + + + + +### `getDNSClient(): mixed` + +Get async DNS client. + + +Fully typed return value: +``` +\Amp\Dns\Resolver|\Amp\Promise<\Amp\Dns\Resolver> +``` +#### See also: +* `\Amp\Dns\Resolver` +* `\Amp\Promise` + + + + +### `getDataCenterConnections(): mixed` + +Get all datacenter connections. + + +Fully typed return value: +``` +array<\danog\MadelineProto\DataCenterConnection>|\Amp\Promise> +``` +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) +* `\Amp\Promise` + + + + +### `getDataCenterId(): int|string` + +Get main DC ID. + + + +### `getDialogs(bool $force): \Amp\Promise` + +Get dialog peers. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +Fully typed return value: +``` +\Amp\Promise> +``` +#### See also: +* `\Amp\Promise` + + + + +### `getDownloadInfo(mixed $messageMedia): \Amp\Promise` + +Get download info of file +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getEventHandler(): mixed` + +Get event handler. + + +Fully typed return value: +``` +\danog\MadelineProto\EventHandler|\Amp\Promise<\danog\MadelineProto\EventHandler> +``` +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Amp\Promise` + + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getFileInfo(mixed $constructor): \Amp\Promise` + +Get info about file. + + +Parameters: +* `$constructor`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getFolderId(mixed $id): ?int` + +Get folder ID from object. + + +Parameters: +* `$id`: `mixed` Object + + + +### `getFullDialogs(bool $force): \Amp\Promise` + +Get full info of all dialogs. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +#### See also: +* `\Amp\Promise` + + + + +### `getFullInfo(mixed $id): \Amp\Promise FullInfo object` + +Get full info about peer, returns an FullInfo object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: FullInfo object + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [https://docs.madelineproto.xyz/FullInfo.html](https://docs.madelineproto.xyz/FullInfo.html) +* `\Amp\Promise` + + + + +### `getHTTPClient(): mixed` + +Get async HTTP client. + + +Fully typed return value: +``` +\Amp\Http\Client\HttpClient|\Amp\Promise<\Amp\Http\Client\HttpClient> +``` +#### See also: +* `\Amp\Http\Client\HttpClient` +* `\Amp\Promise` + + + + +### `getHint(): mixed` + +Get current password hint. + + +Fully typed return value: +``` +string|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getId(mixed $id): int` + +Get bot API ID from peer object. + + +Parameters: +* `$id`: `mixed` Peer + + + +### `getInfo(mixed $id, bool $recursive): \Amp\Promise Info object` + +Get info about peer, returns an Info object. + + +Parameters: +* `$id`: `mixed` Peer +* `$recursive`: `bool` Internal + + +Return value: Info object + +Fully typed return value: +``` +\Generator|array, mixed, array{InputPeer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}, Peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}, DialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, NotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputDialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputNotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, bot_api_id: int|string, user_id?: int, chat_id?: int, channel_id?: int, InputUser?: array{_: string, user_id?: int, access_hash?: mixed, min?: bool}, InputChannel?: array{_: string, channel_id: int, access_hash: mixed, min: bool}, type: string}> +``` +#### See also: +* [https://docs.madelineproto.xyz/Info.html](https://docs.madelineproto.xyz/Info.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `getLogger()` + +Get logger. + + + +### `getMethodNamespaces(): mixed` + +Get TL namespaces. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMethodsNamespaced(): mixed` + +Get namespaced methods (method => namespace). + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getPropicInfo(mixed $messageMedia): \Amp\Promise` + +Get download info of the propic of a user +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Amp\Promise` + + + + +### `getPsrLogger()` + +Get PSR logger. + + + +### `getPwrChat(mixed $id): \Amp\Promise Chat object` + +Get full info about peer (including full list of channel members), returns a Chat object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: Chat object + +#### See also: +* [https://docs.madelineproto.xyz/Chat.html](https://docs.madelineproto.xyz/Chat.html) + + + + +### `getSecretChat(array|int $chat): mixed` + +Get secret chat. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getSelf(): array|bool` + +Get info about the logged-in user, cached. + + + +### `getSettings(): mixed` + +Return current settings. + + +Fully typed return value: +``` +\danog\MadelineProto\Settings|\Amp\Promise<\danog\MadelineProto\Settings> +``` +#### See also: +* [`\danog\MadelineProto\Settings`: Settings class used for configuring MadelineProto.](./Settings.md) +* `\Amp\Promise` + + + + +### `getTL(): mixed` + +Get TL serializer. + + +Fully typed return value: +``` +\danog\MadelineProto\TL\TL|\Amp\Promise<\danog\MadelineProto\TL\TL> +``` +#### See also: +* [`\danog\MadelineProto\TL\TL`: TL serialization.](./TL/TL.md) +* `\Amp\Promise` + + + + +### `getVar(object $obj, string $var): mixed` + +Accesses a private variable from an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `getWebTemplate(): mixed` + +Get web template. + + +Fully typed return value: +``` +string|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasAllAuth(): mixed` + +Checks whether all datacenters are authorized. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasEventHandler(): mixed` + +Check if an event handler instance is present. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasReportPeers(): mixed` + +Check if has report peers. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasSecretChat(array|int $chat): mixed` + +Check whether secret chat exists. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `hasVar(object $obj, string $var): bool` + +Checks private property exists in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `importAuthorization(mixed $authorization): \Amp\Promise` + +Import authorization. + + +Parameters: +* `$authorization`: `mixed` Authorization info + + +#### See also: +* `\Amp\Promise` + + + + +### `inflateStripped(string $stripped): \string JPG payload` + +Inflate stripped photosize to full JPG payload. + + +Parameters: +* `$stripped`: `string` Stripped photosize + + +Return value: JPG payload + + +### `initSelfRestart(): mixed` + +Initialize self-restart hack. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `isAltervista(): bool` + +Whether this is altervista. + + + +### `isArrayOrAlike(mixed $var): bool` + +Check if is array or similar (traversable && countable && arrayAccess). + + +Parameters: +* `$var`: `mixed` Value to check + + + +### `isIpc(): mixed` + +Whether we're an IPC client instance. + + +Fully typed return value: +``` +bool|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `isSupergroup(int $id): bool` + +Check whether provided bot API ID is a channel. + + +Parameters: +* `$id`: `int` Bot API ID + + + +### `logger(string $param, int $level, string $file): mixed` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `logout(): \Amp\Promise` + +Log out currently logged in user. + + +#### See also: +* `\Amp\Promise` + + + + +### `loop(callable|null $callback): \Amp\Promise` + +Start MadelineProto's update handling loop, or run the provided async callable. + + +Parameters: +* `$callback`: `callable|null` Async callable to run + + +#### See also: +* `\Amp\Promise` + + + + +### `loopFork(): \Amp\Promise` + +Start MadelineProto's update handling loop in background. + + +#### See also: +* `\Amp\Promise` + + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `mbStrSplit(string $text, int $length): array` + +Telegram UTF-8 multibyte split. + + +Parameters: +* `$text`: `string` Text +* `$length`: `int` Length + + + +### `mbStrlen(string $text): float|int` + +Get Telegram UTF-8 length of string. + + +Parameters: +* `$text`: `string` Text + + + +### `mbSubstr(string $text, int $offset, ?int $length): string` + +Telegram UTF-8 multibyte substring. + + +Parameters: +* `$text`: `string` Text to substring +* `$offset`: `int` Offset +* `$length`: `?int` Length + + + +### `methodCall(string $method, array|\Generator $args, array $aargs): \Amp\Promise` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `methodCallWrite(string $method, array|\Generator $args, array $aargs): \Amp\Promise` + +Call method and make sure it is asynchronously sent. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `packDouble(float $value): string` + +Convert double to binary version. + + +Parameters: +* `$value`: `float` Value to convert + + + +### `packSignedInt(int $value): string` + +Convert integer to base256 signed int. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packSignedLong(int $value): string` + +Convert integer to base256 long. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packUnsignedInt(int $value): string` + +Convert value to unsigned base256 int. + + +Parameters: +* `$value`: `int` Value + + + +### `peerIsset(mixed $id): \Amp\Promise` + +Check if peer is present in internal peer database. + + +Parameters: +* `$id`: `mixed` Peer + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `phoneLogin(string $number, int $sms_type): \Amp\Promise` + +Login as user. + + +Parameters: +* `$number`: `string` Phone number +* `$sms_type`: `int` SMS type + + +#### See also: +* `\Amp\Promise` + + + + +### `posmod(int $a, int $b): \int Modulo` + +Positive modulo +Works just like the % (modulus) operator, only returns always a postive number. + + +Parameters: +* `$a`: `int` A +* `$b`: `int` B + + +Return value: Modulo + + +### `random(int $length): \string Random string` + +Get random string of specified length. + + +Parameters: +* `$length`: `int` Length + + +Return value: Random string + + +### `randomInt(int $modulus): int` + +Get random integer. + + +Parameters: +* `$modulus`: `int` Modulus + + + +### `readLine(string $prompt): \Amp\Promise` + +Asynchronously read line. + + +Parameters: +* `$prompt`: `string` Prompt + + +#### See also: +* `\Amp\Promise` + + + + +### `rekey(int $chat): \Amp\Promise` + +Rekey secret chat. + + +Parameters: +* `$chat`: `int` Secret chat to rekey + + +#### See also: +* `\Amp\Promise` + + + + +### `report(string $message, string $parseMode): \Amp\Promise` + +Report an error to the previously set peer. + + +Parameters: +* `$message`: `string` Error to report +* `$parseMode`: `string` Parse mode + + +#### See also: +* `\Amp\Promise` + + + + +### `requestCall(mixed $user): \Amp\Promise` + +Request VoIP call. + + +Parameters: +* `$user`: `mixed` User + + +#### See also: +* `\Amp\Promise` + + + + +### `requestSecretChat(mixed $user): \Amp\Promise` + +Request secret chat. + + +Parameters: +* `$user`: `mixed` User to start secret chat with + + +#### See also: +* `\Amp\Promise` + + + + +### `resetUpdateState(): mixed` + +Reset the update state and fetch all updates from the beginning. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `resolveUsername(string $username): \Amp\Promise` + +Resolve username (use getInfo instead). + + +Parameters: +* `$username`: `string` Username + + +#### See also: +* `\Amp\Promise` + + + + +### `restart(): void` + +Restart update loop. + + + +### `rethrow(\Throwable $e, string $file): void` + +Rethrow error catched in strand. + + +Parameters: +* `$e`: `\Throwable` Exception +* `$file`: `string` File where the strand started + + +#### See also: +* `\Throwable` + + + + +### `rleDecode(string $string): string` + +null-byte RLE decode. + + +Parameters: +* `$string`: `string` Data to decode + + + +### `rleEncode(string $string): string` + +null-byte RLE encode. + + +Parameters: +* `$string`: `string` Data to encode + + + +### `secretChatStatus(int $chat): mixed` + +Get secret chat status. + + +Parameters: +* `$chat`: `int` Chat ID + + +Fully typed return value: +``` +int|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `serializeAll(): void` + +Serialize all instances. +CALLED ONLY ON SHUTDOWN. + + +### `setCallback(callable $callback): mixed` + +Set update handling callback. + + +Parameters: +* `$callback`: `callable` Callback + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Amp\Promise` + +Set event handler. + + +Parameters: +* `$eventHandler`: `class-string<\danog\MadelineProto\EventHandler>` Event handler + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Amp\Promise` + + + + +### `setNoop(): mixed` + +Set NOOP update handler, ignoring all updates. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setReportPeers(int|string $userOrId): \Amp\Promise` + +Set peer(s) where to send errors occurred in the event loop. + + +Parameters: +* `$userOrId`: `int|string` Username(s) or peer ID(s) + + +#### See also: +* `\Amp\Promise` + + + + +### `setVar(object $obj, string $var, mixed $val): void` + +Sets a private variable in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name +* `$val`: `mixed` Attribute value + + + +### `setWebTemplate(string $template): mixed` + +Set web template. + + +Parameters: +* `$template`: `string` Template + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setWebhook(string $hook_url, string $pem_path): mixed` + +Set webhook update handler. + + +Parameters: +* `$hook_url`: `string` Webhook URL +* `$pem_path`: `string` PEM path for self-signed certificate + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `setupLogger(): mixed` + +Setup logger. + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `sleep(int|float $time): \Amp\Promise` + +Asynchronously sleep. + + +Parameters: +* `$time`: `int|float` Number of seconds to sleep for + + +#### See also: +* `\Amp\Promise` + + + + +### `some((\Promise|\Generator)[] $promises): \Amp\Promise` + +Resolves with a two-item array delineating successful and failed Promise results. +The returned promise will only fail if the given number of required promises fail. + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `start(): \Amp\Promise` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Amp\Promise` + + + + +### `stop(): void` + +Stop update loop. + + + +### `tdToMTProto(array $params): \Amp\Promise` + +Convert TD to MTProto parameters. + + +Parameters: +* `$params`: `array` Parameters + + +#### See also: +* `\Amp\Promise` + + + + +### `tdToTdcli(mixed $params): mixed` + +Convert TD parameters to tdcli. + + +Parameters: +* `$params`: `mixed` Parameters + + + +### `tdcliToTd(array $params, array $key): mixed` + +Convert tdcli parameters to tdcli. + + +Parameters: +* `$params`: `array` Params +* `$key`: `array` Key + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` + +Create an artificial timeout for any \Generator or Promise. + + +Parameters: +* `$promise`: `\Generator|\Promise` +* `$timeout`: `int` + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` + +Creates an artificial timeout for any `Promise`. +If the promise is resolved before the timeout expires, the result is returned + +If the timeout expires before the promise is resolved, a default value is returned + +Parameters: +* `$promise`: `\Promise|\Generator` Promise to which the timeout is applied. + Full type: + ``` + \Promise<\TReturn>|\TGenerator + ``` +* `$timeout`: `int` Timeout in milliseconds. +* `$default`: `mixed` + Full type: + ``` + \TReturnAlt + ``` + + +#### See also: +* `\Promise` +* `\Generator` +* `\TReturn` +* `\TGenerator` +* `\TReturnAlt` +* `\Amp\Promise` + + + + +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `toSupergroup(int $id): float|int` + +Convert MTProto channel ID to bot API channel ID. + + +Parameters: +* `$id`: `int` MTProto channel ID + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `unpackDouble(string $value): float` + +Unpack binary double. + + +Parameters: +* `$value`: `string` Value to unpack + + + +### `unpackFileId(string $fileId): mixed` + +Unpack bot API file ID. + + +Parameters: +* `$fileId`: `string` Bot API file ID + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `unpackSignedInt(string $value): int` + +Unpack base256 signed int. + + +Parameters: +* `$value`: `string` base256 int + + + +### `unpackSignedLong(string $value): int` + +Unpack base256 signed long. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unpackSignedLongString(string $value): string` + +Unpack base256 signed long to string. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unsetEventHandler(bool $disableUpdateHandling): mixed` + +Unset event handler. + + +Parameters: +* `$disableUpdateHandling`: `bool` Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler) + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `update2fa(array $params): \Amp\Promise` + +Update the 2FA password. +The params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` The params + + +#### See also: +* `\Amp\Promise` + + + + +### `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Amp\Promise` + +Parse, update and store settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` +* `\Amp\Promise` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Amp\Promise` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Amp\Promise` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Amp\Promise` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Amp\Promise` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` + + + + +### `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` + +Synchronously wait for a promise|generator. + + +Parameters: +* `$promise`: `\Generator|\Promise` The promise to wait for +* `$ignoreSignal`: `bool` Whether to ignore shutdown signals + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `async(bool $async): void` + +Enable or disable async. + + +Parameters: +* `$async`: `bool` Whether to enable or disable async + + + +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Exception.md b/docs/PHPInternal/danog/MadelineProto/Exception.md new file mode 100644 index 00000000..bab7d2db --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Exception.md @@ -0,0 +1,87 @@ +--- +title: danog\MadelineProto\Exception: Basic exception. +description: + +--- +# `danog\MadelineProto\Exception` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Basic exception. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `extension(string $extensionName): self` +* `exceptionErrorHandler(): false` +* `exceptionHandler(): void` +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `extension(string $extensionName): self` + +Complain about missing extensions. + + +Parameters: +* `$extensionName`: `string` Extension name + + + +### `exceptionErrorHandler(): false` + +ExceptionErrorHandler. +Error handler + + +### `exceptionHandler(): void` + +ExceptionErrorHandler. +Error handler + + +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHPInternal/danog/MadelineProto/FileCallback.md b/docs/PHPInternal/danog/MadelineProto/FileCallback.md new file mode 100644 index 00000000..49d3aab8 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/FileCallback.md @@ -0,0 +1,28 @@ +--- +title: danog\MadelineProto\FileCallback: File callback interface. +description: + +--- +# `danog\MadelineProto\FileCallback` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +File callback interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getFile(): mixed` + +## Methods: +### `getFile(): mixed` + +Get file. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/FileCallbackInterface.md b/docs/PHPInternal/danog/MadelineProto/FileCallbackInterface.md new file mode 100644 index 00000000..d55995e0 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/FileCallbackInterface.md @@ -0,0 +1,28 @@ +--- +title: danog\MadelineProto\FileCallbackInterface: File callback interface. +description: + +--- +# `danog\MadelineProto\FileCallbackInterface` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +File callback interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getFile(): mixed` + +## Methods: +### `getFile(): mixed` + +Get file. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Files/Server.md b/docs/PHPInternal/danog/MadelineProto/Files/Server.md new file mode 100644 index 00000000..49315409 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Files/Server.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Files\Server: MadelineProto fileserver. +description: + +--- +# `danog\MadelineProto\Files\Server` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MadelineProto fileserver. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Ipc/Client.md b/docs/PHPInternal/danog/MadelineProto/Ipc/Client.md new file mode 100644 index 00000000..05cdf05e --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Ipc/Client.md @@ -0,0 +1,444 @@ +--- +title: danog\MadelineProto\Ipc\Client: IPC client. +description: + +--- +# `danog\MadelineProto\Ipc\Client` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC client. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(callable $callback): \Generator` +* `unreference(): void` +* `isIpc(): bool` +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator Downloaded file path` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` +* `setEventHandler(mixed $params): void` +* `getEventHandler(mixed $params): void` +* `logger(string $param, int $level, string $file): void` +* `disconnect(): \Generator` +* `start(): \Generator` +* `getWebTemplate(): string` +* `setWebTemplate(string $template): void` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +## Methods: +### `loop(callable $callback): \Generator` + +Run the provided async callable. + + +Parameters: +* `$callback`: `callable` Async callable to run + + +#### See also: +* `\Generator` + + + + +### `unreference(): void` + +Unreference. + + + +### `isIpc(): bool` + +Whether we're an IPC client instance. + + + +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Generator` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator Downloaded file path` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `setEventHandler(mixed $params): void` + +Placeholder. + + +Parameters: +* `$params`: `mixed` Params + + + +### `getEventHandler(mixed $params): void` + +Placeholder. + + +Parameters: +* `$params`: `mixed` Params + + + +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `disconnect(): \Generator` + +Disconnect cleanly from main instance. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `start(): \Generator` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Generator` + + + + +### `getWebTemplate(): string` + +Get web template. + + + +### `setWebTemplate(string $template): void` + +Set web template. + + +Parameters: +* `$template`: `string` Template + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Generator` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Generator|\Amp\Promise|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Generator` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Ipc/ClientAbstract.md b/docs/PHPInternal/danog/MadelineProto/Ipc/ClientAbstract.md new file mode 100644 index 00000000..b926d493 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Ipc/ClientAbstract.md @@ -0,0 +1,51 @@ +--- +title: danog\MadelineProto\Ipc\ClientAbstract: IPC client. +description: + +--- +# `danog\MadelineProto\Ipc\ClientAbstract` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC client. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `logger(string $param, int $level, string $file): void` +* `disconnect(): \Generator` + +## Methods: +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `disconnect(): \Generator` + +Disconnect cleanly from main instance. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Ipc/IpcState.md b/docs/PHPInternal/danog/MadelineProto/Ipc/IpcState.md new file mode 100644 index 00000000..29fbf577 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Ipc/IpcState.md @@ -0,0 +1,47 @@ +--- +title: danog\MadelineProto\Ipc\IpcState: IPC state class. +description: + +--- +# `danog\MadelineProto\Ipc\IpcState` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC state class. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getStartupTime(): float` +* `getStartupId(): int` +* `getException(): ?\Throwable` + +## Methods: +### `getStartupTime(): float` + +Get startup time. + + + +### `getStartupId(): int` + +Get startup ID. + + + +### `getException(): ?\Throwable` + +Get exception. + + +#### See also: +* `\Throwable` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Ipc/Server.md b/docs/PHPInternal/danog/MadelineProto/Ipc/Server.md new file mode 100644 index 00000000..82be46ed --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Ipc/Server.md @@ -0,0 +1,147 @@ +--- +title: danog\MadelineProto\Ipc\Server: IPC server. +description: + +--- +# `danog\MadelineProto\Ipc\Server` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC server. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Ipc\Server::SHUTDOWN`: Shutdown server. + + +## Method list: +* `setIpcPath(\danog\MadelineProto\SessionPaths $session): void` +* `startMe(\danog\MadelineProto\SessionPaths $session): \Amp\Promise` +* `waitShutdown(): \Amp\Promise` +* `loop(): \Generator` +* `setSettings(\danog\MadelineProto\Settings\Ipc $settings): self` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `setIpcPath(\danog\MadelineProto\SessionPaths $session): void` + +Set IPC path. + + +Parameters: +* `$session`: `\danog\MadelineProto\SessionPaths` Session + + +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) + + + + +### `startMe(\danog\MadelineProto\SessionPaths $session): \Amp\Promise` + +Start IPC server in background. + + +Parameters: +* `$session`: `\danog\MadelineProto\SessionPaths` Session path + + +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) +* `\Amp\Promise` + + + + +### `waitShutdown(): \Amp\Promise` + +Wait for shutdown. + + +#### See also: +* `\Amp\Promise` + + + + +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `setSettings(\danog\MadelineProto\Settings\Ipc $settings): self` + +Set IPC settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Ipc` IPC settings + + +#### See also: +* [`\danog\MadelineProto\Settings\Ipc`: IPC server settings.](../Settings/Ipc.md) + + + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Ipc/ServerCallback.md b/docs/PHPInternal/danog/MadelineProto/Ipc/ServerCallback.md new file mode 100644 index 00000000..910acf26 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Ipc/ServerCallback.md @@ -0,0 +1,147 @@ +--- +title: danog\MadelineProto\Ipc\ServerCallback: IPC callback server. +description: + +--- +# `danog\MadelineProto\Ipc\ServerCallback` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC callback server. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Ipc\ServerCallback::SHUTDOWN`: Shutdown server. + + +## Method list: +* `setIpcPath(\danog\MadelineProto\SessionPaths $session): void` +* `startMe(\danog\MadelineProto\SessionPaths $session): \Amp\Promise` +* `waitShutdown(): \Amp\Promise` +* `loop(): \Generator` +* `setSettings(\danog\MadelineProto\Settings\Ipc $settings): self` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `setIpcPath(\danog\MadelineProto\SessionPaths $session): void` + +Set IPC path. + + +Parameters: +* `$session`: `\danog\MadelineProto\SessionPaths` Session + + +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) + + + + +### `startMe(\danog\MadelineProto\SessionPaths $session): \Amp\Promise` + +Start IPC server in background. + + +Parameters: +* `$session`: `\danog\MadelineProto\SessionPaths` Session path + + +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) +* `\Amp\Promise` + + + + +### `waitShutdown(): \Amp\Promise` + +Wait for shutdown. + + +#### See also: +* `\Amp\Promise` + + + + +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `setSettings(\danog\MadelineProto\Settings\Ipc $settings): self` + +Set IPC settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Ipc` IPC settings + + +#### See also: +* [`\danog\MadelineProto\Settings\Ipc`: IPC server settings.](../Settings/Ipc.md) + + + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Ipc/Wrapper.md b/docs/PHPInternal/danog/MadelineProto/Ipc/Wrapper.md new file mode 100644 index 00000000..0848abc0 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Ipc/Wrapper.md @@ -0,0 +1,87 @@ +--- +title: danog\MadelineProto\Ipc\Wrapper: Callback payload wrapper. +description: + +--- +# `danog\MadelineProto\Ipc\Wrapper` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Callback payload wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `create(mixed $data, \danog\MadelineProto\SessionPaths $ipc): \Generator` +* `wrap(object|callable $callback, bool $wrapObjects): void` +* `logger(string $param, int $level, string $file): void` +* `disconnect(): \Generator` + +## Methods: +### `create(mixed $data, \danog\MadelineProto\SessionPaths $ipc): \Generator` + +Constructor. + + +Parameters: +* `$data`: `mixed` Payload data +* `$ipc`: `\danog\MadelineProto\SessionPaths` IPC URI + + +Fully typed return value: +``` +\Generator|\Amp\Promise, mixed, \danog\MadelineProto\Ipc\Wrapper> +``` +#### See also: +* [`\danog\MadelineProto\SessionPaths`: Session path information.](../SessionPaths.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `wrap(object|callable $callback, bool $wrapObjects): void` + +Wrap a certain callback object. + + +Parameters: +* `$callback`: `object|callable` Callback to wrap +* `$wrapObjects`: `bool` Whether to wrap object methods, too + + + +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `disconnect(): \Generator` + +Disconnect cleanly from main instance. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Ipc/Wrapper/Obj.md b/docs/PHPInternal/danog/MadelineProto/Ipc/Wrapper/Obj.md new file mode 100644 index 00000000..765fbbd1 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Ipc/Wrapper/Obj.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Ipc\Wrapper\Obj: Generic callback wrapper object. +description: + +--- +# `danog\MadelineProto\Ipc\Wrapper\Obj` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Generic callback wrapper object. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Logger.md b/docs/PHPInternal/danog/MadelineProto/Logger.md new file mode 100644 index 00000000..00c5d9f9 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Logger.md @@ -0,0 +1,96 @@ +--- +title: danog\MadelineProto\Logger: Logger class. +description: + +--- +# `danog\MadelineProto\Logger` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Logger class. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Logger::LEVEL_ULTRA_VERBOSE`: Ultra verbose level. + +* `danog\MadelineProto\Logger::LEVEL_VERBOSE`: Verbose level. + +* `danog\MadelineProto\Logger::LEVEL_NOTICE`: Notice level. + +* `danog\MadelineProto\Logger::LEVEL_WARNING`: Warning level. + +* `danog\MadelineProto\Logger::LEVEL_ERROR`: Error level. + +* `danog\MadelineProto\Logger::LEVEL_FATAL`: Fatal error level. + +* `danog\MadelineProto\Logger::LOGGER_DEFAULT`: Default logger (syslog). + +* `danog\MadelineProto\Logger::LOGGER_ECHO`: Echo logger. + +* `danog\MadelineProto\Logger::LOGGER_FILE`: File logger. + +* `danog\MadelineProto\Logger::LOGGER_CALLABLE`: Callable logger. + + +## Method list: +* `constructorFromSettings(\danog\MadelineProto\Settings\Logger $settings): self` +* `log(mixed $param, int $level): void` +* `logger(mixed $param, int $level, string $file): void` +* `getPsrLogger(): \Psr\Log\LoggerInterface` + +## Methods: +### `constructorFromSettings(\danog\MadelineProto\Settings\Logger $settings): self` + +Construct global static logger from MadelineProto settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\Settings\Logger` Settings instance + + +#### See also: +* [`\danog\MadelineProto\Settings\Logger`: Logger settings.](./Settings/Logger.md) + + + + +### `log(mixed $param, int $level): void` + +Log a message. + + +Parameters: +* `$param`: `mixed` Message +* `$level`: `int` Logging level + + + +### `logger(mixed $param, int $level, string $file): void` + +Log a message. + + +Parameters: +* `$param`: `mixed` Message to log +* `$level`: `int` Logging level +* `$file`: `string` File that originated the message + + + +### `getPsrLogger(): \Psr\Log\LoggerInterface` + +Get PSR logger. + + +#### See also: +* `\Psr\Log\LoggerInterface` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/APILoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/APILoop.md new file mode 100644 index 00000000..afd2f670 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/APILoop.md @@ -0,0 +1,35 @@ +--- +title: danog\MadelineProto\Loop\APILoop: API loop trait. +description: + +--- +# `danog\MadelineProto\Loop\APILoop` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +API loop trait. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `start(): bool` +* `isRunning(): bool` + +## Methods: +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Connection/CheckLoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/CheckLoop.md new file mode 100644 index 00000000..03842779 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/CheckLoop.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\Loop\Connection\CheckLoop: RPC call status check loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\CheckLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +RPC call status check loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Connection/Common.md b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/Common.md new file mode 100644 index 00000000..a6021d97 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/Common.md @@ -0,0 +1,35 @@ +--- +title: danog\MadelineProto\Loop\Connection\Common: RPC call status check loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\Common` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +RPC call status check loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `start(): bool` +* `isRunning(): bool` + +## Methods: +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Connection/HttpWaitLoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/HttpWaitLoop.md new file mode 100644 index 00000000..8b797129 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/HttpWaitLoop.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\Loop\Connection\HttpWaitLoop: HttpWait loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\HttpWaitLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +HttpWait loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Connection/PingLoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/PingLoop.md new file mode 100644 index 00000000..84fe98d2 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/PingLoop.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\Loop\Connection\PingLoop: Ping loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\PingLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Ping loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Connection/ReadLoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/ReadLoop.md new file mode 100644 index 00000000..ccb256fd --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/ReadLoop.md @@ -0,0 +1,89 @@ +--- +title: danog\MadelineProto\Loop\Connection\ReadLoop: Socket read loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\ReadLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Socket read loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Connection/WriteLoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/WriteLoop.md new file mode 100644 index 00000000..abb8317b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Connection/WriteLoop.md @@ -0,0 +1,126 @@ +--- +title: danog\MadelineProto\Loop\Connection\WriteLoop: Socket write loop. +description: + +--- +# `danog\MadelineProto\Loop\Connection\WriteLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Socket write loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Loop\Connection\WriteLoop::MAX_COUNT`: + +* `danog\MadelineProto\Loop\Connection\WriteLoop::MAX_IDS`: + + +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Update/FeedLoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/Update/FeedLoop.md new file mode 100644 index 00000000..c7c91aeb --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Update/FeedLoop.md @@ -0,0 +1,124 @@ +--- +title: danog\MadelineProto\Loop\Update\FeedLoop: Update feed loop. +description: + +--- +# `danog\MadelineProto\Loop\Update\FeedLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Update feed loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Loop\Update\FeedLoop::GENERIC`: Main loop ID. + + +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Update/SeqLoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/Update/SeqLoop.md new file mode 100644 index 00000000..302374c5 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Update/SeqLoop.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\Loop\Update\SeqLoop: update feed loop. +description: + +--- +# `danog\MadelineProto\Loop\Update\SeqLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +update feed loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Loop/Update/UpdateLoop.md b/docs/PHPInternal/danog/MadelineProto/Loop/Update/UpdateLoop.md new file mode 100644 index 00000000..90df7ac4 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Loop/Update/UpdateLoop.md @@ -0,0 +1,124 @@ +--- +title: danog\MadelineProto\Loop\Update\UpdateLoop: Update loop. +description: + +--- +# `danog\MadelineProto\Loop\Update\UpdateLoop` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Update loop. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Loop\Update\UpdateLoop::GENERIC`: Main loop ID. + + +## Method list: +* `loop(): \Generator` +* `pause(?int $time): \Promise Resolved when the loop is resumed` +* `resume(): \Promise Resolved when the loop is paused again` +* `resumeDefer(): \Promise Resolved when the loop is paused again` +* `start(): bool` +* `isRunning(): bool` +* `signal(mixed|\Throwable $what): void` +* `waitSignal(\Promise|\Generator $promise): \Promise` + +## Methods: +### `loop(): \Generator` + +Main loop. + + +#### See also: +* `\Generator` + + + + +### `pause(?int $time): \Promise Resolved when the loop is resumed` + +Pause the loop. + + +Parameters: +* `$time`: `?int` For how long to pause the loop, if null will pause forever (until resume is called from outside of the loop) + + +Return value: Resolved when the loop is resumed + + +### `resume(): \Promise Resolved when the loop is paused again` + +Resume the loop. + + +Return value: Resolved when the loop is paused again + + +### `resumeDefer(): \Promise Resolved when the loop is paused again` + +Defer resuming the loop to next tick. + + +Return value: Resolved when the loop is paused again + + +### `start(): bool` + +Start the loop. +Returns false if the loop is already running. + + +### `isRunning(): bool` + +Check whether loop is running. + + + +### `signal(mixed|\Throwable $what): void` + +Send signal to loop. + + +Parameters: +* `$what`: `mixed|\Throwable` Data to signal + + +#### See also: +* `\Throwable` + + + + +### `waitSignal(\Promise|\Generator $promise): \Promise` + +Resolve the promise or return|throw the signal. + + +Parameters: +* `$promise`: `\Promise|\Generator` The original promise or generator + Full type: + ``` + \Promise<\T>|\Generator, mixed, \Promise<\T>|\T> + ``` + + +Fully typed return value: +``` +\Promise<\T|mixed> +``` +#### See also: +* `\Promise` +* `\Generator` +* `\T` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Lua.md b/docs/PHPInternal/danog/MadelineProto/Lua.md new file mode 100644 index 00000000..6421a086 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Lua.md @@ -0,0 +1,33 @@ +--- +title: danog\MadelineProto\Lua: Lua interface. +description: + +--- +# `danog\MadelineProto\Lua` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Lua interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `tdcliFunction(): \Generator|int` + +## Methods: +### `tdcliFunction(): \Generator|int` + + + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProto.md b/docs/PHPInternal/danog/MadelineProto/MTProto.md new file mode 100644 index 00000000..176c8f4b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProto.md @@ -0,0 +1,1839 @@ +--- +title: danog\MadelineProto\MTProto: Manages all of the mtproto stuff. +description: + +--- +# `danog\MadelineProto\MTProto` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Manages all of the mtproto stuff. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\MTProto::RELEASE`: Release version. + +* `danog\MadelineProto\MTProto::NOT_LOGGED_IN`: We're not logged in. + +* `danog\MadelineProto\MTProto::WAITING_CODE`: We're waiting for the login code. + +* `danog\MadelineProto\MTProto::WAITING_SIGNUP`: We're waiting for parameters to sign up. + +* `danog\MadelineProto\MTProto::WAITING_PASSWORD`: We're waiting for the 2FA password. + +* `danog\MadelineProto\MTProto::LOGGED_IN`: We're logged in. + +* `danog\MadelineProto\MTProto::SECRET_EMPTY`: Secret chat was not found. + +* `danog\MadelineProto\MTProto::SECRET_REQUESTED`: Secret chat was requested. + +* `danog\MadelineProto\MTProto::SECRET_READY`: Secret chat was found. + + +## Method list: +* `serializeSession(): \Generator` +* `serializeAll(): void` +* `cleanup(): \Generator` +* `logger(string $param, int $level, string $file): void` +* `getMethodNamespaces(): array` +* `getMethodsNamespaced(): array` +* `getTL(): \danog\MadelineProto\TL\TL` +* `getLogger()` +* `getPsrLogger()` +* `getHTTPClient(): \Amp\Http\Client\HttpClient` +* `getDNSClient(): \Amp\Dns\Resolver` +* `fileGetContents(string $url): \Generator` +* `getDataCenterConnections(): \danog\MadelineProto\DataCenterConnection[]` +* `getDataCenterId(): int|string` +* `isIpc(): bool` +* `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Generator` +* `getSettings(): \danog\MadelineProto\Settings` +* `setupLogger(): void` +* `hasAllAuth(): bool` +* `connectToAllDcs(bool $reconnectAll): \Generator` +* `resetUpdateState(): void` +* `getCdnConfig(string $datacenter): \Generator` +* `getCachedConfig(): array` +* `getConfig(array $config, array $options): \Generator` +* `getSelf(): array|bool` +* `fullGetSelf(): \Generator` +* `getAuthorization(): int` +* `getHint(): string` +* `hasReportPeers(): bool` +* `setReportPeers(int|string $userOrId): \Generator` +* `report(string $message, string $parseMode): \Generator` +* `getAllMethods(): array` +* `getMethodCallbacks(): array` +* `getMethodBeforeCallbacks(): array` +* `getConstructorCallbacks(): array` +* `getConstructorBeforeCallbacks(): array` +* `getConstructorSerializeCallbacks(): array` +* `getTypeMismatchCallbacks(): array` +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` +* `methodCall(string $method, array|\Generator $args, array $aargs): mixed` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` +* `toSupergroup(int $id): float|int` +* `fromSupergroup(int $id): float|int` +* `isSupergroup(int $id): bool` +* `addUser(array $user): \Generator` +* `peerIsset(mixed $id): \Generator` +* `getFolderId(mixed $id): ?int` +* `getId(mixed $id): int` +* `getInfo(mixed $id, bool $recursive): \Generator Info object` +* `fullChatLastUpdated(mixed $id): \Generator` +* `getFullInfo(mixed $id): \Generator FullInfo object` +* `getPwrChat(mixed $id): \Generator Chat object` +* `resolveUsername(string $username): \Generator` +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` +* `getFileInfo(mixed $constructor): \Generator` +* `getPropicInfo(mixed $messageMedia): \Generator` +* `extractBotAPIFile(array $info): ?array` +* `getDownloadInfo(mixed $messageMedia): \Generator` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` +* `acceptSecretChat(array $params): \Generator` +* `requestSecretChat(mixed $user): \Generator` +* `rekey(int $chat): \Generator` +* `secretChatStatus(int $chat): \int One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY` +* `getSecretChat(array|int $chat): array` +* `hasSecretChat(array|int $chat): bool` +* `discardSecretChat(int $chat): \Generator` +* `mbStrlen(string $text): float|int` +* `mbSubstr(string $text, int $offset, ?int $length): string` +* `mbStrSplit(string $text, int $length): array` +* `MTProtoToBotAPI(array $data): \Generator` +* `botAPIToMTProto(array $arguments): \Generator` +* `unpackFileId(string $fileId): \array Unpacked file ID` +* `tdcliToTd(array $params, array $key): array` +* `tdToMTProto(array $params): \Generator` +* `MTProtoToTdcli(mixed $params): \Generator` +* `MTProtoToTd(mixed $params): \Generator` +* `tdToTdcli(mixed $params): mixed` +* `requestCall(mixed $user): \Generator` +* `acceptCall(array $call): \Generator` +* `confirmCall(array $params): \Generator` +* `completeCall(array $params): \Generator` +* `callStatus(int $id): int` +* `getCall(int $call): array` +* `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Generator` +* `getDialogs(bool $force): \Generator` +* `getFullDialogs(bool $force): \Generator` +* `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Generator` +* `unsetEventHandler(bool $disableUpdateHandling): void` +* `getEventHandler(): \danog\MadelineProto\EventHandler` +* `hasEventHandler(): bool` +* `setWebhook(string $hook_url, string $pem_path): void` +* `setCallback(callable $callback): void` +* `logout(): \Generator` +* `botLogin(string $token): \Generator` +* `phoneLogin(string $number, int $sms_type): \Generator` +* `completePhoneLogin(string $code): \Generator` +* `importAuthorization(mixed $authorization): \Generator` +* `exportAuthorization(): \Generator` +* `completeSignup(string $first_name, string $last_name): \Generator` +* `complete2faLogin(string $password): \Generator` +* `update2fa(array $params): \Generator` +* `initSelfRestart(): void` +* `loop(callable|null $callback): \Generator` +* `stop(): void` +* `restart(): void` +* `loopFork(): \Amp\Promise` +* `closeConnection(string $message): void` +* `setNoop(): void` +* `start(): \Generator` +* `getWebTemplate(): string` +* `setWebTemplate(string $template): void` +* `checkTos(): \Generator` +* `acceptTos(): \Generator` +* `declineTos(): \Generator` + +## Methods: +### `serializeSession(): \Generator` + +Serialize session, returning object to serialize to db. + + +#### See also: +* `\Generator` + + + + +### `serializeAll(): void` + +Serialize all instances. +CALLED ONLY ON SHUTDOWN. + + +### `cleanup(): \Generator` + +Cleanup memory and session file. + + +#### See also: +* `\Generator` + + + + +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `getMethodNamespaces(): array` + +Get TL namespaces. + + + +### `getMethodsNamespaced(): array` + +Get namespaced methods (method => namespace). + + + +### `getTL(): \danog\MadelineProto\TL\TL` + +Get TL serializer. + + +#### See also: +* [`\danog\MadelineProto\TL\TL`: TL serialization.](./TL/TL.md) + + + + +### `getLogger()` + +Get logger. + + + +### `getPsrLogger()` + +Get PSR logger. + + + +### `getHTTPClient(): \Amp\Http\Client\HttpClient` + +Get async HTTP client. + + +#### See also: +* `\Amp\Http\Client\HttpClient` + + + + +### `getDNSClient(): \Amp\Dns\Resolver` + +Get async DNS client. + + +#### See also: +* `\Amp\Dns\Resolver` + + + + +### `fileGetContents(string $url): \Generator` + +Get contents of remote file asynchronously. + + +Parameters: +* `$url`: `string` URL + + +Fully typed return value: +``` +\Generator, mixed, string> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getDataCenterConnections(): \danog\MadelineProto\DataCenterConnection[]` + +Get all datacenter connections. + + +#### See also: +* [`\danog\MadelineProto\DataCenterConnection`: Datacenter connection.](./DataCenterConnection.md) + + + + +### `getDataCenterId(): int|string` + +Get main DC ID. + + + +### `isIpc(): bool` + +Whether we're an IPC client instance. + + + +### `updateSettings(\danog\MadelineProto\SettingsAbstract $settings): \Generator` + +Parse, update and store settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` +* `\Generator` + + + + +### `getSettings(): \danog\MadelineProto\Settings` + +Return current settings. + + +#### See also: +* [`\danog\MadelineProto\Settings`: Settings class used for configuring MadelineProto.](./Settings.md) + + + + +### `setupLogger(): void` + +Setup logger. + + + +### `hasAllAuth(): bool` + +Checks whether all datacenters are authorized. + + + +### `connectToAllDcs(bool $reconnectAll): \Generator` + +Connects to all datacenters and if necessary creates authorization keys, binds them and writes client info. + + +Parameters: +* `$reconnectAll`: `bool` Whether to reconnect to all DCs + + +#### See also: +* `\Generator` + + + + +### `resetUpdateState(): void` + +Reset the update state and fetch all updates from the beginning. + + + +### `getCdnConfig(string $datacenter): \Generator` + +Store RSA keys for CDN datacenters. + + +Parameters: +* `$datacenter`: `string` DC ID + + +#### See also: +* `\Generator` + + + + +### `getCachedConfig(): array` + +Get cached server-side config. + + + +### `getConfig(array $config, array $options): \Generator` + +Get cached (or eventually re-fetch) server-side config. + + +Parameters: +* `$config`: `array` Current config +* `$options`: `array` Options for method call + + +#### See also: +* `\Generator` + + + + +### `getSelf(): array|bool` + +Get info about the logged-in user, cached. + + + +### `fullGetSelf(): \Generator` + +Get info about the logged-in user, not cached. + + +#### See also: +* `\Generator` + + + + +### `getAuthorization(): int` + +Get authorization info. + + + +### `getHint(): string` + +Get current password hint. + + + +### `hasReportPeers(): bool` + +Check if has report peers. + + + +### `setReportPeers(int|string $userOrId): \Generator` + +Set peer(s) where to send errors occurred in the event loop. + + +Parameters: +* `$userOrId`: `int|string` Username(s) or peer ID(s) + + +#### See also: +* `\Generator` + + + + +### `report(string $message, string $parseMode): \Generator` + +Report an error to the previously set peer. + + +Parameters: +* `$message`: `string` Error to report +* `$parseMode`: `string` Parse mode + + +#### See also: +* `\Generator` + + + + +### `getAllMethods(): array` + +Get full list of MTProto and API methods. + + + +### `getMethodCallbacks(): array` + +Called right before serialization of method starts. +Pass the method name + + +### `getMethodBeforeCallbacks(): array` + +Called right before serialization of method starts. +Pass the method name + + +### `getConstructorCallbacks(): array` + +Called right after deserialization of object, passing the final object. + + + +### `getConstructorBeforeCallbacks(): array` + +Called right before deserialization of object. +Pass only the constructor name + + +### `getConstructorSerializeCallbacks(): array` + +Called right before serialization of constructor. +Passed the object, will return a modified version. + + +### `getTypeMismatchCallbacks(): array` + +Called if objects of the specified type cannot be serialized. +Passed the unserializable object, +will try to convert it to an object of the proper type. + + +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + +### `methodCall(string $method, array|\Generator $args, array $aargs): mixed` + +Synchronous wrapper for methodCall. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `toSupergroup(int $id): float|int` + +Convert MTProto channel ID to bot API channel ID. + + +Parameters: +* `$id`: `int` MTProto channel ID + + + +### `fromSupergroup(int $id): float|int` + +Convert bot API channel ID to MTProto channel ID. + + +Parameters: +* `$id`: `int` Bot API channel ID + + + +### `isSupergroup(int $id): bool` + +Check whether provided bot API ID is a channel. + + +Parameters: +* `$id`: `int` Bot API ID + + + +### `addUser(array $user): \Generator` + +Add user info. + + +Parameters: +* `$user`: `array` User info + + +#### See also: +* `\Generator` + + + + +### `peerIsset(mixed $id): \Generator` + +Check if peer is present in internal peer database. + + +Parameters: +* `$id`: `mixed` Peer + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFolderId(mixed $id): ?int` + +Get folder ID from object. + + +Parameters: +* `$id`: `mixed` Object + + + +### `getId(mixed $id): int` + +Get bot API ID from peer object. + + +Parameters: +* `$id`: `mixed` Peer + + + +### `getInfo(mixed $id, bool $recursive): \Generator Info object` + +Get info about peer, returns an Info object. + + +Parameters: +* `$id`: `mixed` Peer +* `$recursive`: `bool` Internal + + +Return value: Info object + +Fully typed return value: +``` +\Generator|array, mixed, array{InputPeer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}, Peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}, DialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, NotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputDialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputNotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, bot_api_id: int|string, user_id?: int, chat_id?: int, channel_id?: int, InputUser?: array{_: string, user_id?: int, access_hash?: mixed, min?: bool}, InputChannel?: array{_: string, channel_id: int, access_hash: mixed, min: bool}, type: string}> +``` +#### See also: +* [https://docs.madelineproto.xyz/Info.html](https://docs.madelineproto.xyz/Info.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `fullChatLastUpdated(mixed $id): \Generator` + +When were full info for this chat last cached. + + +Parameters: +* `$id`: `mixed` Chat ID + + +#### See also: +* `\Generator` + + + + +### `getFullInfo(mixed $id): \Generator FullInfo object` + +Get full info about peer, returns an FullInfo object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: FullInfo object + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [https://docs.madelineproto.xyz/FullInfo.html](https://docs.madelineproto.xyz/FullInfo.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `getPwrChat(mixed $id): \Generator Chat object` + +Get full info about peer (including full list of channel members), returns a Chat object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: Chat object + +#### See also: +* [https://docs.madelineproto.xyz/Chat.html](https://docs.madelineproto.xyz/Chat.html) + + + + +### `resolveUsername(string $username): \Generator` + +Resolve username (use getInfo instead). + + +Parameters: +* `$username`: `string` Username + + +#### See also: +* `\Generator` + + + + +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\Http\Client\Response` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](./Stream/StreamInterface.md) +* `\Generator` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator, mixed, array{_: string, id: string, parts: int, name: string, mime_type: string, key_fingerprint?: mixed, key?: mixed, iv?: mixed, md5_checksum: string}> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFileInfo(mixed $constructor): \Generator` + +Get info about file. + + +Parameters: +* `$constructor`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `getPropicInfo(mixed $messageMedia): \Generator` + +Get download info of the propic of a user +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `extractBotAPIFile(array $info): ?array` + +Extract file info from bot API message. + + +Parameters: +* `$info`: `array` Bot API message object + + + +### `getDownloadInfo(mixed $messageMedia): \Generator` + +Get download info of file +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|array|bool|mixed, mixed, false|string> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Generator` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|array|bool|mixed, mixed, false|string> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Generator` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Generator` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Generator|\Amp\Promise|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Generator` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](./Stream/StreamInterface.md) +* `\Generator` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](./FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](./Stream/StreamInterface.md) +* `\Generator` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](./Stream/StreamInterface.md) +* `\Generator` + + + + +### `acceptSecretChat(array $params): \Generator` + +Accept secret chat. + + +Parameters: +* `$params`: `array` Secret chat ID + + +#### See also: +* `\Generator` + + + + +### `requestSecretChat(mixed $user): \Generator` + +Request secret chat. + + +Parameters: +* `$user`: `mixed` User to start secret chat with + + +#### See also: +* `\Generator` + + + + +### `rekey(int $chat): \Generator` + +Rekey secret chat. + + +Parameters: +* `$chat`: `int` Secret chat to rekey + + +#### See also: +* `\Generator` + + + + +### `secretChatStatus(int $chat): \int One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY` + +Get secret chat status. + + +Parameters: +* `$chat`: `int` Chat ID + + +Return value: One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY + + +### `getSecretChat(array|int $chat): array` + +Get secret chat. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + + +### `hasSecretChat(array|int $chat): bool` + +Check whether secret chat exists. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + + +### `discardSecretChat(int $chat): \Generator` + +Discard secret chat. + + +Parameters: +* `$chat`: `int` Secret chat ID + + +#### See also: +* `\Generator` + + + + +### `mbStrlen(string $text): float|int` + +Get Telegram UTF-8 length of string. + + +Parameters: +* `$text`: `string` Text + + + +### `mbSubstr(string $text, int $offset, ?int $length): string` + +Telegram UTF-8 multibyte substring. + + +Parameters: +* `$text`: `string` Text to substring +* `$offset`: `int` Offset +* `$length`: `?int` Length + + + +### `mbStrSplit(string $text, int $length): array` + +Telegram UTF-8 multibyte split. + + +Parameters: +* `$text`: `string` Text +* `$length`: `int` Length + + + +### `MTProtoToBotAPI(array $data): \Generator` + +Convert MTProto parameters to bot API parameters. + + +Parameters: +* `$data`: `array` Data + + +#### See also: +* `\Generator` + + + + +### `botAPIToMTProto(array $arguments): \Generator` + +Convert bot API parameters to MTProto parameters. + + +Parameters: +* `$arguments`: `array` Arguments + + +#### See also: +* `\Generator` + + + + +### `unpackFileId(string $fileId): \array Unpacked file ID` + +Unpack bot API file ID. + + +Parameters: +* `$fileId`: `string` Bot API file ID + + +Return value: Unpacked file ID + + +### `tdcliToTd(array $params, array $key): array` + +Convert tdcli parameters to tdcli. + + +Parameters: +* `$params`: `array` Params +* `$key`: `array` Key + + + +### `tdToMTProto(array $params): \Generator` + +Convert TD to MTProto parameters. + + +Parameters: +* `$params`: `array` Parameters + + +#### See also: +* `\Generator` + + + + +### `MTProtoToTdcli(mixed $params): \Generator` + +MTProto to TDCLI params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Generator` + + + + +### `MTProtoToTd(mixed $params): \Generator` + +MTProto to TD params. + + +Parameters: +* `$params`: `mixed` Params + + +#### See also: +* `\Generator` + + + + +### `tdToTdcli(mixed $params): mixed` + +Convert TD parameters to tdcli. + + +Parameters: +* `$params`: `mixed` Parameters + + + +### `requestCall(mixed $user): \Generator` + +Request VoIP call. + + +Parameters: +* `$user`: `mixed` User + + +#### See also: +* `\Generator` + + + + +### `acceptCall(array $call): \Generator` + +Accept call. + + +Parameters: +* `$call`: `array` Call + + +#### See also: +* `\Generator` + + + + +### `confirmCall(array $params): \Generator` + +Confirm call. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Generator` + + + + +### `completeCall(array $params): \Generator` + +Complete call handshake. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Generator` + + + + +### `callStatus(int $id): int` + +Get call status. + + +Parameters: +* `$id`: `int` Call ID + + + +### `getCall(int $call): array` + +Get call info. + + +Parameters: +* `$call`: `int` Call ID + + + +### `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Generator` + +Discard call. + + +Parameters: +* `$call`: `array` Call +* `$reason`: `array` +* `$rating`: `array` Rating +* `$need_debug`: `bool` Need debug? + + +#### See also: +* `\Generator` + + + + +### `getDialogs(bool $force): \Generator` + +Get dialog peers. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +Fully typed return value: +``` +\Generator, mixed, list> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFullDialogs(bool $force): \Generator` + +Get full info of all dialogs. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +#### See also: +* `\Generator` + + + + +### `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Generator` + +Set event handler. + + +Parameters: +* `$eventHandler`: `class-string<\danog\MadelineProto\EventHandler>` Event handler + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) +* `\Generator` + + + + +### `unsetEventHandler(bool $disableUpdateHandling): void` + +Unset event handler. + + +Parameters: +* `$disableUpdateHandling`: `bool` Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler) + + + +### `getEventHandler(): \danog\MadelineProto\EventHandler` + +Get event handler. + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](./EventHandler.md) + + + + +### `hasEventHandler(): bool` + +Check if an event handler instance is present. + + + +### `setWebhook(string $hook_url, string $pem_path): void` + +Set webhook update handler. + + +Parameters: +* `$hook_url`: `string` Webhook URL +* `$pem_path`: `string` PEM path for self-signed certificate + + + +### `setCallback(callable $callback): void` + +Set update handling callback. + + +Parameters: +* `$callback`: `callable` Callback + + + +### `logout(): \Generator` + +Log out currently logged in user. + + +#### See also: +* `\Generator` + + + + +### `botLogin(string $token): \Generator` + +Login as bot. + + +Parameters: +* `$token`: `string` Bot token + + +#### See also: +* `\Generator` + + + + +### `phoneLogin(string $number, int $sms_type): \Generator` + +Login as user. + + +Parameters: +* `$number`: `string` Phone number +* `$sms_type`: `int` SMS type + + +#### See also: +* `\Generator` + + + + +### `completePhoneLogin(string $code): \Generator` + +Complet user login using login code. + + +Parameters: +* `$code`: `string` Login code + + +#### See also: +* `\Generator` + + + + +### `importAuthorization(mixed $authorization): \Generator` + +Import authorization. + + +Parameters: +* `$authorization`: `mixed` Authorization info + + +#### See also: +* `\Generator` + + + + +### `exportAuthorization(): \Generator` + +Export authorization. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Generator` + + + + +### `completeSignup(string $first_name, string $last_name): \Generator` + +Complete signup to Telegram. + + +Parameters: +* `$first_name`: `string` First name +* `$last_name`: `string` Last name + + +#### See also: +* `\Generator` + + + + +### `complete2faLogin(string $password): \Generator` + +Complete 2FA login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Generator` + + + + +### `update2fa(array $params): \Generator` + +Update the 2FA password. +The params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` The params + + +#### See also: +* `\Generator` + + + + +### `initSelfRestart(): void` + +Initialize self-restart hack. + + + +### `loop(callable|null $callback): \Generator` + +Start MadelineProto's update handling loop, or run the provided async callable. + + +Parameters: +* `$callback`: `callable|null` Async callable to run + + +#### See also: +* `\Generator` + + + + +### `stop(): void` + +Stop update loop. + + + +### `restart(): void` + +Restart update loop. + + + +### `loopFork(): \Amp\Promise` + +Start MadelineProto's update handling loop in background. + + +#### See also: +* `\Amp\Promise` + + + + +### `closeConnection(string $message): void` + +Close connection with client, connected via web. + + +Parameters: +* `$message`: `string` Message + + + +### `setNoop(): void` + +Set NOOP update handler, ignoring all updates. + + + +### `start(): \Generator` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Generator` + + + + +### `getWebTemplate(): string` + +Get web template. + + + +### `setWebTemplate(string $template): void` + +Set web template. + + +Parameters: +* `$template`: `string` Template + + + +### `checkTos(): \Generator` + +Check for terms of service update. + + +#### See also: +* `\Generator` + + + + +### `acceptTos(): \Generator` + +Accept terms of service update. + + +#### See also: +* `\Generator` + + + + +### `declineTos(): \Generator` + +Decline terms of service update. +THIS WILL DELETE YOUR ACCOUNT! + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProto/AuthKey.md b/docs/PHPInternal/danog/MadelineProto/MTProto/AuthKey.md new file mode 100644 index 00000000..d1c74d53 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProto/AuthKey.md @@ -0,0 +1,96 @@ +--- +title: danog\MadelineProto\MTProto\AuthKey: MTProto auth key. +description: + +--- +# `danog\MadelineProto\MTProto\AuthKey` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MTProto auth key. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setAuthKey(string $authKey): void` +* `hasAuthKey(): bool` +* `getAuthKey(): string` +* `getID(): string` +* `setServerSalt(string $salt): void` +* `getServerSalt(): string` +* `hasServerSalt(): bool` +* `isAuthorized(): bool` +* `authorized(bool $authorized): void` + +## Methods: +### `setAuthKey(string $authKey): void` + +Set auth key. + + +Parameters: +* `$authKey`: `string` Authorization key + + + +### `hasAuthKey(): bool` + +Check if auth key is present. + + + +### `getAuthKey(): string` + +Get auth key. + + + +### `getID(): string` + +Get auth key ID. + + + +### `setServerSalt(string $salt): void` + +Set server salt. + + +Parameters: +* `$salt`: `string` Server salt + + + +### `getServerSalt(): string` + +Get server salt. + + + +### `hasServerSalt(): bool` + +Check if has server salt. + + + +### `isAuthorized(): bool` + +Check if we are logged in. + + + +### `authorized(bool $authorized): void` + +Set the authorized boolean. + + +Parameters: +* `$authorized`: `bool` Whether we are authorized + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProto/PermAuthKey.md b/docs/PHPInternal/danog/MadelineProto/MTProto/PermAuthKey.md new file mode 100644 index 00000000..8ffafa53 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProto/PermAuthKey.md @@ -0,0 +1,103 @@ +--- +title: danog\MadelineProto\MTProto\PermAuthKey: MTProto permanent auth key. +description: + +--- +# `danog\MadelineProto\MTProto\PermAuthKey` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MTProto permanent auth key. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `isAuthorized(): bool` +* `authorized(bool $authorized): void` +* `jsonSerialize(): array` +* `setAuthKey(string $authKey): void` +* `hasAuthKey(): bool` +* `getAuthKey(): string` +* `getID(): string` +* `setServerSalt(string $salt): void` +* `getServerSalt(): string` +* `hasServerSalt(): bool` + +## Methods: +### `isAuthorized(): bool` + +Check if we are logged in. + + + +### `authorized(bool $authorized): void` + +Set the authorized boolean. + + +Parameters: +* `$authorized`: `bool` Whether we are authorized + + + +### `jsonSerialize(): array` + +JSON serialization function. + + + +### `setAuthKey(string $authKey): void` + +Set auth key. + + +Parameters: +* `$authKey`: `string` Authorization key + + + +### `hasAuthKey(): bool` + +Check if auth key is present. + + + +### `getAuthKey(): string` + +Get auth key. + + + +### `getID(): string` + +Get auth key ID. + + + +### `setServerSalt(string $salt): void` + +Set server salt. + + +Parameters: +* `$salt`: `string` Server salt + + + +### `getServerSalt(): string` + +Get server salt. + + + +### `hasServerSalt(): bool` + +Check if has server salt. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProto/TempAuthKey.md b/docs/PHPInternal/danog/MadelineProto/MTProto/TempAuthKey.md new file mode 100644 index 00000000..65320559 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProto/TempAuthKey.md @@ -0,0 +1,163 @@ +--- +title: danog\MadelineProto\MTProto\TempAuthKey: MTProto temporary auth key. +description: + +--- +# `danog\MadelineProto\MTProto\TempAuthKey` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MTProto temporary auth key. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `init(bool $init): void` +* `isInited(): bool` +* `bind(\danog\MadelineProto\MTProto\PermAuthKey|null $bound, bool $pfs): void` +* `isBound(): bool` +* `isAuthorized(): bool` +* `authorized(bool $authorized): void` +* `expires(int $expires): void` +* `expired(): bool` +* `jsonSerialize(): array` +* `setAuthKey(string $authKey): void` +* `hasAuthKey(): bool` +* `getAuthKey(): string` +* `getID(): string` +* `setServerSalt(string $salt): void` +* `getServerSalt(): string` +* `hasServerSalt(): bool` + +## Methods: +### `init(bool $init): void` + +Init or deinit connection for auth key. + + +Parameters: +* `$init`: `bool` Init or deinit + + + +### `isInited(): bool` + +Check if connection is inited for auth key. + + + +### `bind(\danog\MadelineProto\MTProto\PermAuthKey|null $bound, bool $pfs): void` + +Bind auth key. + + +Parameters: +* `$bound`: `\danog\MadelineProto\MTProto\PermAuthKey|null` Permanent auth key +* `$pfs`: `bool` Whether to bind using PFS + + +#### See also: +* [`\danog\MadelineProto\MTProto\PermAuthKey`: MTProto permanent auth key.](./PermAuthKey.md) + + + + +### `isBound(): bool` + +Check if auth key is bound. + + + +### `isAuthorized(): bool` + +Check if we are logged in. + + + +### `authorized(bool $authorized): void` + +Set the authorized boolean. + + +Parameters: +* `$authorized`: `bool` Whether we are authorized + + + +### `expires(int $expires): void` + +Set expiration date of temporary auth key. + + +Parameters: +* `$expires`: `int` Expiration date + + + +### `expired(): bool` + +Check if auth key has expired. + + + +### `jsonSerialize(): array` + +JSON serialization function. + + + +### `setAuthKey(string $authKey): void` + +Set auth key. + + +Parameters: +* `$authKey`: `string` Authorization key + + + +### `hasAuthKey(): bool` + +Check if auth key is present. + + + +### `getAuthKey(): string` + +Get auth key. + + + +### `getID(): string` + +Get auth key ID. + + + +### `setServerSalt(string $salt): void` + +Set server salt. + + +Parameters: +* `$salt`: `string` Server salt + + + +### `getServerSalt(): string` + +Get server salt. + + + +### `hasServerSalt(): bool` + +Check if has server salt. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/AckHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/AckHandler.md new file mode 100644 index 00000000..7c2d9ef9 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/AckHandler.md @@ -0,0 +1,70 @@ +--- +title: danog\MadelineProto\MTProtoSession\AckHandler: Manages acknowledgement of messages. +description: + +--- +# `danog\MadelineProto\MTProtoSession\AckHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages acknowledgement of messages. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `ackOutgoingMessageId(string|int $message_id): bool` +* `gotResponseForOutgoingMessageId(string|int $message_id): bool` +* `ackIncomingMessageId(string|int $message_id): bool` +* `hasPendingCalls(): bool` +* `getPendingCalls(): array` + +## Methods: +### `ackOutgoingMessageId(string|int $message_id): bool` + +Acknowledge outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message Id + + + +### `gotResponseForOutgoingMessageId(string|int $message_id): bool` + +We have gotten response for outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `ackIncomingMessageId(string|int $message_id): bool` + +Acknowledge incoming message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `hasPendingCalls(): bool` + +Check if there are some pending calls. + + + +### `getPendingCalls(): array` + +Get all pending calls (also clear pending state requests). + + + +## Properties +* `$shared`: `\DataCenterConnection` \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/CallHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/CallHandler.md new file mode 100644 index 00000000..91f6075f --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/CallHandler.md @@ -0,0 +1,95 @@ +--- +title: danog\MadelineProto\MTProtoSession\CallHandler: Manages method and object calls. +description: + +--- +# `danog\MadelineProto\MTProtoSession\CallHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages method and object calls. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `methodRecall(string $watcherId, array $args): void` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` +* `objectCall(string $object, array $args, array $aargs): \Generator` + +## Methods: +### `methodRecall(string $watcherId, array $args): void` + +Recall method. + + +Parameters: +* `$watcherId`: `string` Watcher ID for defer +* `$args`: `array` Args + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent (generator). + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `objectCall(string $object, array $args, array $aargs): \Generator` + +Send object and make sure it is asynchronously sent (generator). + + +Parameters: +* `$object`: `string` Object name +* `$args`: `array` Arguments +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler.md new file mode 100644 index 00000000..a081b932 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler.md @@ -0,0 +1,67 @@ +--- +title: danog\MadelineProto\MTProtoSession\MsgIdHandler: Manages message ids. +description: + +--- +# `danog\MadelineProto\MTProtoSession\MsgIdHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages message ids. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `createInstance(\danog\MadelineProto\Connection $session): self` +* `checkMessageId(string $newMessageId, array $aargs): void` +* `generateMessageId(): string` +* `getMaxId(bool $incoming): mixed` + +## Methods: +### `createInstance(\danog\MadelineProto\Connection $session): self` + +Create MsgIdHandler instance. + + +Parameters: +* `$session`: `\danog\MadelineProto\Connection` Session + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](../Connection.md) + + + + +### `checkMessageId(string $newMessageId, array $aargs): void` + +Check validity of given message ID. + + +Parameters: +* `$newMessageId`: `string` New message ID +* `$aargs`: `array` Params + + + +### `generateMessageId(): string` + +Generate outgoing message ID. + + + +### `getMaxId(bool $incoming): mixed` + +Get maximum message ID. + + +Parameters: +* `$incoming`: `bool` Incoming or outgoing message ID + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler32.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler32.md new file mode 100644 index 00000000..35f34310 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler32.md @@ -0,0 +1,74 @@ +--- +title: danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler32: Manages message ids. +description: + +--- +# `danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler32` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Manages message ids. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `checkMessageId(string $newMessageId, array $aargs): void` +* `generateMessageId(): string` +* `getMaxId(bool $incoming): mixed` +* `reset(): void` +* `createInstance(\danog\MadelineProto\Connection $session): self` + +## Methods: +### `checkMessageId(string $newMessageId, array $aargs): void` + +Check validity of given message ID. + + +Parameters: +* `$newMessageId`: `string` New message ID +* `$aargs`: `array` Params + + + +### `generateMessageId(): string` + +Generate message ID. + + + +### `getMaxId(bool $incoming): mixed` + +Get maximum message ID. + + +Parameters: +* `$incoming`: `bool` Incoming or outgoing message ID + + + +### `reset(): void` + +Reset message IDs. + + + +### `createInstance(\danog\MadelineProto\Connection $session): self` + +Create MsgIdHandler instance. + + +Parameters: +* `$session`: `\danog\MadelineProto\Connection` Session + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](../Connection.md) + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler64.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler64.md new file mode 100644 index 00000000..9e8d45de --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler64.md @@ -0,0 +1,67 @@ +--- +title: danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler64: Manages message ids. +description: + +--- +# `danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler64` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Manages message ids. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `checkMessageId(string $newMessageId, array $aargs): void` +* `generateMessageId(): string` +* `getMaxId(bool $incoming): mixed` +* `createInstance(\danog\MadelineProto\Connection $session): self` + +## Methods: +### `checkMessageId(string $newMessageId, array $aargs): void` + +Check validity of given message ID. + + +Parameters: +* `$newMessageId`: `string` New message ID +* `$aargs`: `array` Params + + + +### `generateMessageId(): string` + +Generate message ID. + + + +### `getMaxId(bool $incoming): mixed` + +Get maximum message ID. + + +Parameters: +* `$incoming`: `bool` Incoming or outgoing message ID + + + +### `createInstance(\danog\MadelineProto\Connection $session): self` + +Create MsgIdHandler instance. + + +Parameters: +* `$session`: `\danog\MadelineProto\Connection` Session + + +#### See also: +* [`\danog\MadelineProto\Connection`: Connection class.](../Connection.md) + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/Reliable.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/Reliable.md new file mode 100644 index 00000000..f95f5980 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/Reliable.md @@ -0,0 +1,38 @@ +--- +title: danog\MadelineProto\MTProtoSession\Reliable: Manages responses. +description: + +--- +# `danog\MadelineProto\MTProtoSession\Reliable` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages responses. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +## Methods: +### `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +Send state info for message IDs. + + +Parameters: +* `$req_msg_id`: `string|int` Message ID of msgs_state_req that initiated this +* `$msg_ids`: `array` Message IDs to send info about + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/ResponseHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/ResponseHandler.md new file mode 100644 index 00000000..bf984e78 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/ResponseHandler.md @@ -0,0 +1,45 @@ +--- +title: danog\MadelineProto\MTProtoSession\ResponseHandler: Manages responses. +description: + +--- +# `danog\MadelineProto\MTProtoSession\ResponseHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages responses. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `handleReject(array $request, \Throwable $data): void` +* `handleResponse(): void` + +## Methods: +### `handleReject(array $request, \Throwable $data): void` + +Reject request with exception. + + +Parameters: +* `$request`: `array` Request +* `$data`: `\Throwable` Exception + + +#### See also: +* `\Throwable` + + + + +### `handleResponse(): void` + + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/SeqNoHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/SeqNoHandler.md new file mode 100644 index 00000000..1e32d6af --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/SeqNoHandler.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\MTProtoSession\SeqNoHandler: Manages sequence number. +description: + +--- +# `danog\MadelineProto\MTProtoSession\SeqNoHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages sequence number. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoSession/Session.md b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/Session.md new file mode 100644 index 00000000..796a8c26 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoSession/Session.md @@ -0,0 +1,204 @@ +--- +title: danog\MadelineProto\MTProtoSession\Session: Manages MTProto session-specific data. +description: + +--- +# `danog\MadelineProto\MTProtoSession\Session` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages MTProto session-specific data. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `resetSession(): void` +* `createSession(): void` +* `backupSession(): array` +* `ackOutgoingMessageId(string|int $message_id): bool` +* `gotResponseForOutgoingMessageId(string|int $message_id): bool` +* `ackIncomingMessageId(string|int $message_id): bool` +* `hasPendingCalls(): bool` +* `getPendingCalls(): array` +* `handleReject(array $request, \Throwable $data): void` +* `handleResponse(): void` +* `methodRecall(string $watcherId, array $args): void` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` +* `objectCall(string $object, array $args, array $aargs): \Generator` +* `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +## Methods: +### `resetSession(): void` + +Reset MTProto session. + + + +### `createSession(): void` + +Create MTProto session if needed. + + + +### `backupSession(): array` + +Backup eventual unsent messages before session deletion. + + + +### `ackOutgoingMessageId(string|int $message_id): bool` + +Acknowledge outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message Id + + + +### `gotResponseForOutgoingMessageId(string|int $message_id): bool` + +We have gotten response for outgoing message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `ackIncomingMessageId(string|int $message_id): bool` + +Acknowledge incoming message ID. + + +Parameters: +* `$message_id`: `string|int` Message ID + + + +### `hasPendingCalls(): bool` + +Check if there are some pending calls. + + + +### `getPendingCalls(): array` + +Get all pending calls (also clear pending state requests). + + + +### `handleReject(array $request, \Throwable $data): void` + +Reject request with exception. + + +Parameters: +* `$request`: `array` Request +* `$data`: `\Throwable` Exception + + +#### See also: +* `\Throwable` + + + + +### `handleResponse(): void` + + + + + +### `methodRecall(string $watcherId, array $args): void` + +Recall method. + + +Parameters: +* `$watcherId`: `string` Watcher ID for defer +* `$args`: `array` Args + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent (generator). + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `objectCall(string $object, array $args, array $aargs): \Generator` + +Send object and make sure it is asynchronously sent (generator). + + +Parameters: +* `$object`: `string` Object name +* `$args`: `array` Arguments +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `sendMsgsStateInfo(string|int $req_msg_id, array $msg_ids): \Generator` + +Send state info for message IDs. + + +Parameters: +* `$req_msg_id`: `string|int` Message ID of msgs_state_req that initiated this +* `$msg_ids`: `array` Message IDs to send info about + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/AuthKeyHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/AuthKeyHandler.md new file mode 100644 index 00000000..97fcad52 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/AuthKeyHandler.md @@ -0,0 +1,21 @@ +--- +title: danog\MadelineProto\MTProtoTools\AuthKeyHandler: Manages the creation of the authorization key. +description: https://core.telegram.org/mtproto/auth_key +https://core.telegram.org/mtproto/samples-auth_key + +--- +# `danog\MadelineProto\MTProtoTools\AuthKeyHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages the creation of the authorization key. + +https://core.telegram.org/mtproto/auth_key +https://core.telegram.org/mtproto/samples-auth_key + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). ## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/CallHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/CallHandler.md new file mode 100644 index 00000000..4eddbd49 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/CallHandler.md @@ -0,0 +1,89 @@ +--- +title: danog\MadelineProto\MTProtoTools\CallHandler: Manages method and object calls. +description: + +--- +# `danog\MadelineProto\MTProtoTools\CallHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages method and object calls. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `methodCall(string $method, array|\Generator $args, array $aargs): mixed` +* `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` +* `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +## Methods: +### `methodCall(string $method, array|\Generator $args, array $aargs): mixed` + +Synchronous wrapper for methodCall. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncRead(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and wait asynchronously for response. +If the $aargs['noResponse'] is true, will not wait for a response. + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +### `methodCallAsyncWrite(string $method, array|\Generator $args, array $aargs): \Generator` + +Call method and make sure it is asynchronously sent. + + +Parameters: +* `$method`: `string` Method name +* `$args`: `array|\Generator` Arguments + Full type: + ``` + array|\Generator + ``` +* `$aargs`: `array` Additional arguments + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/CombinedUpdatesState.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/CombinedUpdatesState.md new file mode 100644 index 00000000..d5ffb499 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/CombinedUpdatesState.md @@ -0,0 +1,72 @@ +--- +title: danog\MadelineProto\MTProtoTools\CombinedUpdatesState: Stores multiple update states. +description: + +--- +# `danog\MadelineProto\MTProtoTools\CombinedUpdatesState` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Stores multiple update states. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `get(int $channel, array $init): \danog\MadelineProto\MTProtoTools\UpdatesState|\danog\MadelineProto\MTProtoTools\UpdatesState[]` +* `remove(int $channel): void` +* `has(int $channel): bool` +* `syncLoading(int $channel, bool|null $set): bool` + +## Methods: +### `get(int $channel, array $init): \danog\MadelineProto\MTProtoTools\UpdatesState|\danog\MadelineProto\MTProtoTools\UpdatesState[]` + +Get or update multiple parameters. + + +Parameters: +* `$channel`: `int` Channel to get info about (optional, if not provided returns the entire info array) +* `$init`: `array` Parameters to update + + +#### See also: +* [`\danog\MadelineProto\MTProtoTools\UpdatesState`: Stores the state of updates.](./UpdatesState.md) + + + + +### `remove(int $channel): void` + +Remove update state. + + +Parameters: +* `$channel`: `int` Channel whose state should be removed + + + +### `has(int $channel): bool` + +Check if update state is present. + + +Parameters: +* `$channel`: `int` Channel ID + + + +### `syncLoading(int $channel, bool|null $set): bool` + +Are we currently busy? + + +Parameters: +* `$channel`: `int` Channel to get info about +* `$set`: `bool|null` Busy flag to set before returning + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/Files.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/Files.md new file mode 100644 index 00000000..1cdcbf9d --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/Files.md @@ -0,0 +1,405 @@ +--- +title: danog\MadelineProto\MTProtoTools\Files: Manages upload and download of files. +description: + +--- +# `danog\MadelineProto\MTProtoTools\Files` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages upload and download of files. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` +* `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` +* `getFileInfo(mixed $constructor): \Generator` +* `getPropicInfo(mixed $messageMedia): \Generator` +* `extractBotAPIFile(array $info): ?array` +* `getDownloadInfo(mixed $messageMedia): \Generator` +* `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator` +* `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` +* `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` +* `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` +* `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` +* `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` +* `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` +* `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` +* `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +## Methods: +### `uploadFromUrl(string|\danog\MadelineProto\FileCallbackInterface $url, int $size, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from URL. + + +Parameters: +* `$url`: `string|\danog\MadelineProto\FileCallbackInterface` URL of file +* `$size`: `int` Size of file +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\Http\Client\Response` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `uploadFromCallable(mixed $callable, int $size, string $mime, string $fileName, callable $cb, bool $seekable, bool $encrypted): \Generator` + +Upload file from callable. +The callable must accept two parameters: int $offset, int $size +The callable must return a string with the contest of the file at the specified offset and size. + +Parameters: +* `$callable`: `mixed` Callable +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether chunks can be fetched out of order +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator, mixed, array{_: string, id: string, parts: int, name: string, mime_type: string, key_fingerprint?: mixed, key?: mixed, iv?: mixed, md5_checksum: string}> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `uploadFromTgfile(mixed $media, callable $cb, bool $encrypted): \Generator` + +Reupload telegram file. + + +Parameters: +* `$media`: `mixed` Telegram file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFileInfo(mixed $constructor): \Generator` + +Get info about file. + + +Parameters: +* `$constructor`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `getPropicInfo(mixed $messageMedia): \Generator` + +Get download info of the propic of a user +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `extractBotAPIFile(array $info): ?array` + +Extract file info from bot API message. + + +Parameters: +* `$info`: `array` Bot API message object + + + +### `getDownloadInfo(mixed $messageMedia): \Generator` + +Get download info of file +Returns an array with the following structure:. +`$info['ext']` - The file extension +`$info['name']` - The file name, without the extension +`$info['mime']` - The file mime type +`$info['size']` - The file size + +Parameters: +* `$messageMedia`: `mixed` File ID + + +#### See also: +* `\Generator` + + + + +### `downloadToDir(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $dir, callable $cb): \Generator` + +Download file to directory. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$dir`: `string|\danog\MadelineProto\FileCallbackInterface` Directory where to download the file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|array|bool|mixed, mixed, false|string> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Generator` + + + + +### `downloadToFile(mixed $messageMedia, string|\danog\MadelineProto\FileCallbackInterface $file, callable $cb): \Generator Downloaded file path` + +Download file. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$file`: `string|\danog\MadelineProto\FileCallbackInterface` Downloaded file path +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Return value: Downloaded file path + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|array|bool|mixed, mixed, false|string> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Generator` + + + + +### `downloadToCallable(mixed $messageMedia, callable|\danog\MadelineProto\FileCallbackInterface $callable, callable $cb, bool $seekable, int $offset, int $end, int $part_size): \Generator` + +Download file to callable. +The callable must accept two parameters: string $payload, int $offset +The callable will be called (possibly out of order, depending on the value of $seekable). +The callable should return the number of written bytes. + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$callable`: `callable|\danog\MadelineProto\FileCallbackInterface` Chunk callback +* `$cb`: `callable` Status callback (DEPRECATED, use FileCallbackInterface) +* `$seekable`: `bool` Whether the callable can be called out of order +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to stop downloading (inclusive) +* `$part_size`: `int` Size of each chunk + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToBrowser(array|string $messageMedia, callable $cb): \Generator` + +Download file to browser. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$cb`: `callable` Status callback (can also use FileCallback) + + +#### See also: +* `\Generator` + + + + +### `downloadToStream(mixed $messageMedia, mixed|\danog\MadelineProto\FileCallbackInterface $stream, callable $cb, int $offset, int $end): \Generator` + +Download file to stream. + + +Parameters: +* `$messageMedia`: `mixed` File to download +* `$stream`: `mixed|\danog\MadelineProto\FileCallbackInterface` Stream where to download file +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$offset`: `int` Offset where to start downloading +* `$end`: `int` Offset where to end download + + +Fully typed return value: +``` +\Generator|\Amp\Promise|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Ipc\Sync\ChannelledSocket` +* `\Amp\Promise` +* `\Generator` + + + + +### `downloadToResponse(array|string $messageMedia, \ServerRequest $request, callable $cb): \Generator Returned response` + +Download file to amphp/http-server response. +Supports HEAD requests and content-ranges for parallel and resumed downloads. + +Parameters: +* `$messageMedia`: `array|string` File to download +* `$request`: `\ServerRequest` Request +* `$cb`: `callable` Status callback (can also use FileCallback) + + +Return value: Returned response + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\ServerRequest` +* `\Amp\Http\Server\Response` +* `\Generator` + + + + +### `uploadEncrypted(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb): \Generator` + +Upload file to secret chat. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `upload(\danog\MadelineProto\FileCallbackInterface|string|array $file, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file. + + +Parameters: +* `$file`: `\danog\MadelineProto\FileCallbackInterface|string|array` File, URL or Telegram file to upload +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* [`\danog\MadelineProto\FileCallbackInterface`: File callback interface.](../FileCallbackInterface.md) +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `uploadFromStream(mixed $stream, int $size, string $mime, string $fileName, callable $cb, bool $encrypted): \Generator` + +Upload file from stream. + + +Parameters: +* `$stream`: `mixed` PHP resource or AMPHP async stream +* `$size`: `int` File size +* `$mime`: `string` Mime type +* `$fileName`: `string` File name +* `$cb`: `callable` Callback (DEPRECATED, use FileCallbackInterface) +* `$encrypted`: `bool` Whether to encrypt file for secret chats + + +Fully typed return value: +``` +\Generator|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, mixed> +``` +#### See also: +* `\Amp\Promise` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/MinDatabase.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/MinDatabase.md new file mode 100644 index 00000000..64e1a2c6 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/MinDatabase.md @@ -0,0 +1,49 @@ +--- +title: danog\MadelineProto\MTProtoTools\MinDatabase: Manages min peers. +description: + +--- +# `danog\MadelineProto\MTProtoTools\MinDatabase` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages min peers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\MTProtoTools\MinDatabase::SWITCH_CONSTRUCTORS`: + +* `danog\MadelineProto\MTProtoTools\MinDatabase::CATCH_PEERS`: + +* `danog\MadelineProto\MTProtoTools\MinDatabase::ORIGINS`: + + +## Method list: +* `hasPeer(float|int $id): \Amp\Promise` + +## Methods: +### `hasPeer(float|int $id): \Amp\Promise` + +Check if location info is available for peer. + + +Parameters: +* `$id`: `float|int` Peer ID + + +Fully typed return value: +``` +\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/PasswordCalculator.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/PasswordCalculator.md new file mode 100644 index 00000000..d8d7bcc4 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/PasswordCalculator.md @@ -0,0 +1,100 @@ +--- +title: danog\MadelineProto\MTProtoTools\PasswordCalculator: Manages SRP password calculation. +description: + +--- +# `danog\MadelineProto\MTProtoTools\PasswordCalculator` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages SRP password calculation. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `addInfo(array $object): void` +* `createSalt(string $prefix): \string Salt` +* `hashSha256(string $data, string $salt): \string Hash` +* `hashPassword(string $password, string $client_salt, string $server_salt): \string Resulting hash` +* `getCheckPassword(string $password): \array InputCheckPassword object` +* `getPassword(array $params): \array account.updatePasswordSettings parameters` + +## Methods: +### `addInfo(array $object): void` + +Popupate 2FA configuration. + + +Parameters: +* `$object`: `array` 2FA configuration object obtained using account.getPassword + + + +### `createSalt(string $prefix): \string Salt` + +Create a random string (eventually prefixed by the specified string). + + +Parameters: +* `$prefix`: `string` Prefix + + +Return value: Salt + + +### `hashSha256(string $data, string $salt): \string Hash` + +Hash specified data using the salt with SHA256. +The result will be the SHA256 hash of the salt concatenated with the data concatenated with the salt + +Parameters: +* `$data`: `string` Data to hash +* `$salt`: `string` Salt + + +Return value: Hash + + +### `hashPassword(string $password, string $client_salt, string $server_salt): \string Resulting hash` + +Hashes the specified password. + + +Parameters: +* `$password`: `string` Password +* `$client_salt`: `string` Client salt +* `$server_salt`: `string` Server salt + + +Return value: Resulting hash + + +### `getCheckPassword(string $password): \array InputCheckPassword object` + +Get the InputCheckPassword object for checking the validity of a password using account.checkPassword. + + +Parameters: +* `$password`: `string` The password + + +Return value: InputCheckPassword object + + +### `getPassword(array $params): \array account.updatePasswordSettings parameters` + +Get parameters to be passed to the account.updatePasswordSettings to update/set a 2FA password. +The input params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` Input params + + +Return value: account.updatePasswordSettings parameters + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/PeerHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/PeerHandler.md new file mode 100644 index 00000000..a242b328 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/PeerHandler.md @@ -0,0 +1,214 @@ +--- +title: danog\MadelineProto\MTProtoTools\PeerHandler: Manages peers. +description: + +--- +# `danog\MadelineProto\MTProtoTools\PeerHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages peers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `toSupergroup(int $id): float|int` +* `fromSupergroup(int $id): float|int` +* `isSupergroup(int $id): bool` +* `addUser(array $user): \Generator` +* `peerIsset(mixed $id): \Generator` +* `getFolderId(mixed $id): ?int` +* `getId(mixed $id): int` +* `getInfo(mixed $id, bool $recursive): \Generator Info object` +* `fullChatLastUpdated(mixed $id): \Generator` +* `getFullInfo(mixed $id): \Generator FullInfo object` +* `getPwrChat(mixed $id): \Generator Chat object` +* `resolveUsername(string $username): \Generator` + +## Methods: +### `toSupergroup(int $id): float|int` + +Convert MTProto channel ID to bot API channel ID. + + +Parameters: +* `$id`: `int` MTProto channel ID + + + +### `fromSupergroup(int $id): float|int` + +Convert bot API channel ID to MTProto channel ID. + + +Parameters: +* `$id`: `int` Bot API channel ID + + + +### `isSupergroup(int $id): bool` + +Check whether provided bot API ID is a channel. + + +Parameters: +* `$id`: `int` Bot API ID + + + +### `addUser(array $user): \Generator` + +Add user info. + + +Parameters: +* `$user`: `array` User info + + +#### See also: +* `\Generator` + + + + +### `peerIsset(mixed $id): \Generator` + +Check if peer is present in internal peer database. + + +Parameters: +* `$id`: `mixed` Peer + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFolderId(mixed $id): ?int` + +Get folder ID from object. + + +Parameters: +* `$id`: `mixed` Object + + + +### `getId(mixed $id): int` + +Get bot API ID from peer object. + + +Parameters: +* `$id`: `mixed` Peer + + + +### `getInfo(mixed $id, bool $recursive): \Generator Info object` + +Get info about peer, returns an Info object. + + +Parameters: +* `$id`: `mixed` Peer +* `$recursive`: `bool` Internal + + +Return value: Info object + +Fully typed return value: +``` +\Generator|array, mixed, array{InputPeer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}, Peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}, DialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, NotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputDialogPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, InputNotifyPeer: array{_: string, peer: array{_: string, user_id?: mixed, access_hash?: mixed, min?: mixed, chat_id?: mixed, channel_id?: mixed}}, bot_api_id: int|string, user_id?: int, chat_id?: int, channel_id?: int, InputUser?: array{_: string, user_id?: int, access_hash?: mixed, min?: bool}, InputChannel?: array{_: string, channel_id: int, access_hash: mixed, min: bool}, type: string}> +``` +#### See also: +* [https://docs.madelineproto.xyz/Info.html](https://docs.madelineproto.xyz/Info.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `fullChatLastUpdated(mixed $id): \Generator` + +When were full info for this chat last cached. + + +Parameters: +* `$id`: `mixed` Chat ID + + +#### See also: +* `\Generator` + + + + +### `getFullInfo(mixed $id): \Generator FullInfo object` + +Get full info about peer, returns an FullInfo object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: FullInfo object + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [https://docs.madelineproto.xyz/FullInfo.html](https://docs.madelineproto.xyz/FullInfo.html) +* `\Amp\Promise` +* `\Generator` + + + + +### `getPwrChat(mixed $id): \Generator Chat object` + +Get full info about peer (including full list of channel members), returns a Chat object. + + +Parameters: +* `$id`: `mixed` Peer + + +Return value: Chat object + +#### See also: +* [https://docs.madelineproto.xyz/Chat.html](https://docs.madelineproto.xyz/Chat.html) + + + + +### `resolveUsername(string $username): \Generator` + +Resolve username (use getInfo instead). + + +Parameters: +* `$username`: `string` Username + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/ReferenceDatabase.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/ReferenceDatabase.md new file mode 100644 index 00000000..6dc27e76 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/ReferenceDatabase.md @@ -0,0 +1,49 @@ +--- +title: danog\MadelineProto\MTProtoTools\ReferenceDatabase: Manages upload and download of files. +description: + +--- +# `danog\MadelineProto\MTProtoTools\ReferenceDatabase` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages upload and download of files. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::DOCUMENT_LOCATION`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::PHOTO_LOCATION`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::PHOTO_LOCATION_LOCATION`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::USER_PHOTO_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::PEER_PHOTO_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::STICKER_SET_ID_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::MESSAGE_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::SAVED_GIFS_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::STICKER_SET_RECENT_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::STICKER_SET_FAVED_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::STICKER_SET_EMOTICON_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::WALLPAPER_ORIGIN`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::LOCATION_CONTEXT`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::METHOD_CONTEXT`: + +* `danog\MadelineProto\MTProtoTools\ReferenceDatabase::CONSTRUCTOR_CONTEXT`: + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/ResponseInfo.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/ResponseInfo.md new file mode 100644 index 00000000..375fb76f --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/ResponseInfo.md @@ -0,0 +1,77 @@ +--- +title: danog\MadelineProto\MTProtoTools\ResponseInfo: Obtain response information for file to server. +description: + +--- +# `danog\MadelineProto\MTProtoTools\ResponseInfo` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Obtain response information for file to server. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `parseHeaders(string $method, array $headers, array $messageMedia): self` +* `getCodeExplanation(): string` +* `shouldServe(): \bool Whether to serve file` +* `getServeRange(): \array HTTP serving range` +* `getCode(): \int HTTP response code` +* `getHeaders(): \array Header array` + +## Methods: +### `parseHeaders(string $method, array $headers, array $messageMedia): self` + +Parse headers. + + +Parameters: +* `$method`: `string` HTTP method +* `$headers`: `array` HTTP headers +* `$messageMedia`: `array` Media info + + + +### `getCodeExplanation(): string` + +Get explanation for HTTP code. + + + +### `shouldServe(): \bool Whether to serve file` + +Whether to serve file. + + +Return value: Whether to serve file + + +### `getServeRange(): \array HTTP serving range` + +Get serving range. + + +Return value: HTTP serving range + + +### `getCode(): \int HTTP response code` + +Get HTTP response code. + + +Return value: HTTP response code + + +### `getHeaders(): \array Header array` + +Get header array. + + +Return value: Header array + + diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/UpdateHandler.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/UpdateHandler.md new file mode 100644 index 00000000..7f92d88a --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/UpdateHandler.md @@ -0,0 +1,19 @@ +--- +title: danog\MadelineProto\MTProtoTools\UpdateHandler: Manages updates. +description: + +--- +# `danog\MadelineProto\MTProtoTools\UpdateHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages updates. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). ## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/MTProtoTools/UpdatesState.md b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/UpdatesState.md new file mode 100644 index 00000000..06978d66 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MTProtoTools/UpdatesState.md @@ -0,0 +1,135 @@ +--- +title: danog\MadelineProto\MTProtoTools\UpdatesState: Stores the state of updates. +description: + +--- +# `danog\MadelineProto\MTProtoTools\UpdatesState` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Stores the state of updates. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `isChannel(): bool` +* `getChannel(): int` +* `syncLoading(bool|null $set): bool` +* `update(array $init): self` +* `pts(int $set): \int PTS` +* `qts(int $set): \int QTS` +* `seq(int $set): \int seq` +* `date(int $set): \int Date` +* `checkPts(array $update): \int -1 if it's too old, 0 if it's ok, 1 if it's too new` +* `checkSeq(int $seq): \int -1 if it's too old, 0 if it's ok, 1 if it's too new` + +## Methods: +### `isChannel(): bool` + +Is this state relative to a channel? + + + +### `getChannel(): int` + +Get the channel ID. + + + +### `syncLoading(bool|null $set): bool` + +Are we currently busy? + + +Parameters: +* `$set`: `bool|null` Update the currently busy flag + + + +### `update(array $init): self` + +Update multiple parameters. + + +Parameters: +* `$init`: `array` Parameters to update + + + +### `pts(int $set): \int PTS` + +Get/set PTS. + + +Parameters: +* `$set`: `int` PTS to set + + +Return value: PTS + + +### `qts(int $set): \int QTS` + +Get/set QTS. + + +Parameters: +* `$set`: `int` QTS to set + + +Return value: QTS + + +### `seq(int $set): \int seq` + +Get/set seq. + + +Parameters: +* `$set`: `int` Seq to set + + +Return value: seq + + +### `date(int $set): \int Date` + +Get/set date. + + +Parameters: +* `$set`: `int` Date to set + + +Return value: Date + + +### `checkPts(array $update): \int -1 if it's too old, 0 if it's ok, 1 if it's too new` + +Check validity of PTS contained in update. + + +Parameters: +* `$update`: `array` Update + + +Return value: -1 if it's too old, 0 if it's ok, 1 if it's too new + + +### `checkSeq(int $seq): \int -1 if it's too old, 0 if it's ok, 1 if it's too new` + +Check validity of seq contained in update. + + +Parameters: +* `$seq`: `int` Seq + + +Return value: -1 if it's too old, 0 if it's ok, 1 if it's too new + + diff --git a/docs/PHPInternal/danog/MadelineProto/MyTelegramOrgWrapper.md b/docs/PHPInternal/danog/MadelineProto/MyTelegramOrgWrapper.md new file mode 100644 index 00000000..c9248367 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/MyTelegramOrgWrapper.md @@ -0,0 +1,122 @@ +--- +title: danog\MadelineProto\MyTelegramOrgWrapper: Wrapper for my.telegram.org. +description: + +--- +# `danog\MadelineProto\MyTelegramOrgWrapper` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Wrapper for my.telegram.org. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `login(string $number): \Generator` +* `completeLogin(string $password): \Generator` +* `loggedIn(): bool` +* `hasApp(): \Generator` +* `getApp(): \Generator` +* `createApp(array $settings): \Generator` +* `async(bool $async): void` +* `loop(callable $callable): mixed` + +## Methods: +### `login(string $number): \Generator` + +Login. + + +Parameters: +* `$number`: `string` Phone number + + +#### See also: +* `\Generator` + + + + +### `completeLogin(string $password): \Generator` + +Complete login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Generator` + + + + +### `loggedIn(): bool` + +Whether we are logged in. + + + +### `hasApp(): \Generator` + +Check if an app was already created. + + +#### See also: +* `\Generator` + + + + +### `getApp(): \Generator` + +Get the currently created app. + + +#### See also: +* `\Generator` + + + + +### `createApp(array $settings): \Generator` + +Create an app. + + +Parameters: +* `$settings`: `array` App parameters + + +#### See also: +* `\Generator` + + + + +### `async(bool $async): void` + +Enable or disable async. + + +Parameters: +* `$async`: `bool` Async + + + +### `loop(callable $callable): mixed` + +Run specified callable synchronously. + + +Parameters: +* `$callable`: `callable` Callable + + + diff --git a/docs/PHPInternal/danog/MadelineProto/PTSException.md b/docs/PHPInternal/danog/MadelineProto/PTSException.md new file mode 100644 index 00000000..996a4924 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/PTSException.md @@ -0,0 +1,62 @@ +--- +title: danog\MadelineProto\PTSException: Internal error indicating a problem with Telegram's servers. +description: + +--- +# `danog\MadelineProto\PTSException` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Internal error indicating a problem with Telegram's servers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHPInternal/danog/MadelineProto/PsrLogger.md b/docs/PHPInternal/danog/MadelineProto/PsrLogger.md new file mode 100644 index 00000000..cfd5b591 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/PsrLogger.md @@ -0,0 +1,133 @@ +--- +title: danog\MadelineProto\PsrLogger: PSR-3 wrapper for MadelineProto's Logger. +description: + +--- +# `danog\MadelineProto\PsrLogger` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +PSR-3 wrapper for MadelineProto's Logger. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `log(mixed $level, string $message, array $context): void` +* `emergency(string $message, array $context): void` +* `alert(string $message, array $context): void` +* `critical(string $message, array $context): void` +* `error(string $message, array $context): void` +* `warning(string $message, array $context): void` +* `notice(string $message, array $context): void` +* `info(string $message, array $context): void` +* `debug(string $message, array $context): void` + +## Methods: +### `log(mixed $level, string $message, array $context): void` + +Logs with an arbitrary level. + + +Parameters: +* `$level`: `mixed` +* `$message`: `string` +* `$context`: `array` + + + +### `emergency(string $message, array $context): void` + +System is unusable. + + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `alert(string $message, array $context): void` + +Action must be taken immediately. +Example: Entire website down, database unavailable, etc. This should +trigger the SMS alerts and wake you up. + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `critical(string $message, array $context): void` + +Critical conditions. +Example: Application component unavailable, unexpected exception. + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `error(string $message, array $context): void` + +Runtime errors that do not require immediate action but should typically +be logged and monitored. + + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `warning(string $message, array $context): void` + +Exceptional occurrences that are not errors. +Example: Use of deprecated APIs, poor use of an API, undesirable things +that are not necessarily wrong. + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `notice(string $message, array $context): void` + +Normal but significant events. + + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `info(string $message, array $context): void` + +Interesting events. +Example: User logs in, SQL logs. + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + +### `debug(string $message, array $context): void` + +Detailed debug information. + + +Parameters: +* `$message`: `string` +* `$context`: `array` + + + diff --git a/docs/PHPInternal/danog/MadelineProto/RPCErrorException.md b/docs/PHPInternal/danog/MadelineProto/RPCErrorException.md new file mode 100644 index 00000000..83a68127 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/RPCErrorException.md @@ -0,0 +1,80 @@ +--- +title: danog\MadelineProto\RPCErrorException: Indicates an error returned by Telegram's API. +description: + +--- +# `danog\MadelineProto\RPCErrorException` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Indicates an error returned by Telegram's API. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getLocalization(): string` +* `setLocalization(string $localization): void` +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `getLocalization(): string` + +Get localized error name. + + + +### `setLocalization(string $localization): void` + +Set localized error name. + + +Parameters: +* `$localization`: `string` + + + +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHPInternal/danog/MadelineProto/RSA.md b/docs/PHPInternal/danog/MadelineProto/RSA.md new file mode 100644 index 00000000..7516bcad --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/RSA.md @@ -0,0 +1,54 @@ +--- +title: danog\MadelineProto\RSA: RSA class. +description: + +--- +# `danog\MadelineProto\RSA` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +RSA class. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `load(\danog\MadelineProto\TL\TL $TL, string $rsa_key): \Generator` +* `encrypt(string $data): string` + +## Methods: +### `load(\danog\MadelineProto\TL\TL $TL, string $rsa_key): \Generator` + +Load RSA key. + + +Parameters: +* `$TL`: `\danog\MadelineProto\TL\TL` TL serializer +* `$rsa_key`: `string` RSA key + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* [`\danog\MadelineProto\TL\TL`: TL serialization.](./TL/TL.md) +* `\Generator` + + + + +### `encrypt(string $data): string` + +Encrypt data. + + +Parameters: +* `$data`: `string` Data to encrypt + + + diff --git a/docs/PHPInternal/danog/MadelineProto/ResponseException.md b/docs/PHPInternal/danog/MadelineProto/ResponseException.md new file mode 100644 index 00000000..c0106bab --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/ResponseException.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\ResponseException: Indicates an error thrown when an unexpected response is received from telegram's servers. +description: + +--- +# `danog\MadelineProto\ResponseException` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Indicates an error thrown when an unexpected response is received from telegram's servers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/SecretChats/AuthKeyHandler.md b/docs/PHPInternal/danog/MadelineProto/SecretChats/AuthKeyHandler.md new file mode 100644 index 00000000..0918aeb8 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/SecretChats/AuthKeyHandler.md @@ -0,0 +1,120 @@ +--- +title: danog\MadelineProto\SecretChats\AuthKeyHandler: Manages secret chats. +description: https://core.telegram.org/api/end-to-end + +--- +# `danog\MadelineProto\SecretChats\AuthKeyHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages secret chats. + +https://core.telegram.org/api/end-to-end + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `acceptSecretChat(array $params): \Generator` +* `requestSecretChat(mixed $user): \Generator` +* `rekey(int $chat): \Generator` +* `secretChatStatus(int $chat): \int One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY` +* `getSecretChat(array|int $chat): array` +* `hasSecretChat(array|int $chat): bool` +* `discardSecretChat(int $chat): \Generator` + +## Methods: +### `acceptSecretChat(array $params): \Generator` + +Accept secret chat. + + +Parameters: +* `$params`: `array` Secret chat ID + + +#### See also: +* `\Generator` + + + + +### `requestSecretChat(mixed $user): \Generator` + +Request secret chat. + + +Parameters: +* `$user`: `mixed` User to start secret chat with + + +#### See also: +* `\Generator` + + + + +### `rekey(int $chat): \Generator` + +Rekey secret chat. + + +Parameters: +* `$chat`: `int` Secret chat to rekey + + +#### See also: +* `\Generator` + + + + +### `secretChatStatus(int $chat): \int One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY` + +Get secret chat status. + + +Parameters: +* `$chat`: `int` Chat ID + + +Return value: One of MTProto::SECRET_EMPTY, MTProto::SECRET_REQUESTED, MTProto::SECRET_READY + + +### `getSecretChat(array|int $chat): array` + +Get secret chat. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + + +### `hasSecretChat(array|int $chat): bool` + +Check whether secret chat exists. + + +Parameters: +* `$chat`: `array|int` Secret chat ID + + + +### `discardSecretChat(int $chat): \Generator` + +Discard secret chat. + + +Parameters: +* `$chat`: `int` Secret chat ID + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/SecretChats/MessageHandler.md b/docs/PHPInternal/danog/MadelineProto/SecretChats/MessageHandler.md new file mode 100644 index 00000000..b4f797ce --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/SecretChats/MessageHandler.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\SecretChats\MessageHandler: Manages packing and unpacking of messages, and the list of sent and received messages. +description: + +--- +# `danog\MadelineProto\SecretChats\MessageHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages packing and unpacking of messages, and the list of sent and received messages. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/SecretChats/ResponseHandler.md b/docs/PHPInternal/danog/MadelineProto/SecretChats/ResponseHandler.md new file mode 100644 index 00000000..e3d49e66 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/SecretChats/ResponseHandler.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\SecretChats\ResponseHandler: Manages responses. +description: + +--- +# `danog\MadelineProto\SecretChats\ResponseHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages responses. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/SecretChats/SeqNoHandler.md b/docs/PHPInternal/danog/MadelineProto/SecretChats/SeqNoHandler.md new file mode 100644 index 00000000..17b6addf --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/SecretChats/SeqNoHandler.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\SecretChats\SeqNoHandler: Manages sequence numbers. +description: + +--- +# `danog\MadelineProto\SecretChats\SeqNoHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages sequence numbers. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/SecurityException.md b/docs/PHPInternal/danog/MadelineProto/SecurityException.md new file mode 100644 index 00000000..302eaa24 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/SecurityException.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\SecurityException: Indicates a security error. +description: + +--- +# `danog\MadelineProto\SecurityException` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Indicates a security error. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Serialization.md b/docs/PHPInternal/danog/MadelineProto/Serialization.md new file mode 100644 index 00000000..ab86c5ca --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Serialization.md @@ -0,0 +1,23 @@ +--- +title: danog\MadelineProto\Serialization: Manages serialization of the MadelineProto instance. +description: + +--- +# `danog\MadelineProto\Serialization` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Manages serialization of the MadelineProto instance. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Serialization::PHP_HEADER`: Header for session files. + +* `danog\MadelineProto\Serialization::VERSION`: Serialization version. + diff --git a/docs/PHPInternal/danog/MadelineProto/SessionPaths.md b/docs/PHPInternal/danog/MadelineProto/SessionPaths.md new file mode 100644 index 00000000..a97f4e6c --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/SessionPaths.md @@ -0,0 +1,157 @@ +--- +title: danog\MadelineProto\SessionPaths: Session path information. +description: + +--- +# `danog\MadelineProto\SessionPaths` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Session path information. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `serialize(object $object, string $path): \Generator` +* `unserialize(string $path): \Generator` +* `getLegacySessionPath(): string` +* `getSessionPath(): string` +* `getLockPath(): string` +* `getIpcPath(): string` +* `getIpcStatePath(): string` +* `getIpcState(): \Amp\Promise` +* `storeIpcState(): \Generator` +* `getLightStatePath(): string` +* `getLightState(): \Amp\Promise<\danog\MadelineProto\LightState>` +* `storeLightState(): \Generator` +* `getIpcCallbackPath(): string` + +## Methods: +### `serialize(object $object, string $path): \Generator` + +Serialize object to file. + + +Parameters: +* `$object`: `object` +* `$path`: `string` + + +#### See also: +* `\Generator` + + + + +### `unserialize(string $path): \Generator` + +Deserialize new object. + + +Parameters: +* `$path`: `string` Object path, defaults to session path + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Generator` + + + + +### `getLegacySessionPath(): string` + +Get legacy session path. + + + +### `getSessionPath(): string` + +Get session path. + + + +### `getLockPath(): string` + +Get lock path. + + + +### `getIpcPath(): string` + +Get IPC socket path. + + + +### `getIpcStatePath(): string` + +Get IPC light state path. + + + +### `getIpcState(): \Amp\Promise` + +Get IPC state. + + +#### See also: +* [`\danog\MadelineProto\Ipc\IpcState`: IPC state class.](./Ipc/IpcState.md) +* `\Amp\Promise` + + + + +### `storeIpcState(): \Generator` + +Store IPC state. + + +#### See also: +* `\Generator` + + + + +### `getLightStatePath(): string` + +Get light state path. + + + +### `getLightState(): \Amp\Promise<\danog\MadelineProto\LightState>` + +Get light state. + + +#### See also: +* `\danog\MadelineProto\LightState` +* `\Amp\Promise` + + + + +### `storeLightState(): \Generator` + +Store light state. + + +#### See also: +* `\Generator` + + + + +### `getIpcCallbackPath(): string` + +Get IPC callback socket path. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings.md b/docs/PHPInternal/danog/MadelineProto/Settings.md new file mode 100644 index 00000000..fee04c7e --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings.md @@ -0,0 +1,488 @@ +--- +title: danog\MadelineProto\Settings: Settings class used for configuring MadelineProto. +description: + +--- +# `danog\MadelineProto\Settings` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Settings class used for configuring MadelineProto. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `parseFromLegacy(\danog\MadelineProto\SettingsAbstract|array $settings): \danog\MadelineProto\SettingsAbstract` +* `mergeArray(array $settings): void` +* `merge(\danog\MadelineProto\SettingsAbstract $settings): void` +* `getDefaultDc(): int` +* `getDefaultDcParams(): array` +* `setDefaultDc(int $dc): self` +* `getAppInfo(): \danog\MadelineProto\Settings\AppInfo` +* `setAppInfo(\danog\MadelineProto\Settings\AppInfo $appInfo): self` +* `getAuth(): \danog\MadelineProto\Settings\Auth` +* `setAuth(\danog\MadelineProto\Settings\Auth $auth): self` +* `getConnection(): \danog\MadelineProto\Settings\Connection` +* `setConnection(\danog\MadelineProto\Settings\Connection $connection): self` +* `getFiles(): \danog\MadelineProto\Settings\Files` +* `setFiles(\danog\MadelineProto\Settings\Files $files): self` +* `getLogger(): \danog\MadelineProto\Settings\Logger` +* `setLogger(\danog\MadelineProto\Settings\Logger $logger): self` +* `getPeer(): \danog\MadelineProto\Settings\Peer` +* `setPeer(\danog\MadelineProto\Settings\Peer $peer): self` +* `getPwr(): \danog\MadelineProto\Settings\Pwr` +* `setPwr(\danog\MadelineProto\Settings\Pwr $pwr): self` +* `getRpc(): \danog\MadelineProto\Settings\RPC` +* `setRpc(\danog\MadelineProto\Settings\RPC $rpc): self` +* `getSecretChats(): \danog\MadelineProto\Settings\SecretChats` +* `setSecretChats(\danog\MadelineProto\Settings\SecretChats $secretChats): self` +* `getSerialization(): \danog\MadelineProto\Settings\Serialization` +* `setSerialization(\danog\MadelineProto\Settings\Serialization $serialization): self` +* `getSchema(): \danog\MadelineProto\Settings\TLSchema` +* `setSchema(\danog\MadelineProto\Settings\TLSchema $schema): self` +* `getDb(): \danog\MadelineProto\Settings\DatabaseAbstract` +* `setDb(\danog\MadelineProto\Settings\DatabaseAbstract $db): self` +* `getIpc(): \danog\MadelineProto\Settings\Ipc` +* `setIpc(\danog\MadelineProto\Settings\Ipc $ipc): self` +* `getTemplates(): \danog\MadelineProto\Settings\Templates` +* `setTemplates(\danog\MadelineProto\Settings\Templates $templates): self` +* `hasChanged(): bool` + +## Methods: +### `parseFromLegacy(\danog\MadelineProto\SettingsAbstract|array $settings): \danog\MadelineProto\SettingsAbstract` + +Create settings object from possibly legacy settings array. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract|array` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` + + + + +### `mergeArray(array $settings): void` + +Merge legacy array settings. + + +Parameters: +* `$settings`: `array` Settings + + + +### `merge(\danog\MadelineProto\SettingsAbstract $settings): void` + +Merge another instance of settings. + + +Parameters: +* `$settings`: `\danog\MadelineProto\SettingsAbstract` Settings + + +#### See also: +* `\danog\MadelineProto\SettingsAbstract` + + + + +### `getDefaultDc(): int` + +Get default DC ID. + + + +### `getDefaultDcParams(): array` + +Get default DC params. + + + +### `setDefaultDc(int $dc): self` + +Set default DC ID. + + +Parameters: +* `$dc`: `int` DC ID + + + +### `getAppInfo(): \danog\MadelineProto\Settings\AppInfo` + +Get app information. + + +#### See also: +* [`\danog\MadelineProto\Settings\AppInfo`: App information.](AppInfo.md) + + + + +### `setAppInfo(\danog\MadelineProto\Settings\AppInfo $appInfo): self` + +Set app information. + + +Parameters: +* `$appInfo`: `\danog\MadelineProto\Settings\AppInfo` App information. + + +#### See also: +* [`\danog\MadelineProto\Settings\AppInfo`: App information.](AppInfo.md) + + + + +### `getAuth(): \danog\MadelineProto\Settings\Auth` + +Get cryptography settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Auth`: Cryptography settings.](Auth.md) + + + + +### `setAuth(\danog\MadelineProto\Settings\Auth $auth): self` + +Set cryptography settings. + + +Parameters: +* `$auth`: `\danog\MadelineProto\Settings\Auth` Cryptography settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Auth`: Cryptography settings.](Auth.md) + + + + +### `getConnection(): \danog\MadelineProto\Settings\Connection` + +Get connection settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Connection`: Connection settings.](Connection.md) + + + + +### `setConnection(\danog\MadelineProto\Settings\Connection $connection): self` + +Set connection settings. + + +Parameters: +* `$connection`: `\danog\MadelineProto\Settings\Connection` Connection settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Connection`: Connection settings.](Connection.md) + + + + +### `getFiles(): \danog\MadelineProto\Settings\Files` + +Get file management settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Files`: File management settings.](Files.md) + + + + +### `setFiles(\danog\MadelineProto\Settings\Files $files): self` + +Set file management settings. + + +Parameters: +* `$files`: `\danog\MadelineProto\Settings\Files` File management settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Files`: File management settings.](Files.md) + + + + +### `getLogger(): \danog\MadelineProto\Settings\Logger` + +Get logger settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Logger`: Logger settings.](Logger.md) + + + + +### `setLogger(\danog\MadelineProto\Settings\Logger $logger): self` + +Set logger settings. + + +Parameters: +* `$logger`: `\danog\MadelineProto\Settings\Logger` Logger settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Logger`: Logger settings.](Logger.md) + + + + +### `getPeer(): \danog\MadelineProto\Settings\Peer` + +Get peer database settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Peer`: Peer database settings.](Peer.md) + + + + +### `setPeer(\danog\MadelineProto\Settings\Peer $peer): self` + +Set peer database settings. + + +Parameters: +* `$peer`: `\danog\MadelineProto\Settings\Peer` Peer database settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Peer`: Peer database settings.](Peer.md) + + + + +### `getPwr(): \danog\MadelineProto\Settings\Pwr` + +Get PWRTelegram settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Pwr`: PWRTelegram settings.](Pwr.md) + + + + +### `setPwr(\danog\MadelineProto\Settings\Pwr $pwr): self` + +Set PWRTelegram settings. + + +Parameters: +* `$pwr`: `\danog\MadelineProto\Settings\Pwr` PWRTelegram settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Pwr`: PWRTelegram settings.](Pwr.md) + + + + +### `getRpc(): \danog\MadelineProto\Settings\RPC` + +Get RPC settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\RPC`: RPC settings.](RPC.md) + + + + +### `setRpc(\danog\MadelineProto\Settings\RPC $rpc): self` + +Set RPC settings. + + +Parameters: +* `$rpc`: `\danog\MadelineProto\Settings\RPC` RPC settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\RPC`: RPC settings.](RPC.md) + + + + +### `getSecretChats(): \danog\MadelineProto\Settings\SecretChats` + +Get secret chat settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\SecretChats`: Secret chat settings.](SecretChats.md) + + + + +### `setSecretChats(\danog\MadelineProto\Settings\SecretChats $secretChats): self` + +Set secret chat settings. + + +Parameters: +* `$secretChats`: `\danog\MadelineProto\Settings\SecretChats` Secret chat settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\SecretChats`: Secret chat settings.](SecretChats.md) + + + + +### `getSerialization(): \danog\MadelineProto\Settings\Serialization` + +Get serialization settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Serialization`: Serialization settings.](Serialization.md) + + + + +### `setSerialization(\danog\MadelineProto\Settings\Serialization $serialization): self` + +Set serialization settings. + + +Parameters: +* `$serialization`: `\danog\MadelineProto\Settings\Serialization` Serialization settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Serialization`: Serialization settings.](Serialization.md) + + + + +### `getSchema(): \danog\MadelineProto\Settings\TLSchema` + +Get TL schema settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\TLSchema`: TL schema settings.](TLSchema.md) + + + + +### `setSchema(\danog\MadelineProto\Settings\TLSchema $schema): self` + +Set TL schema settings. + + +Parameters: +* `$schema`: `\danog\MadelineProto\Settings\TLSchema` TL schema settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\TLSchema`: TL schema settings.](TLSchema.md) + + + + +### `getDb(): \danog\MadelineProto\Settings\DatabaseAbstract` + +Get database settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\DatabaseAbstract`: Base class for storage backends.](DatabaseAbstract.md) + + + + +### `setDb(\danog\MadelineProto\Settings\DatabaseAbstract $db): self` + +Set database settings. + + +Parameters: +* `$db`: `\danog\MadelineProto\Settings\DatabaseAbstract` DatabaseAbstract settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\DatabaseAbstract`: Base class for storage backends.](DatabaseAbstract.md) + + + + +### `getIpc(): \danog\MadelineProto\Settings\Ipc` + +Get IPC server settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Ipc`: IPC server settings.](Ipc.md) + + + + +### `setIpc(\danog\MadelineProto\Settings\Ipc $ipc): self` + +Set IPC server settings. + + +Parameters: +* `$ipc`: `\danog\MadelineProto\Settings\Ipc` IPC server settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Ipc`: IPC server settings.](Ipc.md) + + + + +### `getTemplates(): \danog\MadelineProto\Settings\Templates` + +Get template settings. + + +#### See also: +* [`\danog\MadelineProto\Settings\Templates`: Web and CLI template settings for login.](Templates.md) + + + + +### `setTemplates(\danog\MadelineProto\Settings\Templates $templates): self` + +Set template settings. + + +Parameters: +* `$templates`: `\danog\MadelineProto\Settings\Templates` Template settings + + +#### See also: +* [`\danog\MadelineProto\Settings\Templates`: Web and CLI template settings for login.](Templates.md) + + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/AppInfo.md b/docs/PHPInternal/danog/MadelineProto/Settings/AppInfo.md new file mode 100644 index 00000000..6fb4e720 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/AppInfo.md @@ -0,0 +1,161 @@ +--- +title: danog\MadelineProto\Settings\AppInfo: App information. +description: + +--- +# `danog\MadelineProto\Settings\AppInfo` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +App information. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `hasApiInfo(): bool` +* `getApiId(): int` +* `setApiId(int $apiId): self` +* `getApiHash(): string` +* `setApiHash(string $apiHash): self` +* `getDeviceModel(): string` +* `setDeviceModel(string $deviceModel): self` +* `getSystemVersion(): string` +* `setSystemVersion(string $systemVersion): self` +* `getAppVersion(): string` +* `setAppVersion(string $appVersion): self` +* `getLangCode(): string` +* `setLangCode(string $langCode): self` +* `getLangPack(): string` +* `setLangPack(string $langPack): self` +* `hasChanged(): bool` + +## Methods: +### `hasApiInfo(): bool` + +Check if the settings have API ID/hash information. + + + +### `getApiId(): int` + +Get API ID. + + + +### `setApiId(int $apiId): self` + +Set API ID. + + +Parameters: +* `$apiId`: `int` API ID. + + + +### `getApiHash(): string` + +Get API hash. + + + +### `setApiHash(string $apiHash): self` + +Set API hash. + + +Parameters: +* `$apiHash`: `string` API hash. + + + +### `getDeviceModel(): string` + +Get device model. + + + +### `setDeviceModel(string $deviceModel): self` + +Set device model. + + +Parameters: +* `$deviceModel`: `string` Device model. + + + +### `getSystemVersion(): string` + +Get system version. + + + +### `setSystemVersion(string $systemVersion): self` + +Set system version. + + +Parameters: +* `$systemVersion`: `string` System version. + + + +### `getAppVersion(): string` + +Get app version. + + + +### `setAppVersion(string $appVersion): self` + +Set app version. + + +Parameters: +* `$appVersion`: `string` App version. + + + +### `getLangCode(): string` + +Get language code. + + + +### `setLangCode(string $langCode): self` + +Set language code. + + +Parameters: +* `$langCode`: `string` Language code. + + + +### `getLangPack(): string` + +Get language pack. + + + +### `setLangPack(string $langPack): self` + +Set language pack. + + +Parameters: +* `$langPack`: `string` Language pack. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Auth.md b/docs/PHPInternal/danog/MadelineProto/Settings/Auth.md new file mode 100644 index 00000000..bff87f3f --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Auth.md @@ -0,0 +1,100 @@ +--- +title: danog\MadelineProto\Settings\Auth: Cryptography settings. +description: + +--- +# `danog\MadelineProto\Settings\Auth` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Cryptography settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getRsaKeys(): array` +* `setRsaKeys(array $rsaKeys): self` +* `getDefaultTempAuthKeyExpiresIn(): int` +* `setDefaultTempAuthKeyExpiresIn(int $defaultTempAuthKeyExpiresIn): self` +* `getPfs(): bool` +* `setPfs(bool $pfs): self` +* `getMaxAuthTries(): int` +* `setMaxAuthTries(int $maxAuthTries): self` +* `hasChanged(): bool` + +## Methods: +### `getRsaKeys(): array` + +Get MTProto public keys array. + + + +### `setRsaKeys(array $rsaKeys): self` + +Set MTProto public keys array. + + +Parameters: +* `$rsaKeys`: `array` MTProto public keys array. + + + +### `getDefaultTempAuthKeyExpiresIn(): int` + +Get validity period of the binding of temporary and permanent keys. + + + +### `setDefaultTempAuthKeyExpiresIn(int $defaultTempAuthKeyExpiresIn): self` + +Set validity period of the binding of temporary and permanent keys. + + +Parameters: +* `$defaultTempAuthKeyExpiresIn`: `int` Validity period of the binding of temporary and permanent keys. + + + +### `getPfs(): bool` + +Get whether to use PFS. + + + +### `setPfs(bool $pfs): self` + +Set whether to use PFS. + + +Parameters: +* `$pfs`: `bool` Whether to use PFS + + + +### `getMaxAuthTries(): int` + +Get max tries for generating auth key. + + + +### `setMaxAuthTries(int $maxAuthTries): self` + +Set max tries for generating auth key. + + +Parameters: +* `$maxAuthTries`: `int` Max tries for generating auth key + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Connection.md b/docs/PHPInternal/danog/MadelineProto/Settings/Connection.md new file mode 100644 index 00000000..f3274e4b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Connection.md @@ -0,0 +1,365 @@ +--- +title: danog\MadelineProto\Settings\Connection: Connection settings. +description: + +--- +# `danog\MadelineProto\Settings\Connection` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Connection settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getProtocol(): string` +* `setProtocol(class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface> $protocol): self` +* `getIpv6(): bool` +* `setIpv6(bool $ipv6): self` +* `getSslSubdomains(): array` +* `setSslSubdomains(array $sslSubdomains): self` +* `getMinMediaSocketCount(): int` +* `setMinMediaSocketCount(int $minMediaSocketCount): self` +* `getMaxMediaSocketCount(): int` +* `setMaxMediaSocketCount(int $maxMediaSocketCount): self` +* `getRobinPeriod(): int` +* `setRobinPeriod(int $robinPeriod): self` +* `getDefaultDc(): int` +* `getDefaultDcParams(): array` +* `setDefaultDc(int $defaultDc): self` +* `getProxies(): array` +* `addProxy(class-string<\danog\MadelineProto\Stream\StreamInterface> $proxy, array $extra): self` +* `setProxy(array $proxies): self` +* `clearProxies(): self` +* `removeProxy(string $proxy, array $extra): self` +* `getObfuscated(): bool` +* `setObfuscated(bool $obfuscated): self` +* `getTestMode(): bool` +* `setTestMode(bool $testMode): self` +* `getTransport(): class-string<\danog\MadelineProto\Stream\RawStreamInterface>` +* `setTransport(class-string<\danog\MadelineProto\Stream\RawStreamInterface> $transport): self` +* `getRetry(): bool` +* `setRetry(bool $retry): self` +* `getTimeout(): int` +* `setTimeout(int $timeout): self` +* `getUseDoH(): bool` +* `setUseDoH(bool $useDoH): self` +* `getBindTo(): ?string` +* `setBindTo(?string $bindTo): self` +* `hasChanged(): bool` + +## Methods: +### `getProtocol(): string` + +Get protocol identifier. + + + +### `setProtocol(class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface> $protocol): self` + +Set protocol identifier. + + +Parameters: +* `$protocol`: `class-string<\danog\MadelineProto\Stream\MTProtoBufferInterface>` Protocol identifier + + +#### See also: +* [`\danog\MadelineProto\Stream\MTProtoBufferInterface`: MTProto buffer interface, for reading transport MTProto header info.](../Stream/MTProtoBufferInterface.md) + + + + +### `getIpv6(): bool` + +Get whether to use ipv6. + + + +### `setIpv6(bool $ipv6): self` + +Set whether to use ipv6. + + +Parameters: +* `$ipv6`: `bool` Whether to use ipv6 + + + +### `getSslSubdomains(): array` + +Get subdomains of web.telegram.org for https protocol. + + + +### `setSslSubdomains(array $sslSubdomains): self` + +Set subdomains of web.telegram.org for https protocol. + + +Parameters: +* `$sslSubdomains`: `array` Subdomains of web.telegram.org for https protocol. + + + +### `getMinMediaSocketCount(): int` + +Get minimum media socket count. + + + +### `setMinMediaSocketCount(int $minMediaSocketCount): self` + +Set minimum media socket count. + + +Parameters: +* `$minMediaSocketCount`: `int` Minimum media socket count. + + + +### `getMaxMediaSocketCount(): int` + +Get maximum media socket count. + + + +### `setMaxMediaSocketCount(int $maxMediaSocketCount): self` + +Set maximum media socket count. + + +Parameters: +* `$maxMediaSocketCount`: `int` Maximum media socket count. + + + +### `getRobinPeriod(): int` + +Get robin period (seconds). + + + +### `setRobinPeriod(int $robinPeriod): self` + +Set robin period (seconds). + + +Parameters: +* `$robinPeriod`: `int` Robin period (seconds). + + + +### `getDefaultDc(): int` + +Get default DC ID. + + + +### `getDefaultDcParams(): array` + +Get default DC params. + + + +### `setDefaultDc(int $defaultDc): self` + +Set default DC ID. + + +Parameters: +* `$defaultDc`: `int` Default DC ID. + + + +### `getProxies(): array` + +Get proxy identifiers. + + +Fully typed return value: +``` +array, array> +``` +#### See also: +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) + + + + +### `addProxy(class-string<\danog\MadelineProto\Stream\StreamInterface> $proxy, array $extra): self` + +Add proxy identifier to list. + + +Parameters: +* `$proxy`: `class-string<\danog\MadelineProto\Stream\StreamInterface>` Proxy identifier +* `$extra`: `array` Extra + + +#### See also: +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) + + + + +### `setProxy(array $proxies): self` + +Set proxies. + + +Parameters: +* `$proxies`: `array` Proxies + + + +### `clearProxies(): self` + +Clear proxies. + + + +### `removeProxy(string $proxy, array $extra): self` + +Remove specific proxy pair. + + +Parameters: +* `$proxy`: `string` +* `$extra`: `array` + + + +### `getObfuscated(): bool` + +Get whether to use the obfuscated protocol. + + + +### `setObfuscated(bool $obfuscated): self` + +Set whether to use the obfuscated protocol. + + +Parameters: +* `$obfuscated`: `bool` Whether to use the obfuscated protocol. + + + +### `getTestMode(): bool` + +Get whether we're in test mode. + + + +### `setTestMode(bool $testMode): self` + +Set whether we're in test mode. + + +Parameters: +* `$testMode`: `bool` Whether we're in test mode. + + + +### `getTransport(): class-string<\danog\MadelineProto\Stream\RawStreamInterface>` + +Get transport identifier. + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../Stream/RawStreamInterface.md) + + + + +### `setTransport(class-string<\danog\MadelineProto\Stream\RawStreamInterface> $transport): self` + +Set transport identifier. + + +Parameters: +* `$transport`: `class-string<\danog\MadelineProto\Stream\RawStreamInterface>` Transport identifier. + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../Stream/RawStreamInterface.md) + + + + +### `getRetry(): bool` + +Get whether to retry connection. + + + +### `setRetry(bool $retry): self` + +Set whether to retry connection. + + +Parameters: +* `$retry`: `bool` Whether to retry connection. + + + +### `getTimeout(): int` + +Get connection timeout. + + + +### `setTimeout(int $timeout): self` + +Set connection timeout. + + +Parameters: +* `$timeout`: `int` Connection timeout. + + + +### `getUseDoH(): bool` + +Get whether to use DNS over HTTPS. + + + +### `setUseDoH(bool $useDoH): self` + +Set whether to use DNS over HTTPS. + + +Parameters: +* `$useDoH`: `bool` Whether to use DNS over HTTPS + + + +### `getBindTo(): ?string` + +Get bind on specific address and port. + + + +### `setBindTo(?string $bindTo): self` + +Set bind on specific address and port. + + +Parameters: +* `$bindTo`: `?string` Bind on specific address and port. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Database/DatabaseAbstract.md b/docs/PHPInternal/danog/MadelineProto/Settings/Database/DatabaseAbstract.md new file mode 100644 index 00000000..1a59fea7 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Database/DatabaseAbstract.md @@ -0,0 +1,107 @@ +--- +title: danog\MadelineProto\Settings\Database\DatabaseAbstract: Base class for database backends. +description: + +--- +# `danog\MadelineProto\Settings\Database\DatabaseAbstract` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Base class for database backends. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `getDatabase(): string|int` +* `getUri(): string` +* `setDatabase(int|string $database): self` +* `setUri(string $uri): self` +* `hasChanged(): bool` + +## Methods: +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `getDatabase(): string|int` + +Get database name/ID. + + + +### `getUri(): string` + +Get database URI. + + + +### `setDatabase(int|string $database): self` + +Set database name/ID. + + +Parameters: +* `$database`: `int|string` + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Database/Memory.md b/docs/PHPInternal/danog/MadelineProto/Settings/Database/Memory.md new file mode 100644 index 00000000..a48fb690 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Database/Memory.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\Database\Memory: Memory backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\Memory` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Memory backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getCleanup(): bool` +* `setCleanup(bool $cleanup): self` +* `hasChanged(): bool` + +## Methods: +### `getCleanup(): bool` + +Get whether to cleanup the memory before serializing. + + + +### `setCleanup(bool $cleanup): self` + +Set whether to cleanup the memory before serializing. + + +Parameters: +* `$cleanup`: `bool` Whether to cleanup the memory before serializing. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Database/Mysql.md b/docs/PHPInternal/danog/MadelineProto/Settings/Database/Mysql.md new file mode 100644 index 00000000..f7961fa6 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Database/Mysql.md @@ -0,0 +1,161 @@ +--- +title: danog\MadelineProto\Settings\Database\Mysql: MySQL backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\Mysql` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +MySQL backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMaxConnections(): int` +* `setMaxConnections(int $maxConnections): self` +* `getIdleTimeout(): int` +* `setIdleTimeout(int $idleTimeout): self` +* `getDatabase(): string` +* `setDatabase(string $database): self` +* `getUsername(): string` +* `setUsername(string $username): self` +* `getUri(): string` +* `setUri(string $uri): self` +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `hasChanged(): bool` + +## Methods: +### `getMaxConnections(): int` + +Get maximum connection limit. + + + +### `setMaxConnections(int $maxConnections): self` + +Set maximum connection limit. + + +Parameters: +* `$maxConnections`: `int` Maximum connection limit. + + + +### `getIdleTimeout(): int` + +Get idle timeout. + + + +### `setIdleTimeout(int $idleTimeout): self` + +Set idle timeout. + + +Parameters: +* `$idleTimeout`: `int` Idle timeout. + + + +### `getDatabase(): string` + +Get database name. + + + +### `setDatabase(string $database): self` + +Set database name. + + +Parameters: +* `$database`: `string` Database name. + + + +### `getUsername(): string` + +Get username. + + + +### `setUsername(string $username): self` + +Set username. + + +Parameters: +* `$username`: `string` Username. + + + +### `getUri(): string` + +Get database URI. + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` Database URI. + + + +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Database/Postgres.md b/docs/PHPInternal/danog/MadelineProto/Settings/Database/Postgres.md new file mode 100644 index 00000000..c4c7e667 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Database/Postgres.md @@ -0,0 +1,161 @@ +--- +title: danog\MadelineProto\Settings\Database\Postgres: Postgres backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\Postgres` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Postgres backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMaxConnections(): int` +* `setMaxConnections(int $maxConnections): self` +* `getIdleTimeout(): int` +* `setIdleTimeout(int $idleTimeout): self` +* `getDatabase(): string` +* `setDatabase(string $database): self` +* `getUsername(): string` +* `setUsername(string $username): self` +* `getUri(): string` +* `setUri(string $uri): self` +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `hasChanged(): bool` + +## Methods: +### `getMaxConnections(): int` + +Get maximum connection limit. + + + +### `setMaxConnections(int $maxConnections): self` + +Set maximum connection limit. + + +Parameters: +* `$maxConnections`: `int` Maximum connection limit. + + + +### `getIdleTimeout(): int` + +Get idle timeout. + + + +### `setIdleTimeout(int $idleTimeout): self` + +Set idle timeout. + + +Parameters: +* `$idleTimeout`: `int` Idle timeout. + + + +### `getDatabase(): string` + +Get database name. + + + +### `setDatabase(string $database): self` + +Set database name. + + +Parameters: +* `$database`: `string` Database name. + + + +### `getUsername(): string` + +Get username. + + + +### `setUsername(string $username): self` + +Set username. + + +Parameters: +* `$username`: `string` Username. + + + +### `getUri(): string` + +Get database URI. + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` Database URI. + + + +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Database/Redis.md b/docs/PHPInternal/danog/MadelineProto/Settings/Database/Redis.md new file mode 100644 index 00000000..cc45bf4f --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Database/Redis.md @@ -0,0 +1,107 @@ +--- +title: danog\MadelineProto\Settings\Database\Redis: Redis backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\Redis` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Redis backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getDatabase(): int` +* `setDatabase(int $database): self` +* `getUri(): string` +* `setUri(string $uri): self` +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `hasChanged(): bool` + +## Methods: +### `getDatabase(): int` + +Get database number. + + + +### `setDatabase(int $database): self` + +Set database number. + + +Parameters: +* `$database`: `int` Database number. + + + +### `getUri(): string` + +Get database URI. + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` Database URI. + + + +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Database/SqlAbstract.md b/docs/PHPInternal/danog/MadelineProto/Settings/Database/SqlAbstract.md new file mode 100644 index 00000000..6174b9c0 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Database/SqlAbstract.md @@ -0,0 +1,161 @@ +--- +title: danog\MadelineProto\Settings\Database\SqlAbstract: Generic db backend settings. +description: + +--- +# `danog\MadelineProto\Settings\Database\SqlAbstract` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Generic db backend settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMaxConnections(): int` +* `setMaxConnections(int $maxConnections): self` +* `getIdleTimeout(): int` +* `setIdleTimeout(int $idleTimeout): self` +* `getDatabase(): string` +* `setDatabase(string $database): self` +* `getUsername(): string` +* `setUsername(string $username): self` +* `getUri(): string` +* `setUri(string $uri): self` +* `getKey(): string` +* `getCacheTtl(): int` +* `setCacheTtl(int|string $cacheTtl): self` +* `getPassword(): string` +* `setPassword(string $password): self` +* `hasChanged(): bool` + +## Methods: +### `getMaxConnections(): int` + +Get maximum connection limit. + + + +### `setMaxConnections(int $maxConnections): self` + +Set maximum connection limit. + + +Parameters: +* `$maxConnections`: `int` Maximum connection limit. + + + +### `getIdleTimeout(): int` + +Get idle timeout. + + + +### `setIdleTimeout(int $idleTimeout): self` + +Set idle timeout. + + +Parameters: +* `$idleTimeout`: `int` Idle timeout. + + + +### `getDatabase(): string` + +Get database name. + + + +### `setDatabase(string $database): self` + +Set database name. + + +Parameters: +* `$database`: `string` Database name. + + + +### `getUsername(): string` + +Get username. + + + +### `setUsername(string $username): self` + +Set username. + + +Parameters: +* `$username`: `string` Username. + + + +### `getUri(): string` + +Get database URI. + + + +### `setUri(string $uri): self` + +Set database URI. + + +Parameters: +* `$uri`: `string` Database URI. + + + +### `getKey(): string` + +Get DB key. + + + +### `getCacheTtl(): int` + +Get for how long to keep records in memory after last read, for cached backends. + + + +### `setCacheTtl(int|string $cacheTtl): self` + +Set for how long to keep records in memory after last read, for cached backends. +The cache TTL identifier can be a string like '+5 minutes'. + +Parameters: +* `$cacheTtl`: `int|string` For how long to keep records in memory after last read, for cached backends. + + + +### `getPassword(): string` + +Get password. + + + +### `setPassword(string $password): self` + +Set password. + + +Parameters: +* `$password`: `string` Password. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/DatabaseAbstract.md b/docs/PHPInternal/danog/MadelineProto/Settings/DatabaseAbstract.md new file mode 100644 index 00000000..8ae01a19 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/DatabaseAbstract.md @@ -0,0 +1,28 @@ +--- +title: danog\MadelineProto\Settings\DatabaseAbstract: Base class for storage backends. +description: + +--- +# `danog\MadelineProto\Settings\DatabaseAbstract` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Base class for storage backends. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `hasChanged(): bool` + +## Methods: +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Files.md b/docs/PHPInternal/danog/MadelineProto/Settings/Files.md new file mode 100644 index 00000000..145dade9 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Files.md @@ -0,0 +1,100 @@ +--- +title: danog\MadelineProto\Settings\Files: File management settings. +description: + +--- +# `danog\MadelineProto\Settings\Files` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +File management settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getAllowAutomaticUpload(): bool` +* `setAllowAutomaticUpload(bool $allowAutomaticUpload): self` +* `getUploadParallelChunks(): int` +* `setUploadParallelChunks(int $uploadParallelChunks): self` +* `getDownloadParallelChunks(): int` +* `setDownloadParallelChunks(int $downloadParallelChunks): self` +* `getReportBrokenMedia(): bool` +* `setReportBrokenMedia(bool $reportBrokenMedia): self` +* `hasChanged(): bool` + +## Methods: +### `getAllowAutomaticUpload(): bool` + +Get allow automatic upload of files from file paths present in constructors? + + + +### `setAllowAutomaticUpload(bool $allowAutomaticUpload): self` + +Set allow automatic upload of files from file paths present in constructors? + + +Parameters: +* `$allowAutomaticUpload`: `bool` Allow automatic upload of files from file paths present in constructors? + + + +### `getUploadParallelChunks(): int` + +Get upload parallel chunk count. + + + +### `setUploadParallelChunks(int $uploadParallelChunks): self` + +Set upload parallel chunk count. + + +Parameters: +* `$uploadParallelChunks`: `int` Upload parallel chunk count + + + +### `getDownloadParallelChunks(): int` + +Get download parallel chunk count. + + + +### `setDownloadParallelChunks(int $downloadParallelChunks): self` + +Set download parallel chunk count. + + +Parameters: +* `$downloadParallelChunks`: `int` Download parallel chunk count + + + +### `getReportBrokenMedia(): bool` + +Get whether to report undownloadable media to TSF. + + + +### `setReportBrokenMedia(bool $reportBrokenMedia): self` + +Set whether to report undownloadable media to TSF. + + +Parameters: +* `$reportBrokenMedia`: `bool` Whether to report undownloadable media to TSF + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Ipc.md b/docs/PHPInternal/danog/MadelineProto/Settings/Ipc.md new file mode 100644 index 00000000..9aacc423 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Ipc.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\Ipc: IPC server settings. +description: + +--- +# `danog\MadelineProto\Settings\Ipc` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +IPC server settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getSlow(): bool` +* `setSlow(bool $slow): self` +* `hasChanged(): bool` + +## Methods: +### `getSlow(): bool` + +Get WARNING: this will cause slow startup if enabled. + + + +### `setSlow(bool $slow): self` + +Whether to force full deserialization of instance, without using the IPC server/client. +WARNING: this will cause slow startup if enabled. + +Parameters: +* `$slow`: `bool` WARNING: this will cause slow startup if enabled. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Logger.md b/docs/PHPInternal/danog/MadelineProto/Settings/Logger.md new file mode 100644 index 00000000..bfc3063f --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Logger.md @@ -0,0 +1,92 @@ +--- +title: danog\MadelineProto\Settings\Logger: Logger settings. +description: + +--- +# `danog\MadelineProto\Settings\Logger` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Logger settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getType()` +* `setType(): self` +* `getExtra(): null|callable|string` +* `setExtra(null|callable|string $extra): self` +* `getLevel()` +* `setLevel(): self` +* `getMaxSize(): int` +* `setMaxSize(int $maxSize): self` +* `hasChanged(): bool` + +## Methods: +### `getType()` + +Get $type Logger type. + + + +### `setType(): self` + +Set $type Logger type. + + + +### `getExtra(): null|callable|string` + +Get extra parameter for logger. + + + +### `setExtra(null|callable|string $extra): self` + +Set extra parameter for logger. + + +Parameters: +* `$extra`: `null|callable|string` Extra parameter for logger. + + + +### `getLevel()` + +Get logging level. + + + +### `setLevel(): self` + +Set logging level. + + + +### `getMaxSize(): int` + +Get maximum filesize for logger, in case of file logging. + + + +### `setMaxSize(int $maxSize): self` + +Set maximum filesize for logger, in case of file logging. + + +Parameters: +* `$maxSize`: `int` Maximum filesize for logger, in case of file logging. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Peer.md b/docs/PHPInternal/danog/MadelineProto/Settings/Peer.md new file mode 100644 index 00000000..23ed6b81 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Peer.md @@ -0,0 +1,82 @@ +--- +title: danog\MadelineProto\Settings\Peer: Peer database settings. +description: + +--- +# `danog\MadelineProto\Settings\Peer` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Peer database settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getFullInfoCacheTime(): int` +* `setFullInfoCacheTime(int $fullInfoCacheTime): self` +* `getFullFetch(): bool` +* `setFullFetch(bool $fullFetch): self` +* `getCacheAllPeersOnStartup(): bool` +* `setCacheAllPeersOnStartup(bool $cacheAllPeersOnStartup): self` +* `hasChanged(): bool` + +## Methods: +### `getFullInfoCacheTime(): int` + +Get cache time for full peer information (seconds). + + + +### `setFullInfoCacheTime(int $fullInfoCacheTime): self` + +Set cache time for full peer information (seconds). + + +Parameters: +* `$fullInfoCacheTime`: `int` Cache time for full peer information (seconds). + + + +### `getFullFetch(): bool` + +Get should madeline fetch the full member list of every group it meets? + + + +### `setFullFetch(bool $fullFetch): self` + +Set should madeline fetch the full member list of every group it meets? + + +Parameters: +* `$fullFetch`: `bool` Should madeline fetch the full member list of every group it meets? + + + +### `getCacheAllPeersOnStartup(): bool` + +Get whether to cache all peers on startup for userbots. + + + +### `setCacheAllPeersOnStartup(bool $cacheAllPeersOnStartup): self` + +Set whether to cache all peers on startup for userbots. + + +Parameters: +* `$cacheAllPeersOnStartup`: `bool` Whether to cache all peers on startup for userbots. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Pwr.md b/docs/PHPInternal/danog/MadelineProto/Settings/Pwr.md new file mode 100644 index 00000000..5358a04c --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Pwr.md @@ -0,0 +1,64 @@ +--- +title: danog\MadelineProto\Settings\Pwr: PWRTelegram settings. +description: + +--- +# `danog\MadelineProto\Settings\Pwr` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +PWRTelegram settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getRequests(): bool` +* `setRequests(bool $requests): self` +* `getDbToken(): string` +* `setDbToken(string $dbToken): self` +* `hasChanged(): bool` + +## Methods: +### `getRequests(): bool` + +Get whether to try resolving usernames using PWRTelegram DB. + + + +### `setRequests(bool $requests): self` + +Set whether to try resolving usernames using PWRTelegram DB. + + +Parameters: +* `$requests`: `bool` Whether to try resolving usernames using PWRTelegram DB. + + + +### `getDbToken(): string` + +Get DB token. + + + +### `setDbToken(string $dbToken): self` + +Set DB token. + + +Parameters: +* `$dbToken`: `string` DB token. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/RPC.md b/docs/PHPInternal/danog/MadelineProto/Settings/RPC.md new file mode 100644 index 00000000..b31aad9c --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/RPC.md @@ -0,0 +1,136 @@ +--- +title: danog\MadelineProto\Settings\RPC: RPC settings. +description: + +--- +# `danog\MadelineProto\Settings\RPC` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +RPC settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getRpcTimeout(): int` +* `setRpcTimeout(int $rpcTimeout): self` +* `getFloodTimeout(): int` +* `setFloodTimeout(int $floodTimeout): self` +* `getLimitIncoming(): int` +* `setLimitIncoming(int $limitIncoming): self` +* `getLimitOutgoing(): int` +* `setLimitOutgoing(int $limitOutgoing): self` +* `getLimitCallQueue(): int` +* `setLimitCallQueue(int $limitCallQueue): self` +* `getGzipEncodeIfGt(): int` +* `setGzipEncodeIfGt(int $gzipEncodeIfGt): self` +* `hasChanged(): bool` + +## Methods: +### `getRpcTimeout(): int` + +Get RPC timeout. + + + +### `setRpcTimeout(int $rpcTimeout): self` + +Set RPC timeout. + + +Parameters: +* `$rpcTimeout`: `int` RPC timeout. + + + +### `getFloodTimeout(): int` + +Get flood timeout: if FLOOD_WAIT_ time is bigger than this, throw exception instead of waiting asynchronously. + + + +### `setFloodTimeout(int $floodTimeout): self` + +Set flood timeout: if FLOOD_WAIT_ time is bigger than this, throw exception instead of waiting asynchronously. + + +Parameters: +* `$floodTimeout`: `int` Flood timeout: if FLOOD_WAIT_ time is bigger than this, throw exception instead of waiting asynchronously + + + +### `getLimitIncoming(): int` + +Get maximum number of messages to be stored in the incoming queue. + + + +### `setLimitIncoming(int $limitIncoming): self` + +Set maximum number of messages to be stored in the incoming queue. + + +Parameters: +* `$limitIncoming`: `int` Maximum number of messages to be stored in the incoming queue + + + +### `getLimitOutgoing(): int` + +Get maximum number of messages to be stored in the outgoing queue. + + + +### `setLimitOutgoing(int $limitOutgoing): self` + +Set maximum number of messages to be stored in the outgoing queue. + + +Parameters: +* `$limitOutgoing`: `int` Maximum number of messages to be stored in the outgoing queue + + + +### `getLimitCallQueue(): int` + +Get maximum number of messages to consider when using call queues. + + + +### `setLimitCallQueue(int $limitCallQueue): self` + +Set maximum number of messages to consider when using call queues. + + +Parameters: +* `$limitCallQueue`: `int` Maximum number of messages to consider when using call queues + + + +### `getGzipEncodeIfGt(): int` + +Get encode payload with GZIP if bigger than. + + + +### `setGzipEncodeIfGt(int $gzipEncodeIfGt): self` + +Set encode payload with GZIP if bigger than. + + +Parameters: +* `$gzipEncodeIfGt`: `int` Encode payload with GZIP if bigger than + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/SecretChats.md b/docs/PHPInternal/danog/MadelineProto/Settings/SecretChats.md new file mode 100644 index 00000000..c71f6c4b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/SecretChats.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\SecretChats: Secret chat settings. +description: + +--- +# `danog\MadelineProto\Settings\SecretChats` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Secret chat settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getAccept(): bool|int[]` +* `setAccept(bool|int[] $accept): self` +* `hasChanged(): bool` + +## Methods: +### `getAccept(): bool|int[]` + +Get boolean or array of IDs. + + + +### `setAccept(bool|int[] $accept): self` + +Set boolean or array of IDs. + + +Parameters: +* `$accept`: `bool|int[]` Boolean or array of IDs + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Serialization.md b/docs/PHPInternal/danog/MadelineProto/Settings/Serialization.md new file mode 100644 index 00000000..ad0b767e --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Serialization.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\Serialization: Serialization settings. +description: + +--- +# `danog\MadelineProto\Settings\Serialization` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Serialization settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getInterval(): int` +* `setInterval(int $interval): self` +* `hasChanged(): bool` + +## Methods: +### `getInterval(): int` + +Get serialization interval, in seconds. + + + +### `setInterval(int $interval): self` + +Set serialization interval, in seconds. + + +Parameters: +* `$interval`: `int` Serialization interval, in seconds. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/TLSchema.md b/docs/PHPInternal/danog/MadelineProto/Settings/TLSchema.md new file mode 100644 index 00000000..fc495612 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/TLSchema.md @@ -0,0 +1,132 @@ +--- +title: danog\MadelineProto\Settings\TLSchema: TL schema settings. +description: + +--- +# `danog\MadelineProto\Settings\TLSchema` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TL schema settings. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `needsUpgrade(): bool` +* `upgrade(): void` +* `getLayer(): int` +* `setLayer(int $layer): self` +* `getMTProtoSchema(): string` +* `setMTProtoSchema(string $MTProtoSchema): self` +* `getAPISchema(): string` +* `setAPISchema(string $APISchema): self` +* `getSecretSchema(): string` +* `setSecretSchema(string $secretSchema): self` +* `getOther(): array` +* `setOther(array $other): self` +* `hasChanged(): bool` + +## Methods: +### `needsUpgrade(): bool` + +Returns whether the TL parser should re-parse the TL schemes. + + + +### `upgrade(): void` + +Signal that scheme was re-parsed. + + + +### `getLayer(): int` + +Get TL layer version. + + + +### `setLayer(int $layer): self` + +Set TL layer version. + + +Parameters: +* `$layer`: `int` TL layer version. + + + +### `getMTProtoSchema(): string` + +Get MTProto schema path. + + + +### `setMTProtoSchema(string $MTProtoSchema): self` + +Set MTProto schema path. + + +Parameters: +* `$MTProtoSchema`: `string` MTProto schema path. + + + +### `getAPISchema(): string` + +Get API schema path. + + + +### `setAPISchema(string $APISchema): self` + +Set API schema path. + + +Parameters: +* `$APISchema`: `string` API schema path. + + + +### `getSecretSchema(): string` + +Get secret schema path. + + + +### `setSecretSchema(string $secretSchema): self` + +Set secret schema path. + + +Parameters: +* `$secretSchema`: `string` Secret schema path. + + + +### `getOther(): array` + +Get the value of other. + + + +### `setOther(array $other): self` + +Set the value of other. + + +Parameters: +* `$other`: `array` + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Settings/Templates.md b/docs/PHPInternal/danog/MadelineProto/Settings/Templates.md new file mode 100644 index 00000000..46b69f48 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Settings/Templates.md @@ -0,0 +1,46 @@ +--- +title: danog\MadelineProto\Settings\Templates: Web and CLI template settings for login. +description: + +--- +# `danog\MadelineProto\Settings\Templates` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Web and CLI template settings for login. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getHtmlTemplate(): string` +* `setHtmlTemplate(string $htmlTemplate): self` +* `hasChanged(): bool` + +## Methods: +### `getHtmlTemplate(): string` + +Get web template used for querying app information. + + + +### `setHtmlTemplate(string $htmlTemplate): self` + +Set web template used for querying app information. + + +Parameters: +* `$htmlTemplate`: `string` Web template used for querying app information. + + + +### `hasChanged(): bool` + +Get whether this setting was changed, also applies changes. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Shutdown.md b/docs/PHPInternal/danog/MadelineProto/Shutdown.md new file mode 100644 index 00000000..ad89b52e --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Shutdown.md @@ -0,0 +1,55 @@ +--- +title: danog\MadelineProto\Shutdown: Class that controls script shutdown. +description: + +--- +# `danog\MadelineProto\Shutdown` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Class that controls script shutdown. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `shutdown(): void` +* `addCallback(callable $callback, null|string $id): int|\string The callback ID` +* `removeCallback(null|string|int $id): \bool true if the callback was removed correctly, false otherwise` + +## Methods: +### `shutdown(): void` + +Function to be called on shutdown. + + + +### `addCallback(callable $callback, null|string $id): int|\string The callback ID` + +Add a callback for script shutdown. + + +Parameters: +* `$callback`: `callable` The callback to set +* `$id`: `null|string` The optional callback ID + + +Return value: The callback ID + + +### `removeCallback(null|string|int $id): \bool true if the callback was removed correctly, false otherwise` + +Remove a callback from the script shutdown callable list. + + +Parameters: +* `$id`: `null|string|int` The optional callback ID + + +Return value: true if the callback was removed correctly, false otherwise + + diff --git a/docs/PHPInternal/danog/MadelineProto/Snitch.md b/docs/PHPInternal/danog/MadelineProto/Snitch.md new file mode 100644 index 00000000..733f0f5d --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Snitch.md @@ -0,0 +1,38 @@ +--- +title: danog\MadelineProto\Snitch: Snitch. +description: + +--- +# `danog\MadelineProto\Snitch` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Snitch. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Constants +* `danog\MadelineProto\Snitch::MAX_NO_PHAR_STARTS`: Maximum starts without a phar file. + +* `danog\MadelineProto\Snitch::MAX_NO_LOG_STARTS`: Maximum starts without a logfile. + + +## Method list: +* `logFile(string $file): void` + +## Methods: +### `logFile(string $file): void` + +Snitch on logfile. + + +Parameters: +* `$file`: `string` Logfile + + + diff --git a/docs/PHPInternal/danog/MadelineProto/StrTools.md b/docs/PHPInternal/danog/MadelineProto/StrTools.md new file mode 100644 index 00000000..513fa754 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/StrTools.md @@ -0,0 +1,133 @@ +--- +title: danog\MadelineProto\StrTools: Some tools. +description: + +--- +# `danog\MadelineProto\StrTools` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Some tools. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `markdownEscape(string $hwat): string` +* `typeEscape(string $type): string` +* `methodEscape(string $method): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getMimeFromFile(string $file): string` +* `getMimeFromBuffer(string $buffer): string` + +## Methods: +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/ADNLTransport/ADNLStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/ADNLTransport/ADNLStream.md new file mode 100644 index 00000000..3c87ac4e --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/ADNLTransport/ADNLStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\ADNLTransport\ADNLStream: ADNL stream wrapper. +description: Manages ADNL envelope + +--- +# `danog\MadelineProto\Stream\ADNLTransport\ADNLStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +ADNL stream wrapper. + +Manages ADNL envelope + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Async/Buffer.md b/docs/PHPInternal/danog/MadelineProto/Stream/Async/Buffer.md new file mode 100644 index 00000000..c83c8ce5 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Async/Buffer.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Stream\Async\Buffer: Buffer helper trait. +description: Wraps the asynchronous generator methods with asynchronous promise-based methods + +--- +# `danog\MadelineProto\Stream\Async\Buffer` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Buffer helper trait. + +Wraps the asynchronous generator methods with asynchronous promise-based methods + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Async/BufferedStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Async/BufferedStream.md new file mode 100644 index 00000000..4b1f678a --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Async/BufferedStream.md @@ -0,0 +1,54 @@ +--- +title: danog\MadelineProto\Stream\Async\BufferedStream: Buffered stream helper trait. +description: Wraps the asynchronous generator methods with asynchronous promise-based methods + +--- +# `danog\MadelineProto\Stream\Async\BufferedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Buffered stream helper trait. + +Wraps the asynchronous generator methods with asynchronous promise-based methods + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Async/RawStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Async/RawStream.md new file mode 100644 index 00000000..e229f844 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Async/RawStream.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Stream\Async\RawStream: Raw stream helper trait. +description: Wraps the asynchronous generator methods with asynchronous promise-based methods + +--- +# `danog\MadelineProto\Stream\Async\RawStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Raw stream helper trait. + +Wraps the asynchronous generator methods with asynchronous promise-based methods + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/BufferInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/BufferInterface.md new file mode 100644 index 00000000..98db2cf8 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/BufferInterface.md @@ -0,0 +1,53 @@ +--- +title: danog\MadelineProto\Stream\BufferInterface: Buffer interface. +description: + +--- +# `danog\MadelineProto\Stream\BufferInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Buffer interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `bufferRead(int $length): \Amp\Promise` +* `bufferWrite(string $data): \Amp\Promise` + +## Methods: +### `bufferRead(int $length): \Amp\Promise` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` How much data to read + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferWrite(string $data): \Amp\Promise` + +Write data asynchronously. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/BufferedProxyStreamInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/BufferedProxyStreamInterface.md new file mode 100644 index 00000000..b0404107 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/BufferedProxyStreamInterface.md @@ -0,0 +1,124 @@ +--- +title: danog\MadelineProto\Stream\BufferedProxyStreamInterface: Buffered proxy stream interface. +description: + +--- +# `danog\MadelineProto\Stream\BufferedProxyStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Buffered proxy stream interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getName(): string` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `setExtra(mixed $extra): void` + +## Methods: +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +Fully typed return value: +``` +\Amp\Promise<\danog\MadelineProto\Stream\BufferInterface> +``` +#### See also: +* [`\danog\MadelineProto\Stream\BufferInterface`: Buffer interface.](./BufferInterface.md) +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getName(): string` + +Get stream name. +Is supposed to return __CLASS__ + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +Get underlying stream resource. + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](./RawStreamInterface.md) + + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `setExtra(mixed $extra): void` + +Set extra proxy data. + + +Parameters: +* `$extra`: `mixed` Proxy data + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/BufferedStreamInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/BufferedStreamInterface.md new file mode 100644 index 00000000..7f937ff7 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/BufferedStreamInterface.md @@ -0,0 +1,113 @@ +--- +title: danog\MadelineProto\Stream\BufferedStreamInterface: Buffered stream interface. +description: + +--- +# `danog\MadelineProto\Stream\BufferedStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Buffered stream interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getName(): string` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +Fully typed return value: +``` +\Amp\Promise<\danog\MadelineProto\Stream\BufferInterface> +``` +#### See also: +* [`\danog\MadelineProto\Stream\BufferInterface`: Buffer interface.](./BufferInterface.md) +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getName(): string` + +Get stream name. +Is supposed to return __CLASS__ + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +Get underlying stream resource. + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](./RawStreamInterface.md) + + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Common/BufferedRawStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Common/BufferedRawStream.md new file mode 100644 index 00000000..bf8fd8f1 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Common/BufferedRawStream.md @@ -0,0 +1,191 @@ +--- +title: danog\MadelineProto\Stream\Common\BufferedRawStream: Buffered raw stream. +description: + +--- +# `danog\MadelineProto\Stream\Common\BufferedRawStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Buffered raw stream. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `disconnect(): void` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `bufferRead(int $length): \Amp\Promise` +* `bufferReadGenerator(int $length): \Generator` +* `bufferWrite(string $data): \Amp\Promise` +* `bufferClear(): string` +* `getSocket(): \Amp\Socket\Socket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getName(): string` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Asynchronously connect to a TCP/TLS server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `disconnect(): void` + +Async close. + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferRead(int $length): \Amp\Promise` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` Amount of data to read + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferReadGenerator(int $length): \Generator` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` Amount of data to read + + +#### See also: +* `\Generator` + + + + +### `bufferWrite(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferClear(): string` + +Get remaining data from buffer. + + + +### `getSocket(): \Amp\Socket\Socket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\Socket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getName(): string` + +Get class name. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Common/CtrStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Common/CtrStream.md new file mode 100644 index 00000000..de76c0ef --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Common/CtrStream.md @@ -0,0 +1,181 @@ +--- +title: danog\MadelineProto\Stream\Common\CtrStream: AES CTR stream wrapper. +description: Manages AES CTR encryption/decryption + +--- +# `danog\MadelineProto\Stream\Common\CtrStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +AES CTR stream wrapper. + +Manages AES CTR encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `bufferReadGenerator(\Amp\Promise $promise): \Generator That resolves with a string when the provided promise is resolved and the data is decrypted` +* `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `setExtra(array $data): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `bufferReadGenerator(\Amp\Promise $promise): \Generator That resolves with a string when the provided promise is resolved and the data is decrypted` + +Decrypts read data asynchronously. + + +Parameters: +* `$promise`: `\Amp\Promise` Promise that resolves with a string when new data is available or `null` if the stream has closed. + + +Return value: That resolves with a string when the provided promise is resolved and the data is decrypted + +#### See also: +* `\Amp\Promise` + + + + +### `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `setExtra(array $data): void` + +Set obfuscation keys/IVs. + + +Parameters: +* `$data`: `array` Keys + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Common/HashedBufferedStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Common/HashedBufferedStream.md new file mode 100644 index 00000000..eec56104 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Common/HashedBufferedStream.md @@ -0,0 +1,249 @@ +--- +title: danog\MadelineProto\Stream\Common\HashedBufferedStream: Hash stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Common\HashedBufferedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Hash stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `startReadHash(): void` +* `checkReadHash(int $after): void` +* `getReadHash(): string` +* `hasReadHash(): bool` +* `startWriteHash(): void` +* `checkWriteHash(int $after): void` +* `getWriteHash(): string` +* `hasWriteHash(): bool` +* `bufferReadGenerator(int $length): \Generator That resolves with a string when the provided promise is resolved and the data is added to the hashing context` +* `setExtra(string $hash): void` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getReadBufferGenerator(int $length): \Generator` +* `getWriteBufferGenerator(int $length): \Generator` +* `bufferRead(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` +* `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `getSocket(): \Amp\Socket\Socket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `startReadHash(): void` + +Enable read hashing. + + + +### `checkReadHash(int $after): void` + +Check the read hash after N bytes are read. + + +Parameters: +* `$after`: `int` The number of bytes to read before checking the hash + + + +### `getReadHash(): string` + +Stop read hashing and get final hash. + + + +### `hasReadHash(): bool` + +Check if we are read hashing. + + + +### `startWriteHash(): void` + +Enable write hashing. + + + +### `checkWriteHash(int $after): void` + +Write the write hash after N bytes are read. + + +Parameters: +* `$after`: `int` The number of bytes to read before writing the hash + + + +### `getWriteHash(): string` + +Stop write hashing and get final hash. + + + +### `hasWriteHash(): bool` + +Check if we are write hashing. + + + +### `bufferReadGenerator(int $length): \Generator That resolves with a string when the provided promise is resolved and the data is added to the hashing context` + +Hashes read data asynchronously. + + +Parameters: +* `$length`: `int` Read and hash $length bytes + + +Return value: That resolves with a string when the provided promise is resolved and the data is added to the hashing context + + +### `setExtra(string $hash): void` + +Set the hash algorithm. + + +Parameters: +* `$hash`: `string` Algorithm name + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `bufferRead(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` + +Reads data from the stream. + + +Return value: Resolves with a string when new data is available or `null` if the stream has closed. + + +### `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `getSocket(): \Amp\Socket\Socket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\Socket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Common/SimpleBufferedRawStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Common/SimpleBufferedRawStream.md new file mode 100644 index 00000000..d224eb57 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Common/SimpleBufferedRawStream.md @@ -0,0 +1,191 @@ +--- +title: danog\MadelineProto\Stream\Common\SimpleBufferedRawStream: Buffered raw stream. +description: + +--- +# `danog\MadelineProto\Stream\Common\SimpleBufferedRawStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Buffered raw stream. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `bufferReadGenerator(int $length): \Generator` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getName(): string` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `disconnect(): void` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `bufferRead(int $length): \Amp\Promise` +* `bufferWrite(string $data): \Amp\Promise` +* `bufferClear(): string` +* `getSocket(): \Amp\Socket\Socket` + +## Methods: +### `bufferReadGenerator(int $length): \Generator` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` Amount of data to read + + +#### See also: +* `\Generator` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getName(): string` + +Get class name. + + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Asynchronously connect to a TCP/TLS server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` Connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `disconnect(): void` + +Async close. + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferRead(int $length): \Amp\Promise` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` Amount of data to read + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferWrite(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `bufferClear(): string` + +Get remaining data from buffer. + + + +### `getSocket(): \Amp\Socket\Socket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\Socket` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Common/UdpBufferedStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Common/UdpBufferedStream.md new file mode 100644 index 00000000..4eae7c72 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Common/UdpBufferedStream.md @@ -0,0 +1,164 @@ +--- +title: danog\MadelineProto\Stream\Common\UdpBufferedStream: UDP stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Common\UdpBufferedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +UDP stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getReadBufferGenerator(int $length): \Generator` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `close(): void` +* `getReadBuffer(int $length): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +Fully typed return value: +``` +\Generator|\Amp\Success> +``` +#### See also: +* `\Amp\Promise` +* `\Amp\Failure` +* `\Amp\Success` +* `\Generator` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `close(): void` + +Close. + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/ConnectionContext.md b/docs/PHPInternal/danog/MadelineProto/Stream/ConnectionContext.md new file mode 100644 index 00000000..a2f72dcb --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/ConnectionContext.md @@ -0,0 +1,318 @@ +--- +title: danog\MadelineProto\Stream\ConnectionContext: Connection context class. +description: Is responsible for maintaining state about a certain connection to a DC. +That includes the Stream chain that is required to use the connection, the connection URI, and other connection-related data. + +--- +# `danog\MadelineProto\Stream\ConnectionContext` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Connection context class. + +Is responsible for maintaining state about a certain connection to a DC. +That includes the Stream chain that is required to use the connection, the connection URI, and other connection-related data. + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setSocketContext(\Amp\Socket\ConnectContext $socketContext): self` +* `getSocketContext(): \Amp\Socket\ConnectContext` +* `setUri(string|\Psr\Http\Message\UriInterface $uri): self` +* `getStringUri(): string` +* `getUri(): \Psr\Http\Message\UriInterface` +* `setCancellationToken(\Amp\CancellationToken $cancellationToken): self` +* `getCancellationToken(): \Amp\CancellationToken` +* `getCtx(): self` +* `setTest(bool $test): self` +* `isTest(): bool` +* `isMedia(): bool` +* `isCDN(): bool` +* `isDns(): bool` +* `setIsDns(bool $isDns): self` +* `secure(bool $secure): self` +* `isSecure(): bool` +* `setDc(string|int $dc): self` +* `getDc(): string|int` +* `getIntDc(): string|int` +* `setIpv6(bool $ipv6): self` +* `getIpv6(): bool` +* `addStream(string $streamName, mixed $extra): self` +* `setReadCallback(callable $callable): void` +* `hasReadCallback(): bool` +* `getReadCallback(): callable` +* `getStreamName(): string` +* `hasStreamName(string $stream): bool` +* `getStream(): \Generator<\danog\MadelineProto\Stream\StreamInterface>` +* `getInputClientProxy(): array` +* `getName(): string` + +## Methods: +### `setSocketContext(\Amp\Socket\ConnectContext $socketContext): self` + +Set the socket context. + + +Parameters: +* `$socketContext`: `\Amp\Socket\ConnectContext` + + +#### See also: +* `\Amp\Socket\ConnectContext` + + + + +### `getSocketContext(): \Amp\Socket\ConnectContext` + +Get the socket context. + + +#### See also: +* `\Amp\Socket\ConnectContext` + + + + +### `setUri(string|\Psr\Http\Message\UriInterface $uri): self` + +Set the connection URI. + + +Parameters: +* `$uri`: `string|\Psr\Http\Message\UriInterface` + + +#### See also: +* `\Psr\Http\Message\UriInterface` + + + + +### `getStringUri(): string` + +Get the URI as a string. + + + +### `getUri(): \Psr\Http\Message\UriInterface` + +Get the URI. + + +#### See also: +* `\Psr\Http\Message\UriInterface` + + + + +### `setCancellationToken(\Amp\CancellationToken $cancellationToken): self` + +Set the cancellation token. + + +Parameters: +* `$cancellationToken`: `\Amp\CancellationToken` + + +#### See also: +* `\Amp\CancellationToken` + + + + +### `getCancellationToken(): \Amp\CancellationToken` + +Get the cancellation token. + + +#### See also: +* `\Amp\CancellationToken` + + + + +### `getCtx(): self` + +Return a clone of the current connection context. + + + +### `setTest(bool $test): self` + +Set the test boolean. + + +Parameters: +* `$test`: `bool` + + + +### `isTest(): bool` + +Whether this is a test connection. + + + +### `isMedia(): bool` + +Whether this is a media connection. + + + +### `isCDN(): bool` + +Whether this is a CDN connection. + + + +### `isDns(): bool` + +Whether this connection context will only be used by the DNS client. + + + +### `setIsDns(bool $isDns): self` + +Whether this connection context will only be used by the DNS client. + + +Parameters: +* `$isDns`: `bool` + + + +### `secure(bool $secure): self` + +Set the secure boolean. + + +Parameters: +* `$secure`: `bool` + + + +### `isSecure(): bool` + +Whether to use TLS with socket connections. + + + +### `setDc(string|int $dc): self` + +Set the DC ID. + + +Parameters: +* `$dc`: `string|int` + + + +### `getDc(): string|int` + +Get the DC ID. + + + +### `getIntDc(): string|int` + +Get the int DC ID. + + + +### `setIpv6(bool $ipv6): self` + +Whether to use ipv6. + + +Parameters: +* `$ipv6`: `bool` + + + +### `getIpv6(): bool` + +Whether to use ipv6. + + + +### `addStream(string $streamName, mixed $extra): self` + +Add a stream to the stream chain. + + +Parameters: +* `$streamName`: `string` + Full type: + ``` + class-string + ``` +* `$extra`: `mixed` + + + +### `setReadCallback(callable $callable): void` + +Set read callback, called every time the socket reads at least a byte. + + +Parameters: +* `$callable`: `callable` Read callback + + + +### `hasReadCallback(): bool` + +Check if a read callback is present. + + + +### `getReadCallback(): callable` + +Get read callback. + + + +### `getStreamName(): string` + +Get the current stream name from the stream chain. + + + +### `hasStreamName(string $stream): bool` + +Check if has stream within stream chain. + + +Parameters: +* `$stream`: `string` Stream name + + + +### `getStream(): \Generator<\danog\MadelineProto\Stream\StreamInterface>` + +Get a stream from the stream chain. + + +#### See also: +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](./StreamInterface.md) +* `\Generator` + + + + +### `getInputClientProxy(): array` + +Get the inputClientProxy proxy MTProto object. + + + +### `getName(): string` + +Get a description "name" of the context. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoBufferInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoBufferInterface.md new file mode 100644 index 00000000..12576990 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoBufferInterface.md @@ -0,0 +1,18 @@ +--- +title: danog\MadelineProto\Stream\MTProtoBufferInterface: MTProto buffer interface, for reading transport MTProto header info. +description: + +--- +# `danog\MadelineProto\Stream\MTProtoBufferInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +MTProto buffer interface, for reading transport MTProto header info. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/AbridgedStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/AbridgedStream.md new file mode 100644 index 00000000..130b182d --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/AbridgedStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\AbridgedStream: Abridged stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\AbridgedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Abridged stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/FullStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/FullStream.md new file mode 100644 index 00000000..1fa057da --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/FullStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\FullStream: TCP full stream wrapper. +description: Manages obfuscated2 encryption/decryption + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\FullStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +TCP full stream wrapper. + +Manages obfuscated2 encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Stream to use as data source. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/HttpStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/HttpStream.md new file mode 100644 index 00000000..d929f58d --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/HttpStream.md @@ -0,0 +1,150 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\HttpStream: HTTP stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\HttpStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +HTTP stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `setExtra(array $extra): void` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `setExtra(array $extra): void` + +Set proxy data. + + +Parameters: +* `$extra`: `array` Proxy parameters + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/HttpsStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/HttpsStream.md new file mode 100644 index 00000000..311a9209 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/HttpsStream.md @@ -0,0 +1,150 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\HttpsStream: HTTPS stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\HttpsStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +HTTPS stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `setExtra(array $extra): void` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `setExtra(array $extra): void` + +Set proxy data. + + +Parameters: +* `$extra`: `array` Proxy parameters + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/IntermediatePaddedStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/IntermediatePaddedStream.md new file mode 100644 index 00000000..3bd4402b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/IntermediatePaddedStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\IntermediatePaddedStream: TCP Intermediate stream wrapper. +description: Manages obfuscated2 encryption/decryption + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\IntermediatePaddedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +TCP Intermediate stream wrapper. + +Manages obfuscated2 encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/IntermediateStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/IntermediateStream.md new file mode 100644 index 00000000..2daf2ecf --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/IntermediateStream.md @@ -0,0 +1,139 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\IntermediateStream: TCP Intermediate stream wrapper. +description: Manages obfuscated2 encryption/decryption + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\IntermediateStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +TCP Intermediate stream wrapper. + +Manages obfuscated2 encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/ObfuscatedStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/ObfuscatedStream.md new file mode 100644 index 00000000..ed8c5843 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/MTProtoTransport/ObfuscatedStream.md @@ -0,0 +1,181 @@ +--- +title: danog\MadelineProto\Stream\MTProtoTransport\ObfuscatedStream: Obfuscated2 stream wrapper. +description: Manages obfuscated2 encryption/decryption + +--- +# `danog\MadelineProto\Stream\MTProtoTransport\ObfuscatedStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Obfuscated2 stream wrapper. + +Manages obfuscated2 encryption/decryption + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `setExtra(void $data): void` +* `disconnect(): \Amp\Promise` +* `getWriteBufferGenerator(int $length): \Generator` +* `getReadBufferGenerator(int $length): \Generator` +* `bufferReadGenerator(\Amp\Promise $promise): \Generator That resolves with a string when the provided promise is resolved and the data is decrypted` +* `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getReadBuffer(int $length): \Amp\Promise` +* `getWriteBuffer(int $length, string $append): \Amp\Promise` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `setExtra(void $data): void` + +Does nothing. + + +Parameters: +* `$data`: `void` Nothing + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBufferGenerator(int $length): \Generator` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Generator` + + + + +### `getReadBufferGenerator(int $length): \Generator` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Generator` + + + + +### `bufferReadGenerator(\Amp\Promise $promise): \Generator That resolves with a string when the provided promise is resolved and the data is decrypted` + +Decrypts read data asynchronously. + + +Parameters: +* `$promise`: `\Amp\Promise` Promise that resolves with a string when new data is available or `null` if the stream has closed. + + +Return value: That resolves with a string when the provided promise is resolved and the data is decrypted + +#### See also: +* `\Amp\Promise` + + + + +### `bufferWrite(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length, string $append): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Total length of data that is going to be piped in the buffer +* `$append`: `string` Data to append after entire buffer is written + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Proxy/HttpProxy.md b/docs/PHPInternal/danog/MadelineProto/Stream/Proxy/HttpProxy.md new file mode 100644 index 00000000..0031ed23 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Proxy/HttpProxy.md @@ -0,0 +1,117 @@ +--- +title: danog\MadelineProto\Stream\Proxy\HttpProxy: HTTP proxy stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Proxy\HttpProxy` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +HTTP proxy stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getReadBuffer(int $length): \Amp\Promise` +* `setExtra(array $extra): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `setExtra(array $extra): void` + +Sets proxy data. + + +Parameters: +* `$extra`: `array` Proxy data + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Proxy/SocksProxy.md b/docs/PHPInternal/danog/MadelineProto/Stream/Proxy/SocksProxy.md new file mode 100644 index 00000000..38b7fb28 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Proxy/SocksProxy.md @@ -0,0 +1,117 @@ +--- +title: danog\MadelineProto\Stream\Proxy\SocksProxy: Socks5 stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Proxy\SocksProxy` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Socks5 stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): \Amp\Promise` +* `getWriteBuffer(int $length): \Amp\Promise` +* `getReadBuffer(int $length): \Amp\Promise` +* `setExtra(array $extra): void` +* `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): \Amp\Promise` + +Async close. + + +#### See also: +* `\Amp\Promise` + + + + +### `getWriteBuffer(int $length): \Amp\Promise` + +Get write buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of data that is going to be written to the write buffer + + +#### See also: +* `\Amp\Promise` + + + + +### `getReadBuffer(int $length): \Amp\Promise` + +Get read buffer asynchronously. + + +Parameters: +* `$length`: `int` Length of payload, as detected by this layer + + +#### See also: +* `\Amp\Promise` + + + + +### `setExtra(array $extra): void` + +Sets proxy data. + + +Parameters: +* `$extra`: `array` Proxy data + + + +### `getStream(): \danog\MadelineProto\Stream\RawStreamInterface` + +{@inheritDoc} + + +#### See also: +* [`\danog\MadelineProto\Stream\RawStreamInterface`: Raw stream interface.](../RawStreamInterface.md) + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/ProxyStreamInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/ProxyStreamInterface.md new file mode 100644 index 00000000..caaa2280 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/ProxyStreamInterface.md @@ -0,0 +1,32 @@ +--- +title: danog\MadelineProto\Stream\ProxyStreamInterface: Stream proxy interface. +description: + +--- +# `danog\MadelineProto\Stream\ProxyStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Stream proxy interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setExtra(mixed $extra): void` + +## Methods: +### `setExtra(mixed $extra): void` + +Set extra proxy data. + + +Parameters: +* `$extra`: `mixed` Proxy data + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/RawProxyStreamInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/RawProxyStreamInterface.md new file mode 100644 index 00000000..f7120b05 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/RawProxyStreamInterface.md @@ -0,0 +1,114 @@ +--- +title: danog\MadelineProto\Stream\RawProxyStreamInterface: Raw stream proxy interface. +description: + +--- +# `danog\MadelineProto\Stream\RawProxyStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Raw stream proxy interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `read(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` +* `write(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `end(string $finalData): \Promise Succeeds once the data has been successfully written to the stream.` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` +* `setExtra(mixed $extra): void` + +## Methods: +### `read(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` + +Reads data from the stream. + + +Return value: Resolves with a string when new data is available or `null` if the stream has closed. + +Fully typed return value: +``` +\Promise +``` +#### See also: +* `\Promise` + + + + +### `write(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `end(string $finalData): \Promise Succeeds once the data has been successfully written to the stream.` + +Marks the stream as no longer writable. Optionally writes a final data chunk before. Note that this is not the +same as forcefully closing the stream. This method waits for all pending writes to complete before closing the +stream. Socket streams implementing this interface should only close the writable side of the stream. + + +Parameters: +* `$finalData`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `setExtra(mixed $extra): void` + +Set extra proxy data. + + +Parameters: +* `$extra`: `mixed` Proxy data + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/RawStreamInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/RawStreamInterface.md new file mode 100644 index 00000000..95f7a629 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/RawStreamInterface.md @@ -0,0 +1,103 @@ +--- +title: danog\MadelineProto\Stream\RawStreamInterface: Raw stream interface. +description: + +--- +# `danog\MadelineProto\Stream\RawStreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Raw stream interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `read(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` +* `write(string $data): \Promise Succeeds once the data has been successfully written to the stream.` +* `end(string $finalData): \Promise Succeeds once the data has been successfully written to the stream.` +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `read(): \Promise Resolves with a string when new data is available or `null` if the stream has closed.` + +Reads data from the stream. + + +Return value: Resolves with a string when new data is available or `null` if the stream has closed. + +Fully typed return value: +``` +\Promise +``` +#### See also: +* `\Promise` + + + + +### `write(string $data): \Promise Succeeds once the data has been successfully written to the stream.` + +Writes data to the stream. + + +Parameters: +* `$data`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `end(string $finalData): \Promise Succeeds once the data has been successfully written to the stream.` + +Marks the stream as no longer writable. Optionally writes a final data chunk before. Note that this is not the +same as forcefully closing the stream. This method waits for all pending writes to complete before closing the +stream. Socket streams implementing this interface should only close the writable side of the stream. + + +Parameters: +* `$finalData`: `string` Bytes to write. + + +Return value: Succeeds once the data has been successfully written to the stream. + + +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/ReadBufferInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/ReadBufferInterface.md new file mode 100644 index 00000000..b54eac6c --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/ReadBufferInterface.md @@ -0,0 +1,37 @@ +--- +title: danog\MadelineProto\Stream\ReadBufferInterface: Read buffer interface. +description: + +--- +# `danog\MadelineProto\Stream\ReadBufferInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Read buffer interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `bufferRead(int $length): \Amp\Promise` + +## Methods: +### `bufferRead(int $length): \Amp\Promise` + +Read data asynchronously. + + +Parameters: +* `$length`: `int` How much data to read + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/StreamInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/StreamInterface.md new file mode 100644 index 00000000..e040cef7 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/StreamInterface.md @@ -0,0 +1,57 @@ +--- +title: danog\MadelineProto\Stream\StreamInterface: Generic stream interface. +description: + +--- +# `danog\MadelineProto\Stream\StreamInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Generic stream interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to a server. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](./ConnectionContext.md) +* `\Generator` + + + + +### `disconnect(): void` + +Disconnect from the server. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +Get underlying AMPHP socket resource. + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Transport/DefaultStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Transport/DefaultStream.md new file mode 100644 index 00000000..75b3424a --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Transport/DefaultStream.md @@ -0,0 +1,87 @@ +--- +title: danog\MadelineProto\Stream\Transport\DefaultStream: Default stream wrapper. +description: Manages reading data in chunks + +--- +# `danog\MadelineProto\Stream\Transport\DefaultStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Default stream wrapper. + +Manages reading data in chunks + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getStream(): \Amp\Socket\EncryptableSocket` +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `disconnect(): void` +* `close(): void` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `getStream(): \Amp\Socket\EncryptableSocket` + + + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `disconnect(): void` + +Close. + + + +### `close(): void` + +Close. + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Transport/PremadeStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Transport/PremadeStream.md new file mode 100644 index 00000000..ef97b94d --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Transport/PremadeStream.md @@ -0,0 +1,75 @@ +--- +title: danog\MadelineProto\Stream\Transport\PremadeStream: Premade stream wrapper. +description: Manages reading data in chunks + +--- +# `danog\MadelineProto\Stream\Transport\PremadeStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Premade stream wrapper. + +Manages reading data in chunks + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `read(): \Amp\Promise` +* `write(string $data): \Amp\Promise` +* `disconnect(): void` +* `getSocket(): \Amp\Socket\Socket` +* `setExtra()` + +## Methods: +### `read(): \Amp\Promise` + +Async chunked read. + + +#### See also: +* `\Amp\Promise` + + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `disconnect(): void` + +Async close. + + + +### `getSocket(): \Amp\Socket\Socket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\Socket` + + + + +### `setExtra()` + +{@inheritdoc} + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Transport/WsStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Transport/WsStream.md new file mode 100644 index 00000000..442799d6 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Transport/WsStream.md @@ -0,0 +1,73 @@ +--- +title: danog\MadelineProto\Stream\Transport\WsStream: Websocket stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Transport\WsStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Websocket stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect()` +* `write(string $data): \Amp\Promise` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect()` + +Async close. + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/Transport/WssStream.md b/docs/PHPInternal/danog/MadelineProto/Stream/Transport/WssStream.md new file mode 100644 index 00000000..24fd27c7 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/Transport/WssStream.md @@ -0,0 +1,73 @@ +--- +title: danog\MadelineProto\Stream\Transport\WssStream: Websocket TLS stream wrapper. +description: + +--- +# `danog\MadelineProto\Stream\Transport\WssStream` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Websocket TLS stream wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` +* `disconnect()` +* `write(string $data): \Amp\Promise` +* `getSocket(): \Amp\Socket\EncryptableSocket` + +## Methods: +### `connect(\danog\MadelineProto\Stream\ConnectionContext $ctx): \Generator` + +Connect to stream. + + +Parameters: +* `$ctx`: `\danog\MadelineProto\Stream\ConnectionContext` The connection context + + +#### See also: +* [`\danog\MadelineProto\Stream\ConnectionContext`: Connection context class.](../ConnectionContext.md) +* `\Generator` + + + + +### `disconnect()` + +Async close. + + + +### `write(string $data): \Amp\Promise` + +Async write. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + +### `getSocket(): \Amp\Socket\EncryptableSocket` + +{@inheritdoc} + + +#### See also: +* `\Amp\Socket\EncryptableSocket` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Stream/WriteBufferInterface.md b/docs/PHPInternal/danog/MadelineProto/Stream/WriteBufferInterface.md new file mode 100644 index 00000000..eaf97394 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Stream/WriteBufferInterface.md @@ -0,0 +1,37 @@ +--- +title: danog\MadelineProto\Stream\WriteBufferInterface: Write buffer interface. +description: + +--- +# `danog\MadelineProto\Stream\WriteBufferInterface` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Write buffer interface. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `bufferWrite(string $data): \Amp\Promise` + +## Methods: +### `bufferWrite(string $data): \Amp\Promise` + +Write data asynchronously. + + +Parameters: +* `$data`: `string` Data to write + + +#### See also: +* `\Amp\Promise` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TL/Conversion/Exception.md b/docs/PHPInternal/danog/MadelineProto/TL/Conversion/Exception.md new file mode 100644 index 00000000..b79fd07b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TL/Conversion/Exception.md @@ -0,0 +1,62 @@ +--- +title: danog\MadelineProto\TL\Conversion\Exception: TL conversion exception. +description: + +--- +# `danog\MadelineProto\TL\Conversion\Exception` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +TL conversion exception. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TL/Conversion/Extension.md b/docs/PHPInternal/danog/MadelineProto/TL/Conversion/Extension.md new file mode 100644 index 00000000..1b475cde --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TL/Conversion/Extension.md @@ -0,0 +1,78 @@ +--- +title: danog\MadelineProto\TL\Conversion\Extension: Manages generation of extensions for files. +description: + +--- +# `danog\MadelineProto\TL\Conversion\Extension` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Manages generation of extensions for files. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMimeFromExtension(string $extension, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getMimeFromFile(string $file): string` +* `getMimeFromBuffer(string $buffer): string` + +## Methods: +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TL/Exception.md b/docs/PHPInternal/danog/MadelineProto/TL/Exception.md new file mode 100644 index 00000000..8fecd0e4 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TL/Exception.md @@ -0,0 +1,62 @@ +--- +title: danog\MadelineProto\TL\Exception: TL deserialization exception. +description: + +--- +# `danog\MadelineProto\TL\Exception` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TL deserialization exception. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TL/PrettyException.md b/docs/PHPInternal/danog/MadelineProto/TL/PrettyException.md new file mode 100644 index 00000000..6e7834e5 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TL/PrettyException.md @@ -0,0 +1,62 @@ +--- +title: danog\MadelineProto\TL\PrettyException: Handle async stack traces. +description: + +--- +# `danog\MadelineProto\TL\PrettyException` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Handle async stack traces. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `updateTLTrace(array $trace): void` +* `getTLTrace(): string` +* `setTLTrace(string $tlTrace): void` +* `prettifyTL(string $init, array $trace): void` + +## Methods: +### `updateTLTrace(array $trace): void` + +Update TL trace. + + +Parameters: +* `$trace`: `array` + + + +### `getTLTrace(): string` + +Get TL trace. + + + +### `setTLTrace(string $tlTrace): void` + +Set TL trace. + + +Parameters: +* `$tlTrace`: `string` TL trace + + + +### `prettifyTL(string $init, array $trace): void` + +Generate async trace. + + +Parameters: +* `$init`: `string` Method name +* `$trace`: `array` Async trace + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TL/TL.md b/docs/PHPInternal/danog/MadelineProto/TL/TL.md new file mode 100644 index 00000000..da3c3b5b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TL/TL.md @@ -0,0 +1,198 @@ +--- +title: danog\MadelineProto\TL\TL: TL serialization. +description: + +--- +# `danog\MadelineProto\TL\TL` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TL serialization. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getSecretLayer(): int` +* `getConstructors(bool $td): \danog\MadelineProto\TL\TLConstructors` +* `getMethods(bool $td): \danog\MadelineProto\TL\TLMethods` +* `getDescriptions(): array` +* `init(\danog\MadelineProto\Settings\TLSchema $files, \danog\MadelineProto\TL\TLCallback[] $objects): void` +* `getMethodNamespaces(): array` +* `getMethodsNamespaced(): array` +* `updateCallbacks(\danog\MadelineProto\TL\TLCallback[] $objects): void` +* `serializeObject(array $type, mixed $object, string $ctx, int $layer): \Generator` +* `serializeMethod(string $method, mixed $arguments): \Generator` +* `getLength(\resource|string $stream, array $type): int` +* `deserialize(string|\resource $stream, array $type): \Generator` + +## Methods: +### `getSecretLayer(): int` + +Get secret chat layer version. + + + +### `getConstructors(bool $td): \danog\MadelineProto\TL\TLConstructors` + +Get constructors. + + +Parameters: +* `$td`: `bool` + + +#### See also: +* `\danog\MadelineProto\TL\TLConstructors` + + + + +### `getMethods(bool $td): \danog\MadelineProto\TL\TLMethods` + +Get methods. + + +Parameters: +* `$td`: `bool` + + +#### See also: +* `\danog\MadelineProto\TL\TLMethods` + + + + +### `getDescriptions(): array` + +Get TL descriptions. + + + +### `init(\danog\MadelineProto\Settings\TLSchema $files, \danog\MadelineProto\TL\TLCallback[] $objects): void` + +Initialize TL parser. + + +Parameters: +* `$files`: `\danog\MadelineProto\Settings\TLSchema` Scheme files +* `$objects`: `\danog\MadelineProto\TL\TLCallback[]` TL Callback objects + + +#### See also: +* [`\danog\MadelineProto\Settings\TLSchema`: TL schema settings.](../Settings/TLSchema.md) +* [`\danog\MadelineProto\TL\TLCallback`: Interface for managing TL serialization callbacks.](./TLCallback.md) + + + + +### `getMethodNamespaces(): array` + +Get TL namespaces. + + + +### `getMethodsNamespaced(): array` + +Get namespaced methods (method => namespace). + + + +### `updateCallbacks(\danog\MadelineProto\TL\TLCallback[] $objects): void` + +Update TL callbacks. + + +Parameters: +* `$objects`: `\danog\MadelineProto\TL\TLCallback[]` TL callbacks + + +#### See also: +* [`\danog\MadelineProto\TL\TLCallback`: Interface for managing TL serialization callbacks.](./TLCallback.md) + + + + +### `serializeObject(array $type, mixed $object, string $ctx, int $layer): \Generator` + +Serialize TL object. + + +Parameters: +* `$type`: `array` TL type definition +* `$object`: `mixed` Object to serialize +* `$ctx`: `string` Context +* `$layer`: `int` Layer version + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Generator` + + + + +### `serializeMethod(string $method, mixed $arguments): \Generator` + +Serialize method. + + +Parameters: +* `$method`: `string` Method name +* `$arguments`: `mixed` Arguments + + +Fully typed return value: +``` +\Generator|\Amp\Promise<\Amp\Ipc\Sync\ChannelledSocket>|\Amp\Promise|\Amp\Promise|\Amp\Promise|\Amp\Promise|\danog\MadelineProto\Stream\StreamInterface|array|int|mixed, mixed, string> +``` +#### See also: +* `\Amp\Promise` +* `\Amp\File\File` +* `\Amp\Ipc\Sync\ChannelledSocket` +* [`\danog\MadelineProto\Stream\StreamInterface`: Generic stream interface.](../Stream/StreamInterface.md) +* `\Generator` + + + + +### `getLength(\resource|string $stream, array $type): int` + +Get length of TL payload. + + +Parameters: +* `$stream`: `\resource|string` Stream +* `$type`: `array` Type identifier + + +#### See also: +* `\resource` + + + + +### `deserialize(string|\resource $stream, array $type): \Generator` + +Deserialize TL object. + + +Parameters: +* `$stream`: `string|\resource` Stream +* `$type`: `array` Type identifier + + +#### See also: +* `\resource` +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TL/TLCallback.md b/docs/PHPInternal/danog/MadelineProto/TL/TLCallback.md new file mode 100644 index 00000000..b5374e56 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TL/TLCallback.md @@ -0,0 +1,64 @@ +--- +title: danog\MadelineProto\TL\TLCallback: Interface for managing TL serialization callbacks. +description: + +--- +# `danog\MadelineProto\TL\TLCallback` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Interface for managing TL serialization callbacks. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getMethodCallbacks(): array` +* `getMethodBeforeCallbacks(): array` +* `getConstructorCallbacks(): array` +* `getConstructorBeforeCallbacks(): array` +* `getConstructorSerializeCallbacks(): array` +* `getTypeMismatchCallbacks(): array` + +## Methods: +### `getMethodCallbacks(): array` + +Called after serialization of method. +Pass the method name and arguments + + +### `getMethodBeforeCallbacks(): array` + +Called right before serialization of method starts. +Pass the method name + + +### `getConstructorCallbacks(): array` + +Called right after deserialization of object, passing the final object. + + + +### `getConstructorBeforeCallbacks(): array` + +Called right before deserialization of object. +Pass only the constructor name + + +### `getConstructorSerializeCallbacks(): array` + +Called right before serialization of constructor. +Passed the object, will return a modified version. + + +### `getTypeMismatchCallbacks(): array` + +Called if objects of the specified type cannot be serialized. +Passed the unserializable object, +will try to convert it to an object of the proper type. + + diff --git a/docs/PHPInternal/danog/MadelineProto/TL/Types/Button.md b/docs/PHPInternal/danog/MadelineProto/TL/Types/Button.md new file mode 100644 index 00000000..36daafb6 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TL/Types/Button.md @@ -0,0 +1,84 @@ +--- +title: danog\MadelineProto\TL\Types\Button: Clickable button. +description: + +--- +# `danog\MadelineProto\TL\Types\Button` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Clickable button. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `click(bool $donotwait): mixed` +* `jsonSerialize(): array` +* `offsetSet( $name, mixed $value): void` +* `offsetGet( $name): mixed` +* `offsetUnset( $name): void` +* `offsetExists( $name): bool` + +## Methods: +### `click(bool $donotwait): mixed` + +Click on button. + + +Parameters: +* `$donotwait`: `bool` Whether to wait for the result of the method + + + +### `jsonSerialize(): array` + +Serialize button. + + + +### `offsetSet( $name, mixed $value): void` + +Set button info. + + +Parameters: +* `$name`: `` Offset +* `$value`: `mixed` Value + + + +### `offsetGet( $name): mixed` + +Get button info. + + +Parameters: +* `$name`: `` Field name + + + +### `offsetUnset( $name): void` + +Unset button info. + + +Parameters: +* `$name`: `` Offset + + + +### `offsetExists( $name): bool` + +Check if button field exists. + + +Parameters: +* `$name`: `` Offset + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TL/Types/Bytes.md b/docs/PHPInternal/danog/MadelineProto/TL/Types/Bytes.md new file mode 100644 index 00000000..9a7e2836 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TL/Types/Bytes.md @@ -0,0 +1,73 @@ +--- +title: danog\MadelineProto\TL\Types\Bytes: Bytes wrapper. +description: + +--- +# `danog\MadelineProto\TL\Types\Bytes` +[Back to index](../../../../index.md) + +> Author: Daniil Gentili + + +Bytes wrapper. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `jsonSerialize(): array` +* `offsetSet(int|null $offset, string $value): void` +* `offsetGet(int $offset): string` +* `offsetUnset(int $offset): void` +* `offsetExists(int $offset): bool` + +## Methods: +### `jsonSerialize(): array` + +Obtain values for JSON-encoding. + + + +### `offsetSet(int|null $offset, string $value): void` + +Set char at offset. + + +Parameters: +* `$offset`: `int|null` Offset +* `$value`: `string` Char + + + +### `offsetGet(int $offset): string` + +Get char at offset. + + +Parameters: +* `$offset`: `int` Name + + + +### `offsetUnset(int $offset): void` + +Unset char at offset. + + +Parameters: +* `$offset`: `int` Offset + + + +### `offsetExists(int $offset): bool` + +Check if char at offset exists. + + +Parameters: +* `$offset`: `int` Offset + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TON/API.md b/docs/PHPInternal/danog/MadelineProto/TON/API.md new file mode 100644 index 00000000..25022c4b --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TON/API.md @@ -0,0 +1,870 @@ +--- +title: danog\MadelineProto\TON\API: TON API. +description: + +--- +# `danog\MadelineProto\TON\API` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TON API. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` +* `all((\Generator|\Promise)[] $promises): \Amp\Promise` +* `any((\Promise|\Generator)[] $promises): \Amp\Promise` +* `arr(mixed $params): array` +* `base64urlDecode(string $data): string` +* `base64urlEncode(string $data): string` +* `botAPItoMTProto(array $parameters): \Amp\Promise` +* `call(\Generator|\Promise|mixed $promise): \Amp\Promise` +* `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` +* `callForkDefer(\Generator|\Promise $promise): void` +* `connect(string $config): \Amp\Promise` +* `echo(string $string): \Amp\Promise` +* `end(array $what): mixed` +* `first((\Promise|\Generator)[] $promises): \Amp\Promise` +* `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` +* `genVectorHash(array $ints): \int Vector hash` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getMethodNamespaces(): mixed` +* `getMimeFromBuffer(string $buffer): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getMimeFromFile(string $file): string` +* `getVar(object $obj, string $var): mixed` +* `hasVar(object $obj, string $var): bool` +* `inflateStripped(string $stripped): \string JPG payload` +* `isAltervista(): bool` +* `isArrayOrAlike(mixed $var): bool` +* `logger(string $param, int $level, string $file): mixed` +* `loop(callable $func): \Amp\Promise` +* `markdownEscape(string $hwat): string` +* `methodCall(string $methodName, array $args): \Amp\Promise` +* `methodEscape(string $method): string` +* `packDouble(float $value): string` +* `packSignedInt(int $value): string` +* `packSignedLong(int $value): string` +* `packUnsignedInt(int $value): string` +* `posmod(int $a, int $b): \int Modulo` +* `random(int $length): \string Random string` +* `randomInt(int $modulus): int` +* `readLine(string $prompt): \Amp\Promise` +* `rethrow(\Throwable $e, string $file): void` +* `rleDecode(string $string): string` +* `rleEncode(string $string): string` +* `setVar(object $obj, string $var, mixed $val): void` +* `sleep(int|float $time): \Amp\Promise` +* `some((\Promise|\Generator)[] $promises): \Amp\Promise` +* `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` +* `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `typeEscape(string $type): string` +* `unpackDouble(string $value): float` +* `unpackSignedInt(string $value): int` +* `unpackSignedLong(string $value): int` +* `unpackSignedLongString(string $value): string` +* `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` +* `async(bool $async): void` +* `init(): void` +* `initAsynchronously(): \Generator` +* `inited(): bool` +* `forceInit(bool $inited): void` + +## Methods: +### `after(\Generator|\Promise $a, \Generator|\Promise $b): \Amp\Promise` + +Call promise $b after promise $a. + + +Parameters: +* `$a`: `\Generator|\Promise` Promise A +* `$b`: `\Generator|\Promise` Promise B + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `all((\Generator|\Promise)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when all promises succeed, and fails if any promise fails. +Returned promise succeeds with an array of values used to succeed each contained promise, with keys corresponding to the array of promises. + +Parameters: +* `$promises`: `(\Generator|\Promise)[]` Promises + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `any((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that is resolved when all promises are resolved. The returned promise will not fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `arr(mixed $params): array` + +Create array. + + +Parameters: +* `$params`: `mixed` Params + + + +### `base64urlDecode(string $data): string` + +base64URL decode. + + +Parameters: +* `$data`: `string` Data to decode + + + +### `base64urlEncode(string $data): string` + +Base64URL encode. + + +Parameters: +* `$data`: `string` Data to encode + + + +### `botAPItoMTProto(array $parameters): \Amp\Promise` + +Convert parameters. + + +Parameters: +* `$parameters`: `array` Parameters + + +#### See also: +* `\Amp\Promise` + + + + +### `call(\Generator|\Promise|mixed $promise): \Amp\Promise` + +Convert generator, promise or any other value to a promise. + + +Parameters: +* `$promise`: `\Generator|\Promise|mixed` + Full type: + ``` + \Generator|\Promise<\TReturn>|\TReturn + ``` + + +Fully typed return value: +``` +\Promise<\TReturn> +``` +#### See also: +* `\Generator` +* `\Promise` +* `\TReturn` +* `\Amp\Promise` + + + + +### `callFork(\Generator|\Promise $promise, ?\Generator|\Promise $actual, string $file): \Amp\Promise|mixed` + +Call promise in background. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve +* `$actual`: `?\Generator|\Promise` Promise to resolve instead of $promise +* `$file`: `string` File + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `callForkDefer(\Generator|\Promise $promise): void` + +Call promise in background, deferring execution. + + +Parameters: +* `$promise`: `\Generator|\Promise` Promise to resolve + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `connect(string $config): \Amp\Promise` + +Connect to the lite endpoints specified in the config file. + + +Parameters: +* `$config`: `string` Path to config file + + +#### See also: +* `\Amp\Promise` + + + + +### `echo(string $string): \Amp\Promise` + +Asynchronously write to stdout/browser. + + +Parameters: +* `$string`: `string` Message to echo + + +#### See also: +* `\Amp\Promise` + + + + +### `end(array $what): mixed` + +Get final element of array. + + +Parameters: +* `$what`: `array` Array + + + +### `first((\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when the first promise succeeds, and fails only if all promises fail. + + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `flock(string $file, int $operation, float $polling, ?\Promise $token, ?callable $failureCb): \Amp\Promise` + +Asynchronously lock a file +Resolves with a callbable that MUST eventually be called in order to release the lock. + + +Parameters: +* `$file`: `string` File to lock +* `$operation`: `int` Locking mode +* `$polling`: `float` Polling interval +* `$token`: `?\Promise` Cancellation token +* `$failureCb`: `?callable` Failure callback, called only once if the first locking attempt fails. + + +#### See also: +* `\Promise` +* `\Amp\Promise` + + + + +### `genVectorHash(array $ints): \int Vector hash` + +Generate MTProto vector hash. + + +Parameters: +* `$ints`: `array` IDs + + +Return value: Vector hash + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getMethodNamespaces(): mixed` + +Get TL method namespaces. + + +Fully typed return value: +``` +array|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getVar(object $obj, string $var): mixed` + +Accesses a private variable from an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `hasVar(object $obj, string $var): bool` + +Checks private property exists in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `inflateStripped(string $stripped): \string JPG payload` + +Inflate stripped photosize to full JPG payload. + + +Parameters: +* `$stripped`: `string` Stripped photosize + + +Return value: JPG payload + + +### `isAltervista(): bool` + +Whether this is altervista. + + + +### `isArrayOrAlike(mixed $var): bool` + +Check if is array or similar (traversable && countable && arrayAccess). + + +Parameters: +* `$var`: `mixed` Value to check + + + +### `logger(string $param, int $level, string $file): mixed` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + +Fully typed return value: +``` +void|\Amp\Promise +``` +#### See also: +* `\Amp\Promise` + + + + +### `loop(callable $func): \Amp\Promise` + +Asynchronously run async callable. + + +Parameters: +* `$func`: `callable` Function + + +#### See also: +* `\Amp\Promise` + + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `methodCall(string $methodName, array $args): \Amp\Promise` + +Call lite method. + + +Parameters: +* `$methodName`: `string` Method name +* `$args`: `array` Arguments + + +#### See also: +* `\Amp\Promise` + + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `packDouble(float $value): string` + +Convert double to binary version. + + +Parameters: +* `$value`: `float` Value to convert + + + +### `packSignedInt(int $value): string` + +Convert integer to base256 signed int. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packSignedLong(int $value): string` + +Convert integer to base256 long. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packUnsignedInt(int $value): string` + +Convert value to unsigned base256 int. + + +Parameters: +* `$value`: `int` Value + + + +### `posmod(int $a, int $b): \int Modulo` + +Positive modulo +Works just like the % (modulus) operator, only returns always a postive number. + + +Parameters: +* `$a`: `int` A +* `$b`: `int` B + + +Return value: Modulo + + +### `random(int $length): \string Random string` + +Get random string of specified length. + + +Parameters: +* `$length`: `int` Length + + +Return value: Random string + + +### `randomInt(int $modulus): int` + +Get random integer. + + +Parameters: +* `$modulus`: `int` Modulus + + + +### `readLine(string $prompt): \Amp\Promise` + +Asynchronously read line. + + +Parameters: +* `$prompt`: `string` Prompt + + +#### See also: +* `\Amp\Promise` + + + + +### `rethrow(\Throwable $e, string $file): void` + +Rethrow error catched in strand. + + +Parameters: +* `$e`: `\Throwable` Exception +* `$file`: `string` File where the strand started + + +#### See also: +* `\Throwable` + + + + +### `rleDecode(string $string): string` + +null-byte RLE decode. + + +Parameters: +* `$string`: `string` Data to decode + + + +### `rleEncode(string $string): string` + +null-byte RLE encode. + + +Parameters: +* `$string`: `string` Data to encode + + + +### `setVar(object $obj, string $var, mixed $val): void` + +Sets a private variable in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name +* `$val`: `mixed` Attribute value + + + +### `sleep(int|float $time): \Amp\Promise` + +Asynchronously sleep. + + +Parameters: +* `$time`: `int|float` Number of seconds to sleep for + + +#### See also: +* `\Amp\Promise` + + + + +### `some((\Promise|\Generator)[] $promises): \Amp\Promise` + +Resolves with a two-item array delineating successful and failed Promise results. +The returned promise will only fail if the given number of required promises fail. + +Parameters: +* `$promises`: `(\Promise|\Generator)[]` Promises + + +#### See also: +* `\Promise` +* `\Generator` +* `\Amp\Promise` + + + + +### `timeout(\Generator|\Promise $promise, int $timeout): \Amp\Promise` + +Create an artificial timeout for any \Generator or Promise. + + +Parameters: +* `$promise`: `\Generator|\Promise` +* `$timeout`: `int` + + +#### See also: +* `\Generator` +* `\Promise` +* `\Amp\Promise` + + + + +### `timeoutWithDefault(\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Promise<\TReturnAlt>` + +Creates an artificial timeout for any `Promise`. +If the promise is resolved before the timeout expires, the result is returned + +If the timeout expires before the promise is resolved, a default value is returned + +Parameters: +* `$promise`: `\Promise|\Generator` Promise to which the timeout is applied. + Full type: + ``` + \Promise<\TReturn>|\TGenerator + ``` +* `$timeout`: `int` Timeout in milliseconds. +* `$default`: `mixed` + Full type: + ``` + \TReturnAlt + ``` + + +#### See also: +* `\Promise` +* `\Generator` +* `\TReturn` +* `\TGenerator` +* `\TReturnAlt` +* `\Amp\Promise` + + + + +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `unpackDouble(string $value): float` + +Unpack binary double. + + +Parameters: +* `$value`: `string` Value to unpack + + + +### `unpackSignedInt(string $value): int` + +Unpack base256 signed int. + + +Parameters: +* `$value`: `string` base256 int + + + +### `unpackSignedLong(string $value): int` + +Unpack base256 signed long. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unpackSignedLongString(string $value): string` + +Unpack base256 signed long to string. + + +Parameters: +* `$value`: `string` base256 long + + + +### `wait(\Generator|\Promise $promise, bool $ignoreSignal): mixed` + +Synchronously wait for a promise|generator. + + +Parameters: +* `$promise`: `\Generator|\Promise` The promise to wait for +* `$ignoreSignal`: `bool` Whether to ignore shutdown signals + + +#### See also: +* `\Generator` +* `\Promise` + + + + +### `async(bool $async): void` + +Enable or disable async. + + +Parameters: +* `$async`: `bool` Whether to enable or disable async + + + +### `init(): void` + +Blockingly init. + + + +### `initAsynchronously(): \Generator` + +Asynchronously init. + + +#### See also: +* `\Generator` + + + + +### `inited(): bool` + +Check if we've already inited. + + + +### `forceInit(bool $inited): void` + +Mark instance as (de)inited forcefully. + + +Parameters: +* `$inited`: `bool` Whether to mark the instance as inited or deinited + + + diff --git a/docs/PHPInternal/danog/MadelineProto/TON/Lite.md b/docs/PHPInternal/danog/MadelineProto/TON/Lite.md new file mode 100644 index 00000000..42b222ab --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/TON/Lite.md @@ -0,0 +1,106 @@ +--- +title: danog\MadelineProto\TON\Lite: TON API. +description: + +--- +# `danog\MadelineProto\TON\Lite` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +TON API. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `connect(string $config): \Generator` +* `logger(string $param, int $level, string $file): void` +* `methodCall(string $methodName, array $args): \Generator` +* `loop(callable $func): \Generator` +* `botAPItoMTProto(array $parameters): \Generator` +* `getMethodNamespaces(): array` + +## Methods: +### `connect(string $config): \Generator` + +Connect to the lite endpoints specified in the config file. + + +Parameters: +* `$config`: `string` Path to config file + + +#### See also: +* `\Generator` + + + + +### `logger(string $param, int $level, string $file): void` + +Logger. + + +Parameters: +* `$param`: `string` Parameter +* `$level`: `int` Logging level +* `$file`: `string` File where the message originated + + + +### `methodCall(string $methodName, array $args): \Generator` + +Call lite method. + + +Parameters: +* `$methodName`: `string` Method name +* `$args`: `array` Arguments + + +#### See also: +* `\Generator` + + + + +### `loop(callable $func): \Generator` + +Asynchronously run async callable. + + +Parameters: +* `$func`: `callable` Function + + +#### See also: +* `\Generator` + + + + +### `botAPItoMTProto(array $parameters): \Generator` + +Convert parameters. + + +Parameters: +* `$parameters`: `array` Parameters + + +#### See also: +* `\Generator` + + + + +### `getMethodNamespaces(): array` + +Get TL method namespaces. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Tools.md b/docs/PHPInternal/danog/MadelineProto/Tools.md new file mode 100644 index 00000000..95b4faec --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Tools.md @@ -0,0 +1,709 @@ +--- +title: danog\MadelineProto\Tools: Some tools. +description: + +--- +# `danog\MadelineProto\Tools` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Some tools. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `genVectorHash(array $ints): \int Vector hash` +* `randomInt(int $modulus): int` +* `random(int $length): \string Random string` +* `posmod(int $a, int $b): \int Modulo` +* `unpackSignedInt(string $value): int` +* `unpackSignedLong(string $value): int` +* `unpackSignedLongString(string $value): string` +* `packSignedInt(int $value): string` +* `packSignedLong(int $value): string` +* `packUnsignedInt(int $value): string` +* `packDouble(float $value): string` +* `unpackDouble(string $value): float` +* `wait(\Generator|\Amp\Promise $promise, bool $ignoreSignal): mixed` +* `all((\Generator|\Amp\Promise)[] $promises): \Amp\Promise` +* `any((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` +* `some((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` +* `first((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` +* `timeout(\Generator|\Amp\Promise $promise, int $timeout): \Amp\Promise` +* `timeoutWithDefault(\Amp\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Amp\Promise<\TReturnAlt>` +* `call(\Generator|\Amp\Promise|mixed $promise): \Amp\Promise` +* `callFork(\Generator|\Amp\Promise $promise, ?\Generator|\Amp\Promise $actual, string $file): \Amp\Promise|mixed` +* `callForkDefer(\Generator|\Amp\Promise $promise): void` +* `rethrow(\Throwable $e, string $file): void` +* `after(\Generator|\Amp\Promise $a, \Generator|\Amp\Promise $b): \Amp\Promise` +* `flock(string $file, int $operation, float $polling, ?\Amp\Promise $token, ?callable $failureCb): \Amp\Promise` +* `sleep(int|float $time): \Amp\Promise` +* `readLine(string $prompt): \Amp\Promise` +* `echo(string $string): \Amp\Promise` +* `isArrayOrAlike(mixed $var): bool` +* `arr(mixed $params): array` +* `base64urlDecode(string $data): string` +* `base64urlEncode(string $data): string` +* `rleDecode(string $string): string` +* `rleEncode(string $string): string` +* `inflateStripped(string $stripped): \string JPG payload` +* `end(array $what): mixed` +* `isAltervista(): bool` +* `hasVar(object $obj, string $var): bool` +* `getVar(object $obj, string $var): mixed` +* `setVar(object $obj, string $var, mixed $val): void` +* `toCamelCase(string $input): string` +* `toSnakeCase(string $input): string` +* `markdownEscape(string $hwat): string` +* `typeEscape(string $type): string` +* `methodEscape(string $method): string` +* `getMimeFromExtension(string $extension, string $default): string` +* `getExtensionFromMime(string $mime): string` +* `getExtensionFromLocation(mixed $location, string $default): string` +* `getMimeFromFile(string $file): string` +* `getMimeFromBuffer(string $buffer): string` + +## Methods: +### `genVectorHash(array $ints): \int Vector hash` + +Generate MTProto vector hash. + + +Parameters: +* `$ints`: `array` IDs + + +Return value: Vector hash + + +### `randomInt(int $modulus): int` + +Get random integer. + + +Parameters: +* `$modulus`: `int` Modulus + + + +### `random(int $length): \string Random string` + +Get random string of specified length. + + +Parameters: +* `$length`: `int` Length + + +Return value: Random string + + +### `posmod(int $a, int $b): \int Modulo` + +Positive modulo +Works just like the % (modulus) operator, only returns always a postive number. + + +Parameters: +* `$a`: `int` A +* `$b`: `int` B + + +Return value: Modulo + + +### `unpackSignedInt(string $value): int` + +Unpack base256 signed int. + + +Parameters: +* `$value`: `string` base256 int + + + +### `unpackSignedLong(string $value): int` + +Unpack base256 signed long. + + +Parameters: +* `$value`: `string` base256 long + + + +### `unpackSignedLongString(string $value): string` + +Unpack base256 signed long to string. + + +Parameters: +* `$value`: `string` base256 long + + + +### `packSignedInt(int $value): string` + +Convert integer to base256 signed int. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packSignedLong(int $value): string` + +Convert integer to base256 long. + + +Parameters: +* `$value`: `int` Value to convert + + + +### `packUnsignedInt(int $value): string` + +Convert value to unsigned base256 int. + + +Parameters: +* `$value`: `int` Value + + + +### `packDouble(float $value): string` + +Convert double to binary version. + + +Parameters: +* `$value`: `float` Value to convert + + + +### `unpackDouble(string $value): float` + +Unpack binary double. + + +Parameters: +* `$value`: `string` Value to unpack + + + +### `wait(\Generator|\Amp\Promise $promise, bool $ignoreSignal): mixed` + +Synchronously wait for a promise|generator. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise` The promise to wait for +* `$ignoreSignal`: `bool` Whether to ignore shutdown signals + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `all((\Generator|\Amp\Promise)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when all promises succeed, and fails if any promise fails. +Returned promise succeeds with an array of values used to succeed each contained promise, with keys corresponding to the array of promises. + +Parameters: +* `$promises`: `(\Generator|\Amp\Promise)[]` Promises + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `any((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that is resolved when all promises are resolved. The returned promise will not fail. + + +Parameters: +* `$promises`: `(\Amp\Promise|\Generator)[]` Promises + + +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `some((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` + +Resolves with a two-item array delineating successful and failed Promise results. +The returned promise will only fail if the given number of required promises fail. + +Parameters: +* `$promises`: `(\Amp\Promise|\Generator)[]` Promises + + +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `first((\Amp\Promise|\Generator)[] $promises): \Amp\Promise` + +Returns a promise that succeeds when the first promise succeeds, and fails only if all promises fail. + + +Parameters: +* `$promises`: `(\Amp\Promise|\Generator)[]` Promises + + +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `timeout(\Generator|\Amp\Promise $promise, int $timeout): \Amp\Promise` + +Create an artificial timeout for any \Generator or Promise. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise` +* `$timeout`: `int` + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `timeoutWithDefault(\Amp\Promise|\Generator $promise, int $timeout, mixed $default): \Amp\Promise<\TReturn>|\Amp\Promise<\TReturnAlt>` + +Creates an artificial timeout for any `Promise`. +If the promise is resolved before the timeout expires, the result is returned + +If the timeout expires before the promise is resolved, a default value is returned + +Parameters: +* `$promise`: `\Amp\Promise|\Generator` Promise to which the timeout is applied. + Full type: + ``` + \Amp\Promise<\TReturn>|\TGenerator + ``` +* `$timeout`: `int` Timeout in milliseconds. +* `$default`: `mixed` + Full type: + ``` + \TReturnAlt + ``` + + +#### See also: +* `\Amp\Promise` +* `\Generator` +* `\TReturn` +* `\TGenerator` +* `\TReturnAlt` + + + + +### `call(\Generator|\Amp\Promise|mixed $promise): \Amp\Promise` + +Convert generator, promise or any other value to a promise. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise|mixed` + Full type: + ``` + \Generator|\Amp\Promise<\TReturn>|\TReturn + ``` + + +Fully typed return value: +``` +\Amp\Promise<\TReturn> +``` +#### See also: +* `\Generator` +* `\Amp\Promise` +* `\TReturn` + + + + +### `callFork(\Generator|\Amp\Promise $promise, ?\Generator|\Amp\Promise $actual, string $file): \Amp\Promise|mixed` + +Call promise in background. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise` Promise to resolve +* `$actual`: `?\Generator|\Amp\Promise` Promise to resolve instead of $promise +* `$file`: `string` File + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `callForkDefer(\Generator|\Amp\Promise $promise): void` + +Call promise in background, deferring execution. + + +Parameters: +* `$promise`: `\Generator|\Amp\Promise` Promise to resolve + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `rethrow(\Throwable $e, string $file): void` + +Rethrow error catched in strand. + + +Parameters: +* `$e`: `\Throwable` Exception +* `$file`: `string` File where the strand started + + +#### See also: +* `\Throwable` + + + + +### `after(\Generator|\Amp\Promise $a, \Generator|\Amp\Promise $b): \Amp\Promise` + +Call promise $b after promise $a. + + +Parameters: +* `$a`: `\Generator|\Amp\Promise` Promise A +* `$b`: `\Generator|\Amp\Promise` Promise B + + +#### See also: +* `\Generator` +* `\Amp\Promise` + + + + +### `flock(string $file, int $operation, float $polling, ?\Amp\Promise $token, ?callable $failureCb): \Amp\Promise` + +Asynchronously lock a file +Resolves with a callbable that MUST eventually be called in order to release the lock. + + +Parameters: +* `$file`: `string` File to lock +* `$operation`: `int` Locking mode +* `$polling`: `float` Polling interval +* `$token`: `?\Amp\Promise` Cancellation token +* `$failureCb`: `?callable` Failure callback, called only once if the first locking attempt fails. + + +#### See also: +* `\Amp\Promise` + + + + +### `sleep(int|float $time): \Amp\Promise` + +Asynchronously sleep. + + +Parameters: +* `$time`: `int|float` Number of seconds to sleep for + + +#### See also: +* `\Amp\Promise` + + + + +### `readLine(string $prompt): \Amp\Promise` + +Asynchronously read line. + + +Parameters: +* `$prompt`: `string` Prompt + + +#### See also: +* `\Amp\Promise` + + + + +### `echo(string $string): \Amp\Promise` + +Asynchronously write to stdout/browser. + + +Parameters: +* `$string`: `string` Message to echo + + +#### See also: +* `\Amp\Promise` + + + + +### `isArrayOrAlike(mixed $var): bool` + +Check if is array or similar (traversable && countable && arrayAccess). + + +Parameters: +* `$var`: `mixed` Value to check + + + +### `arr(mixed $params): array` + +Create array. + + +Parameters: +* `$params`: `mixed` Params + + + +### `base64urlDecode(string $data): string` + +base64URL decode. + + +Parameters: +* `$data`: `string` Data to decode + + + +### `base64urlEncode(string $data): string` + +Base64URL encode. + + +Parameters: +* `$data`: `string` Data to encode + + + +### `rleDecode(string $string): string` + +null-byte RLE decode. + + +Parameters: +* `$string`: `string` Data to decode + + + +### `rleEncode(string $string): string` + +null-byte RLE encode. + + +Parameters: +* `$string`: `string` Data to encode + + + +### `inflateStripped(string $stripped): \string JPG payload` + +Inflate stripped photosize to full JPG payload. + + +Parameters: +* `$stripped`: `string` Stripped photosize + + +Return value: JPG payload + + +### `end(array $what): mixed` + +Get final element of array. + + +Parameters: +* `$what`: `array` Array + + + +### `isAltervista(): bool` + +Whether this is altervista. + + + +### `hasVar(object $obj, string $var): bool` + +Checks private property exists in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `getVar(object $obj, string $var): mixed` + +Accesses a private variable from an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name + + + +### `setVar(object $obj, string $var, mixed $val): void` + +Sets a private variable in an object. + + +Parameters: +* `$obj`: `object` Object +* `$var`: `string` Attribute name +* `$val`: `mixed` Attribute value + + + +### `toCamelCase(string $input): string` + +Convert to camelCase. + + +Parameters: +* `$input`: `string` String + + + +### `toSnakeCase(string $input): string` + +Convert to snake_case. + + +Parameters: +* `$input`: `string` String + + + +### `markdownEscape(string $hwat): string` + +Escape string for markdown. + + +Parameters: +* `$hwat`: `string` String to escape + + + +### `typeEscape(string $type): string` + +Escape type name. + + +Parameters: +* `$type`: `string` String to escape + + + +### `methodEscape(string $method): string` + +Escape method name. + + +Parameters: +* `$method`: `string` Method name + + + +### `getMimeFromExtension(string $extension, string $default): string` + +Get mime type from file extension. + + +Parameters: +* `$extension`: `string` File extension +* `$default`: `string` Default mime type + + + +### `getExtensionFromMime(string $mime): string` + +Get extension from mime type. + + +Parameters: +* `$mime`: `string` MIME type + + + +### `getExtensionFromLocation(mixed $location, string $default): string` + +Get extension from file location. + + +Parameters: +* `$location`: `mixed` File location +* `$default`: `string` Default extension + + + +### `getMimeFromFile(string $file): string` + +Get mime type of file. + + +Parameters: +* `$file`: `string` File + + + +### `getMimeFromBuffer(string $buffer): string` + +Get mime type from buffer. + + +Parameters: +* `$buffer`: `string` Buffer + + + diff --git a/docs/PHPInternal/danog/MadelineProto/VoIP/AuthKeyHandler.md b/docs/PHPInternal/danog/MadelineProto/VoIP/AuthKeyHandler.md new file mode 100644 index 00000000..52d477ad --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/VoIP/AuthKeyHandler.md @@ -0,0 +1,128 @@ +--- +title: danog\MadelineProto\VoIP\AuthKeyHandler: Manages the creation of the authorization key. +description: https://core.telegram.org/mtproto/auth_key +https://core.telegram.org/mtproto/samples-auth_key + +--- +# `danog\MadelineProto\VoIP\AuthKeyHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages the creation of the authorization key. + +https://core.telegram.org/mtproto/auth_key +https://core.telegram.org/mtproto/samples-auth_key + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `requestCall(mixed $user): \Generator` +* `acceptCall(array $call): \Generator` +* `confirmCall(array $params): \Generator` +* `completeCall(array $params): \Generator` +* `callStatus(int $id): int` +* `getCall(int $call): array` +* `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Generator` + +## Methods: +### `requestCall(mixed $user): \Generator` + +Request VoIP call. + + +Parameters: +* `$user`: `mixed` User + + +#### See also: +* `\Generator` + + + + +### `acceptCall(array $call): \Generator` + +Accept call. + + +Parameters: +* `$call`: `array` Call + + +#### See also: +* `\Generator` + + + + +### `confirmCall(array $params): \Generator` + +Confirm call. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Generator` + + + + +### `completeCall(array $params): \Generator` + +Complete call handshake. + + +Parameters: +* `$params`: `array` Params + + +#### See also: +* `\Generator` + + + + +### `callStatus(int $id): int` + +Get call status. + + +Parameters: +* `$id`: `int` Call ID + + + +### `getCall(int $call): array` + +Get call info. + + +Parameters: +* `$call`: `int` Call ID + + + +### `discardCall(array $call, array $reason, array $rating, bool $need_debug): \Generator` + +Discard call. + + +Parameters: +* `$call`: `array` Call +* `$reason`: `array` +* `$rating`: `array` Rating +* `$need_debug`: `bool` Need debug? + + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/VoIPServerConfig.md b/docs/PHPInternal/danog/MadelineProto/VoIPServerConfig.md new file mode 100644 index 00000000..d25780ea --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/VoIPServerConfig.md @@ -0,0 +1,68 @@ +--- +title: danog\MadelineProto\VoIPServerConfig: Manages storage of VoIP server config. +description: + +--- +# `danog\MadelineProto\VoIPServerConfig` +[Back to index](../../index.md) + +> Author: Daniil Gentili + + +Manages storage of VoIP server config. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `update(array $config): void` +* `get(): \array The settings` +* `updateDefault(array $configDefault): void` +* `getDefault(): \array The settings` +* `getFinal(): void` + +## Methods: +### `update(array $config): void` + +Update shared call settings. + + +Parameters: +* `$config`: `array` The settings + + + +### `get(): \array The settings` + +Get shared call settings. + + +Return value: The settings + + +### `updateDefault(array $configDefault): void` + +Update default shared call settings. + + +Parameters: +* `$configDefault`: `array` The settings + + + +### `getDefault(): \array The settings` + +Get default shared call settings. + + +Return value: The settings + + +### `getFinal(): void` + +Get final settings. + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Wrappers/Callback.md b/docs/PHPInternal/danog/MadelineProto/Wrappers/Callback.md new file mode 100644 index 00000000..2868e1c9 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Wrappers/Callback.md @@ -0,0 +1,32 @@ +--- +title: danog\MadelineProto\Wrappers\Callback: Manages logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Callback` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setCallback(callable $callback): void` + +## Methods: +### `setCallback(callable $callback): void` + +Set update handling callback. + + +Parameters: +* `$callback`: `callable` Callback + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Wrappers/DialogHandler.md b/docs/PHPInternal/danog/MadelineProto/Wrappers/DialogHandler.md new file mode 100644 index 00000000..fabd94e2 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Wrappers/DialogHandler.md @@ -0,0 +1,60 @@ +--- +title: danog\MadelineProto\Wrappers\DialogHandler: Dialog handler. +description: + +--- +# `danog\MadelineProto\Wrappers\DialogHandler` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Dialog handler. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `getDialogs(bool $force): \Generator` +* `getFullDialogs(bool $force): \Generator` + +## Methods: +### `getDialogs(bool $force): \Generator` + +Get dialog peers. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +Fully typed return value: +``` +\Generator, mixed, list> +``` +#### See also: +* `\Amp\Promise` +* `\Generator` + + + + +### `getFullDialogs(bool $force): \Generator` + +Get full info of all dialogs. + + +Parameters: +* `$force`: `bool` Whether to refetch all dialogs ignoring cache + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Wrappers/Events.md b/docs/PHPInternal/danog/MadelineProto/Wrappers/Events.md new file mode 100644 index 00000000..5f1699b1 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Wrappers/Events.md @@ -0,0 +1,70 @@ +--- +title: danog\MadelineProto\Wrappers\Events: Event handler. +description: + +--- +# `danog\MadelineProto\Wrappers\Events` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Event handler. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Generator` +* `unsetEventHandler(bool $disableUpdateHandling): void` +* `getEventHandler(): \danog\MadelineProto\EventHandler` +* `hasEventHandler(): bool` + +## Methods: +### `setEventHandler(class-string<\danog\MadelineProto\EventHandler> $eventHandler): \Generator` + +Set event handler. + + +Parameters: +* `$eventHandler`: `class-string<\danog\MadelineProto\EventHandler>` Event handler + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](../EventHandler.md) +* `\Generator` + + + + +### `unsetEventHandler(bool $disableUpdateHandling): void` + +Unset event handler. + + +Parameters: +* `$disableUpdateHandling`: `bool` Whether to also disable internal update handling (will cause errors, otherwise will simply use the NOOP handler) + + + +### `getEventHandler(): \danog\MadelineProto\EventHandler` + +Get event handler. + + +#### See also: +* [`\danog\MadelineProto\EventHandler`: Event handler.](../EventHandler.md) + + + + +### `hasEventHandler(): bool` + +Check if an event handler instance is present. + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Wrappers/Login.md b/docs/PHPInternal/danog/MadelineProto/Wrappers/Login.md new file mode 100644 index 00000000..d183f039 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Wrappers/Login.md @@ -0,0 +1,165 @@ +--- +title: danog\MadelineProto\Wrappers\Login: Manages logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Login` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `logout(): \Generator` +* `botLogin(string $token): \Generator` +* `phoneLogin(string $number, int $sms_type): \Generator` +* `completePhoneLogin(string $code): \Generator` +* `importAuthorization(mixed $authorization): \Generator` +* `exportAuthorization(): \Generator` +* `completeSignup(string $first_name, string $last_name): \Generator` +* `complete2faLogin(string $password): \Generator` +* `update2fa(array $params): \Generator` + +## Methods: +### `logout(): \Generator` + +Log out currently logged in user. + + +#### See also: +* `\Generator` + + + + +### `botLogin(string $token): \Generator` + +Login as bot. + + +Parameters: +* `$token`: `string` Bot token + + +#### See also: +* `\Generator` + + + + +### `phoneLogin(string $number, int $sms_type): \Generator` + +Login as user. + + +Parameters: +* `$number`: `string` Phone number +* `$sms_type`: `int` SMS type + + +#### See also: +* `\Generator` + + + + +### `completePhoneLogin(string $code): \Generator` + +Complet user login using login code. + + +Parameters: +* `$code`: `string` Login code + + +#### See also: +* `\Generator` + + + + +### `importAuthorization(mixed $authorization): \Generator` + +Import authorization. + + +Parameters: +* `$authorization`: `mixed` Authorization info + + +#### See also: +* `\Generator` + + + + +### `exportAuthorization(): \Generator` + +Export authorization. + + +Fully typed return value: +``` +\Generator +``` +#### See also: +* `\Generator` + + + + +### `completeSignup(string $first_name, string $last_name): \Generator` + +Complete signup to Telegram. + + +Parameters: +* `$first_name`: `string` First name +* `$last_name`: `string` Last name + + +#### See also: +* `\Generator` + + + + +### `complete2faLogin(string $password): \Generator` + +Complete 2FA login. + + +Parameters: +* `$password`: `string` Password + + +#### See also: +* `\Generator` + + + + +### `update2fa(array $params): \Generator` + +Update the 2FA password. +The params array can contain password, new_password, email and hint params. + +Parameters: +* `$params`: `array` The params + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Wrappers/Loop.md b/docs/PHPInternal/danog/MadelineProto/Wrappers/Loop.md new file mode 100644 index 00000000..3134d1ed --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Wrappers/Loop.md @@ -0,0 +1,83 @@ +--- +title: danog\MadelineProto\Wrappers\Loop: Manages logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Loop` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `initSelfRestart(): void` +* `loop(callable|null $callback): \Generator` +* `stop(): void` +* `restart(): void` +* `loopFork(): \Amp\Promise` +* `closeConnection(string $message): void` + +## Methods: +### `initSelfRestart(): void` + +Initialize self-restart hack. + + + +### `loop(callable|null $callback): \Generator` + +Start MadelineProto's update handling loop, or run the provided async callable. + + +Parameters: +* `$callback`: `callable|null` Async callable to run + + +#### See also: +* `\Generator` + + + + +### `stop(): void` + +Stop update loop. + + + +### `restart(): void` + +Restart update loop. + + + +### `loopFork(): \Amp\Promise` + +Start MadelineProto's update handling loop in background. + + +#### See also: +* `\Amp\Promise` + + + + +### `closeConnection(string $message): void` + +Close connection with client, connected via web. + + +Parameters: +* `$message`: `string` Message + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Wrappers/Start.md b/docs/PHPInternal/danog/MadelineProto/Wrappers/Start.md new file mode 100644 index 00000000..770b8c24 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Wrappers/Start.md @@ -0,0 +1,35 @@ +--- +title: danog\MadelineProto\Wrappers\Start: Manages simple logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Start` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages simple logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `start(): \Generator` + +## Methods: +### `start(): \Generator` + +Log in to telegram (via CLI or web). + + +#### See also: +* `\Generator` + + + + +## Properties +* `$settings`: `\Settings` Settings \ No newline at end of file diff --git a/docs/PHPInternal/danog/MadelineProto/Wrappers/TOS.md b/docs/PHPInternal/danog/MadelineProto/Wrappers/TOS.md new file mode 100644 index 00000000..17fa7a50 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Wrappers/TOS.md @@ -0,0 +1,57 @@ +--- +title: danog\MadelineProto\Wrappers\TOS: Manages terms of service. +description: + +--- +# `danog\MadelineProto\Wrappers\TOS` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages terms of service. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `checkTos(): \Generator` +* `acceptTos(): \Generator` +* `declineTos(): \Generator` + +## Methods: +### `checkTos(): \Generator` + +Check for terms of service update. + + +#### See also: +* `\Generator` + + + + +### `acceptTos(): \Generator` + +Accept terms of service update. + + +#### See also: +* `\Generator` + + + + +### `declineTos(): \Generator` + +Decline terms of service update. +THIS WILL DELETE YOUR ACCOUNT! + +#### See also: +* `\Generator` + + + + diff --git a/docs/PHPInternal/danog/MadelineProto/Wrappers/Webhook.md b/docs/PHPInternal/danog/MadelineProto/Wrappers/Webhook.md new file mode 100644 index 00000000..2a66a7c5 --- /dev/null +++ b/docs/PHPInternal/danog/MadelineProto/Wrappers/Webhook.md @@ -0,0 +1,35 @@ +--- +title: danog\MadelineProto\Wrappers\Webhook: Manages logging in and out. +description: + +--- +# `danog\MadelineProto\Wrappers\Webhook` +[Back to index](../../../index.md) + +> Author: Daniil Gentili + + +Manages logging in and out. + + + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). +## Method list: +* `setWebhook(string $hook_url, string $pem_path): void` + +## Methods: +### `setWebhook(string $hook_url, string $pem_path): void` + +Set webhook update handler. + + +Parameters: +* `$hook_url`: `string` Webhook URL +* `$pem_path`: `string` PEM path for self-signed certificate + + + +## Properties +* `$settings`: `\Settings` \ No newline at end of file diff --git a/docs/PHPInternal/index.md b/docs/PHPInternal/index.md new file mode 100644 index 00000000..5becf566 --- /dev/null +++ b/docs/PHPInternal/index.md @@ -0,0 +1,183 @@ +--- +title: danog/madelineproto +description: PHP implementation of telegram's MTProto protocol. +--- +# `danog/madelineproto` + +PHP implementation of telegram's MTProto protocol. + + +## Interfaces +* [\danog\MadelineProto\Stream\MTProtoBufferInterface: MTProto buffer interface, for reading transport MTProto header info.](danog/MadelineProto/Stream/MTProtoBufferInterface.md) + +## Abstract classes +* [\danog\MadelineProto\EventHandler: Event handler.](danog/MadelineProto/EventHandler.md) +* [\danog\MadelineProto\FileCallbackInterface: File callback interface.](danog/MadelineProto/FileCallbackInterface.md) +* [\danog\MadelineProto\Serialization: Manages serialization of the MadelineProto instance.](danog/MadelineProto/Serialization.md) +* [\danog\MadelineProto\StrTools: Some tools.](danog/MadelineProto/StrTools.md) +* [\danog\MadelineProto\Tools: Some tools.](danog/MadelineProto/Tools.md) +* [\danog\MadelineProto\Db\DbArray: DB array interface.](danog/MadelineProto/Db/DbArray.md) +* [\danog\MadelineProto\Db\DbPropertiesFactory: This factory class initializes the correct database backend for MadelineProto.](danog/MadelineProto/Db/DbPropertiesFactory.md) +* [\danog\MadelineProto\Db\DriverArray: Array caching trait.](danog/MadelineProto/Db/DriverArray.md) +* [\danog\MadelineProto\Db\SqlArray: Generic SQL database backend.](danog/MadelineProto/Db/SqlArray.md) +* [\danog\MadelineProto\Ipc\ClientAbstract: IPC client.](danog/MadelineProto/Ipc/ClientAbstract.md) +* [\danog\MadelineProto\MTProto\AuthKey: MTProto auth key.](danog/MadelineProto/MTProto/AuthKey.md) +* [\danog\MadelineProto\MTProtoSession\MsgIdHandler: Manages message ids.](danog/MadelineProto/MTProtoSession/MsgIdHandler.md) +* [\danog\MadelineProto\Settings\DatabaseAbstract: Base class for storage backends.](danog/MadelineProto/Settings/DatabaseAbstract.md) +* [\danog\MadelineProto\Settings\Database\DatabaseAbstract: Base class for database backends.](danog/MadelineProto/Settings/Database/DatabaseAbstract.md) +* [\danog\MadelineProto\Settings\Database\SqlAbstract: Generic db backend settings.](danog/MadelineProto/Settings/Database/SqlAbstract.md) +* [\danog\MadelineProto\Stream\BufferInterface: Buffer interface.](danog/MadelineProto/Stream/BufferInterface.md) +* [\danog\MadelineProto\Stream\BufferedProxyStreamInterface: Buffered proxy stream interface.](danog/MadelineProto/Stream/BufferedProxyStreamInterface.md) +* [\danog\MadelineProto\Stream\BufferedStreamInterface: Buffered stream interface.](danog/MadelineProto/Stream/BufferedStreamInterface.md) +* [\danog\MadelineProto\Stream\ProxyStreamInterface: Stream proxy interface.](danog/MadelineProto/Stream/ProxyStreamInterface.md) +* [\danog\MadelineProto\Stream\RawProxyStreamInterface: Raw stream proxy interface.](danog/MadelineProto/Stream/RawProxyStreamInterface.md) +* [\danog\MadelineProto\Stream\RawStreamInterface: Raw stream interface.](danog/MadelineProto/Stream/RawStreamInterface.md) +* [\danog\MadelineProto\Stream\ReadBufferInterface: Read buffer interface.](danog/MadelineProto/Stream/ReadBufferInterface.md) +* [\danog\MadelineProto\Stream\StreamInterface: Generic stream interface.](danog/MadelineProto/Stream/StreamInterface.md) +* [\danog\MadelineProto\Stream\WriteBufferInterface: Write buffer interface.](danog/MadelineProto/Stream/WriteBufferInterface.md) +* [\danog\MadelineProto\TL\TLCallback: Interface for managing TL serialization callbacks.](danog/MadelineProto/TL/TLCallback.md) +* [\danog\MadelineProto\TL\Conversion\Extension: Manages generation of extensions for files.](danog/MadelineProto/TL/Conversion/Extension.md) + +## Classes +* [\danog\MadelineProto\API: Main API wrapper for MadelineProto.](danog/MadelineProto/API.md) +* [\danog\MadelineProto\Connection: Connection class.](danog/MadelineProto/Connection.md) +* [\danog\MadelineProto\Coroutine: Creates a promise from a generator function yielding promises.](danog/MadelineProto/Coroutine.md) +* [\danog\MadelineProto\DataCenter: Manages datacenters.](danog/MadelineProto/DataCenter.md) +* [\danog\MadelineProto\DataCenterConnection: Datacenter connection.](danog/MadelineProto/DataCenterConnection.md) +* [\danog\MadelineProto\Exception: Basic exception.](danog/MadelineProto/Exception.md) +* [\danog\MadelineProto\API: Main API wrapper for MadelineProto.](danog/MadelineProto/API.md) +* [\danog\MadelineProto\FileCallback: File callback interface.](danog/MadelineProto/FileCallback.md) +* [\danog\MadelineProto\Logger: Logger class.](danog/MadelineProto/Logger.md) +* [\danog\MadelineProto\Lua: Lua interface.](danog/MadelineProto/Lua.md) +* [\danog\MadelineProto\MTProto: Manages all of the mtproto stuff.](danog/MadelineProto/MTProto.md) +* [\danog\MadelineProto\MyTelegramOrgWrapper: Wrapper for my.telegram.org.](danog/MadelineProto/MyTelegramOrgWrapper.md) +* [\danog\MadelineProto\PTSException: Internal error indicating a problem with Telegram's servers.](danog/MadelineProto/PTSException.md) +* [\danog\MadelineProto\PsrLogger: PSR-3 wrapper for MadelineProto's Logger.](danog/MadelineProto/PsrLogger.md) +* [\danog\MadelineProto\RPCErrorException: Indicates an error returned by Telegram's API.](danog/MadelineProto/RPCErrorException.md) +* [\danog\MadelineProto\RSA: RSA class.](danog/MadelineProto/RSA.md) +* [\danog\MadelineProto\ResponseException: Indicates an error thrown when an unexpected response is received from telegram's servers.](danog/MadelineProto/ResponseException.md) +* [\danog\MadelineProto\SecurityException: Indicates a security error.](danog/MadelineProto/SecurityException.md) +* [\danog\MadelineProto\SessionPaths: Session path information.](danog/MadelineProto/SessionPaths.md) +* [\danog\MadelineProto\Settings: Settings class used for configuring MadelineProto.](danog/MadelineProto/Settings.md) +* [\danog\MadelineProto\Shutdown: Class that controls script shutdown.](danog/MadelineProto/Shutdown.md) +* [\danog\MadelineProto\Snitch: Snitch.](danog/MadelineProto/Snitch.md) +* [\danog\MadelineProto\VoIPServerConfig: Manages storage of VoIP server config.](danog/MadelineProto/VoIPServerConfig.md) +* [\danog\MadelineProto\Async\AsyncConstruct: Async constructor class.](danog/MadelineProto/Async/AsyncConstruct.md) +* [\danog\MadelineProto\Db\MemoryArray: Memory database backend.](danog/MadelineProto/Db/MemoryArray.md) +* [\danog\MadelineProto\Db\MysqlArray: MySQL database backend.](danog/MadelineProto/Db/MysqlArray.md) +* [\danog\MadelineProto\Db\PostgresArray: Postgres database backend.](danog/MadelineProto/Db/PostgresArray.md) +* [\danog\MadelineProto\Db\RedisArray: Redis database backend.](danog/MadelineProto/Db/RedisArray.md) +* [\danog\MadelineProto\Db\Driver\Mysql: MySQL driver wrapper.](danog/MadelineProto/Db/Driver/Mysql.md) +* [\danog\MadelineProto\Db\Driver\Postgres: Postgres driver wrapper.](danog/MadelineProto/Db/Driver/Postgres.md) +* [\danog\MadelineProto\Db\Driver\Redis: Redis driver wrapper.](danog/MadelineProto/Db/Driver/Redis.md) +* [\danog\MadelineProto\Db\NullCache\MysqlArray: MySQL database backend, no caching.](danog/MadelineProto/Db/NullCache/MysqlArray.md) +* [\danog\MadelineProto\Db\NullCache\PostgresArray: Postgres database backend, no caching.](danog/MadelineProto/Db/NullCache/PostgresArray.md) +* [\danog\MadelineProto\Db\NullCache\RedisArray: Redis database backend, no caching.](danog/MadelineProto/Db/NullCache/RedisArray.md) +* [\danog\MadelineProto\Files\Server: MadelineProto fileserver.](danog/MadelineProto/Files/Server.md) +* [\danog\MadelineProto\Ipc\Client: IPC client.](danog/MadelineProto/Ipc/Client.md) +* [\danog\MadelineProto\Ipc\IpcState: IPC state class.](danog/MadelineProto/Ipc/IpcState.md) +* [\danog\MadelineProto\Ipc\Server: IPC server.](danog/MadelineProto/Ipc/Server.md) +* [\danog\MadelineProto\Ipc\ServerCallback: IPC callback server.](danog/MadelineProto/Ipc/ServerCallback.md) +* [\danog\MadelineProto\Ipc\Wrapper: Callback payload wrapper.](danog/MadelineProto/Ipc/Wrapper.md) +* [\danog\MadelineProto\Ipc\Wrapper\Obj: Generic callback wrapper object.](danog/MadelineProto/Ipc/Wrapper/Obj.md) +* [\danog\MadelineProto\Loop\Connection\CheckLoop: RPC call status check loop.](danog/MadelineProto/Loop/Connection/CheckLoop.md) +* [\danog\MadelineProto\Loop\Connection\HttpWaitLoop: HttpWait loop.](danog/MadelineProto/Loop/Connection/HttpWaitLoop.md) +* [\danog\MadelineProto\Loop\Connection\PingLoop: Ping loop.](danog/MadelineProto/Loop/Connection/PingLoop.md) +* [\danog\MadelineProto\Loop\Connection\ReadLoop: Socket read loop.](danog/MadelineProto/Loop/Connection/ReadLoop.md) +* [\danog\MadelineProto\Loop\Connection\WriteLoop: Socket write loop.](danog/MadelineProto/Loop/Connection/WriteLoop.md) +* [\danog\MadelineProto\Loop\Update\FeedLoop: Update feed loop.](danog/MadelineProto/Loop/Update/FeedLoop.md) +* [\danog\MadelineProto\Loop\Update\SeqLoop: update feed loop.](danog/MadelineProto/Loop/Update/SeqLoop.md) +* [\danog\MadelineProto\Loop\Update\UpdateLoop: Update loop.](danog/MadelineProto/Loop/Update/UpdateLoop.md) +* [\danog\MadelineProto\MTProto\PermAuthKey: MTProto permanent auth key.](danog/MadelineProto/MTProto/PermAuthKey.md) +* [\danog\MadelineProto\MTProto\TempAuthKey: MTProto temporary auth key.](danog/MadelineProto/MTProto/TempAuthKey.md) +* [\danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler32: Manages message ids.](danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler32.md) +* [\danog\MadelineProto\MTProtoSession\MsgIdHandler\MsgIdHandler64: Manages message ids.](danog/MadelineProto/MTProtoSession/MsgIdHandler/MsgIdHandler64.md) +* [\danog\MadelineProto\MTProtoTools\CombinedUpdatesState: Stores multiple update states.](danog/MadelineProto/MTProtoTools/CombinedUpdatesState.md) +* [\danog\MadelineProto\MTProtoTools\MinDatabase: Manages min peers.](danog/MadelineProto/MTProtoTools/MinDatabase.md) +* [\danog\MadelineProto\MTProtoTools\PasswordCalculator: Manages SRP password calculation.](danog/MadelineProto/MTProtoTools/PasswordCalculator.md) +* [\danog\MadelineProto\MTProtoTools\ReferenceDatabase: Manages upload and download of files.](danog/MadelineProto/MTProtoTools/ReferenceDatabase.md) +* [\danog\MadelineProto\MTProtoTools\ResponseInfo: Obtain response information for file to server.](danog/MadelineProto/MTProtoTools/ResponseInfo.md) +* [\danog\MadelineProto\MTProtoTools\UpdatesState: Stores the state of updates.](danog/MadelineProto/MTProtoTools/UpdatesState.md) +* [\danog\MadelineProto\Settings\AppInfo: App information.](danog/MadelineProto/Settings/AppInfo.md) +* [\danog\MadelineProto\Settings\Auth: Cryptography settings.](danog/MadelineProto/Settings/Auth.md) +* [\danog\MadelineProto\Settings\Connection: Connection settings.](danog/MadelineProto/Settings/Connection.md) +* [\danog\MadelineProto\Settings\Files: File management settings.](danog/MadelineProto/Settings/Files.md) +* [\danog\MadelineProto\Settings\Ipc: IPC server settings.](danog/MadelineProto/Settings/Ipc.md) +* [\danog\MadelineProto\Settings\Logger: Logger settings.](danog/MadelineProto/Settings/Logger.md) +* [\danog\MadelineProto\Settings\Peer: Peer database settings.](danog/MadelineProto/Settings/Peer.md) +* [\danog\MadelineProto\Settings\Pwr: PWRTelegram settings.](danog/MadelineProto/Settings/Pwr.md) +* [\danog\MadelineProto\Settings\RPC: RPC settings.](danog/MadelineProto/Settings/RPC.md) +* [\danog\MadelineProto\Settings\SecretChats: Secret chat settings.](danog/MadelineProto/Settings/SecretChats.md) +* [\danog\MadelineProto\Settings\Serialization: Serialization settings.](danog/MadelineProto/Settings/Serialization.md) +* [\danog\MadelineProto\Settings\TLSchema: TL schema settings.](danog/MadelineProto/Settings/TLSchema.md) +* [\danog\MadelineProto\Settings\Templates: Web and CLI template settings for login.](danog/MadelineProto/Settings/Templates.md) +* [\danog\MadelineProto\Settings\Database\Memory: Memory backend settings.](danog/MadelineProto/Settings/Database/Memory.md) +* [\danog\MadelineProto\Settings\Database\Mysql: MySQL backend settings.](danog/MadelineProto/Settings/Database/Mysql.md) +* [\danog\MadelineProto\Settings\Database\Postgres: Postgres backend settings.](danog/MadelineProto/Settings/Database/Postgres.md) +* [\danog\MadelineProto\Settings\Database\Redis: Redis backend settings.](danog/MadelineProto/Settings/Database/Redis.md) +* [\danog\MadelineProto\Stream\ConnectionContext: Connection context class.](danog/MadelineProto/Stream/ConnectionContext.md) +* [\danog\MadelineProto\Stream\ADNLTransport\ADNLStream: ADNL stream wrapper.](danog/MadelineProto/Stream/ADNLTransport/ADNLStream.md) +* [\danog\MadelineProto\Stream\Common\BufferedRawStream: Buffered raw stream.](danog/MadelineProto/Stream/Common/BufferedRawStream.md) +* [\danog\MadelineProto\Stream\Common\CtrStream: AES CTR stream wrapper.](danog/MadelineProto/Stream/Common/CtrStream.md) +* [\danog\MadelineProto\Stream\Common\HashedBufferedStream: Hash stream wrapper.](danog/MadelineProto/Stream/Common/HashedBufferedStream.md) +* [\danog\MadelineProto\Stream\Common\SimpleBufferedRawStream: Buffered raw stream.](danog/MadelineProto/Stream/Common/SimpleBufferedRawStream.md) +* [\danog\MadelineProto\Stream\Common\UdpBufferedStream: UDP stream wrapper.](danog/MadelineProto/Stream/Common/UdpBufferedStream.md) +* [\danog\MadelineProto\Stream\MTProtoTransport\AbridgedStream: Abridged stream wrapper.](danog/MadelineProto/Stream/MTProtoTransport/AbridgedStream.md) +* [\danog\MadelineProto\Stream\MTProtoTransport\FullStream: TCP full stream wrapper.](danog/MadelineProto/Stream/MTProtoTransport/FullStream.md) +* [\danog\MadelineProto\Stream\MTProtoTransport\HttpStream: HTTP stream wrapper.](danog/MadelineProto/Stream/MTProtoTransport/HttpStream.md) +* [\danog\MadelineProto\Stream\MTProtoTransport\HttpsStream: HTTPS stream wrapper.](danog/MadelineProto/Stream/MTProtoTransport/HttpsStream.md) +* [\danog\MadelineProto\Stream\MTProtoTransport\IntermediatePaddedStream: TCP Intermediate stream wrapper.](danog/MadelineProto/Stream/MTProtoTransport/IntermediatePaddedStream.md) +* [\danog\MadelineProto\Stream\MTProtoTransport\IntermediateStream: TCP Intermediate stream wrapper.](danog/MadelineProto/Stream/MTProtoTransport/IntermediateStream.md) +* [\danog\MadelineProto\Stream\MTProtoTransport\ObfuscatedStream: Obfuscated2 stream wrapper.](danog/MadelineProto/Stream/MTProtoTransport/ObfuscatedStream.md) +* [\danog\MadelineProto\Stream\Proxy\HttpProxy: HTTP proxy stream wrapper.](danog/MadelineProto/Stream/Proxy/HttpProxy.md) +* [\danog\MadelineProto\Stream\Proxy\SocksProxy: Socks5 stream wrapper.](danog/MadelineProto/Stream/Proxy/SocksProxy.md) +* [\danog\MadelineProto\Stream\Transport\DefaultStream: Default stream wrapper.](danog/MadelineProto/Stream/Transport/DefaultStream.md) +* [\danog\MadelineProto\Stream\Transport\PremadeStream: Premade stream wrapper.](danog/MadelineProto/Stream/Transport/PremadeStream.md) +* [\danog\MadelineProto\Stream\Transport\WsStream: Websocket stream wrapper.](danog/MadelineProto/Stream/Transport/WsStream.md) +* [\danog\MadelineProto\Stream\Transport\WssStream: Websocket TLS stream wrapper.](danog/MadelineProto/Stream/Transport/WssStream.md) +* [\danog\MadelineProto\TL\Exception: TL deserialization exception.](danog/MadelineProto/TL/Exception.md) +* [\danog\MadelineProto\TL\TL: TL serialization.](danog/MadelineProto/TL/TL.md) +* [\danog\MadelineProto\TL\Conversion\Exception: TL conversion exception.](danog/MadelineProto/TL/Conversion/Exception.md) +* [\danog\MadelineProto\TL\Types\Button: Clickable button.](danog/MadelineProto/TL/Types/Button.md) +* [\danog\MadelineProto\TL\Types\Bytes: Bytes wrapper.](danog/MadelineProto/TL/Types/Bytes.md) +* [\danog\MadelineProto\TON\API: TON API.](danog/MadelineProto/TON/API.md) +* [\danog\MadelineProto\TON\Lite: TON API.](danog/MadelineProto/TON/Lite.md) + +## Traits +* [\danog\MadelineProto\ApiWrappers\Start: Manages simple logging in and out.](danog/MadelineProto/ApiWrappers/Start.md) +* [\danog\MadelineProto\Db\ArrayCacheTrait: Array caching trait.](danog/MadelineProto/Db/ArrayCacheTrait.md) +* [\danog\MadelineProto\Db\DbPropertiesTrait: Include this trait and call DbPropertiesTrait::initDb to use MadelineProto's database backend for properties.](danog/MadelineProto/Db/DbPropertiesTrait.md) +* [\danog\MadelineProto\Loop\APILoop: API loop trait.](danog/MadelineProto/Loop/APILoop.md) +* [\danog\MadelineProto\Loop\Connection\Common: RPC call status check loop.](danog/MadelineProto/Loop/Connection/Common.md) +* [\danog\MadelineProto\MTProtoSession\AckHandler: Manages acknowledgement of messages.](danog/MadelineProto/MTProtoSession/AckHandler.md) +* [\danog\MadelineProto\MTProtoSession\CallHandler: Manages method and object calls.](danog/MadelineProto/MTProtoSession/CallHandler.md) +* [\danog\MadelineProto\MTProtoSession\Reliable: Manages responses.](danog/MadelineProto/MTProtoSession/Reliable.md) +* [\danog\MadelineProto\MTProtoSession\ResponseHandler: Manages responses.](danog/MadelineProto/MTProtoSession/ResponseHandler.md) +* [\danog\MadelineProto\MTProtoSession\SeqNoHandler: Manages sequence number.](danog/MadelineProto/MTProtoSession/SeqNoHandler.md) +* [\danog\MadelineProto\MTProtoSession\Session: Manages MTProto session-specific data.](danog/MadelineProto/MTProtoSession/Session.md) +* [\danog\MadelineProto\MTProtoTools\AuthKeyHandler: Manages the creation of the authorization key.](danog/MadelineProto/MTProtoTools/AuthKeyHandler.md) +* [\danog\MadelineProto\MTProtoTools\CallHandler: Manages method and object calls.](danog/MadelineProto/MTProtoTools/CallHandler.md) +* [\danog\MadelineProto\MTProtoTools\Files: Manages upload and download of files.](danog/MadelineProto/MTProtoTools/Files.md) +* [\danog\MadelineProto\MTProtoTools\PeerHandler: Manages peers.](danog/MadelineProto/MTProtoTools/PeerHandler.md) +* [\danog\MadelineProto\MTProtoTools\UpdateHandler: Manages updates.](danog/MadelineProto/MTProtoTools/UpdateHandler.md) +* [\danog\MadelineProto\SecretChats\AuthKeyHandler: Manages secret chats.](danog/MadelineProto/SecretChats/AuthKeyHandler.md) +* [\danog\MadelineProto\SecretChats\MessageHandler: Manages packing and unpacking of messages, and the list of sent and received messages.](danog/MadelineProto/SecretChats/MessageHandler.md) +* [\danog\MadelineProto\SecretChats\ResponseHandler: Manages responses.](danog/MadelineProto/SecretChats/ResponseHandler.md) +* [\danog\MadelineProto\SecretChats\SeqNoHandler: Manages sequence numbers.](danog/MadelineProto/SecretChats/SeqNoHandler.md) +* [\danog\MadelineProto\Stream\Async\Buffer: Buffer helper trait.](danog/MadelineProto/Stream/Async/Buffer.md) +* [\danog\MadelineProto\Stream\Async\BufferedStream: Buffered stream helper trait.](danog/MadelineProto/Stream/Async/BufferedStream.md) +* [\danog\MadelineProto\Stream\Async\RawStream: Raw stream helper trait.](danog/MadelineProto/Stream/Async/RawStream.md) +* [\danog\MadelineProto\TL\PrettyException: Handle async stack traces.](danog/MadelineProto/TL/PrettyException.md) +* [\danog\MadelineProto\VoIP\AuthKeyHandler: Manages the creation of the authorization key.](danog/MadelineProto/VoIP/AuthKeyHandler.md) +* [\danog\MadelineProto\Wrappers\Callback: Manages logging in and out.](danog/MadelineProto/Wrappers/Callback.md) +* [\danog\MadelineProto\Wrappers\DialogHandler: Dialog handler.](danog/MadelineProto/Wrappers/DialogHandler.md) +* [\danog\MadelineProto\Wrappers\Events: Event handler.](danog/MadelineProto/Wrappers/Events.md) +* [\danog\MadelineProto\Wrappers\Login: Manages logging in and out.](danog/MadelineProto/Wrappers/Login.md) +* [\danog\MadelineProto\Wrappers\Loop: Manages logging in and out.](danog/MadelineProto/Wrappers/Loop.md) +* [\danog\MadelineProto\Wrappers\Start: Manages simple logging in and out.](danog/MadelineProto/Wrappers/Start.md) +* [\danog\MadelineProto\Wrappers\TOS: Manages terms of service.](danog/MadelineProto/Wrappers/TOS.md) +* [\danog\MadelineProto\Wrappers\Webhook: Manages logging in and out.](danog/MadelineProto/Wrappers/Webhook.md) + + +--- +Generated by [danog/phpdoc](https://phpdoc.daniil.it). \ No newline at end of file