Updating docs

This commit is contained in:
Daniil Gentili 2019-06-04 23:20:05 +02:00
parent ae6f992aef
commit 4245b4c612
4 changed files with 29 additions and 12 deletions

View File

@ -219,6 +219,11 @@ $client = $MadelineProto->getHTTPClient();
From here it's like in the [artax docs](https://amphp.org/artax).
MadelineProto also provides a simplified async version of `file_get_contents`:
```php
$result = yield $MadelineProto->file_get_contents('https://myurl');
```
#### Async forking (does async single-thread forking)
Useful if you need to start a process in the background and you want throwed exceptions to surface up.

View File

@ -26,19 +26,21 @@ try {
## List of exception types
* \danog\MadelineProto\Exception - Default exception, thrown when a php error occures and in a lot of other cases
* `\danog\MadelineProto\Exception` - Default exception, thrown when a php error occures and in a lot of other cases
* \danog\MadelineProto\RPCErrorException - Thrown when an RPC error occurres (an error received via the MTProto API): **note** that the error message of this exception is localized in English, and may vary: to fetch the original API error message use `$e->rpc`.
* `\danog\MadelineProto\RPCErrorException` - Thrown when an RPC error occurres (an error received via the MTProto API): **note** that the error message of this exception is localized in English, and may vary: to fetch the original API error message use `$e->rpc`.
* \danog\MadelineProto\TL\Exception - Thrown on TL serialization/deserialization errors
* `\danog\MadelineProto\TL\Exception` - Thrown on TL serialization/deserialization errors
* \danog\MadelineProto\NothingInTheSocketException - Thrown if no data can be read from the TCP socket
* `\danog\MadelineProto\ResponseException` - Thrown when an unexpected message is received through the socket
* \danog\MadelineProto\PTSException - Thrown if the PTS is unrecoverably corrupted
* `\danog\MadelineProto\NothingInTheSocketException` - Thrown if no data can be read/written on the TCP socket
* \danog\MadelineProto\SecurityException - Thrown on security problems (invalid params during generation of auth key or similar)
* `\danog\MadelineProto\PTSException` - Thrown if the PTS is unrecoverably corrupted
* \danog\MadelineProto\TL\Conversion\Exception - Thrown if some param/object can't be converted to/from bot API/TD/TD-CLI format (this includes markdown/html parsing)
* `\danog\MadelineProto\SecurityException` - Thrown on security problems (invalid params during generation of auth key or similar)
* `\danog\MadelineProto\TL\Conversion\Exception` - Thrown if some param/object can't be converted to/from bot API/TD/TD-CLI format (this includes markdown/html parsing)
## Pretty TL trace
@ -106,4 +108,4 @@ try {
}
```
<a href="https://docs.madelineproto.xyz/docs/FLOOD_WAIT.html">Next section</a>
<a href="https://docs.madelineproto.xyz/docs/FLOOD_WAIT.html">Next section</a>

View File

@ -11,6 +11,7 @@ There are many ways you can login with MadelineProto.
* [Manual (user)](#manual-user)
* [Manual (bot)](#manual-bot)
* [Logout](#logout)
* [Changing 2FA password](#changing-2fa-password)
## Automatic ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html))
@ -60,6 +61,15 @@ Note that when you login as a bot, MadelineProto also logins using the [PWRTeleg
yield $MadelineProto->logout();
```
**If** you want to logout, you can use the logout function, see [here for the parameters and the result](https://docs.madelineproto.xyz/logout.html).
If you want to logout, you can use the logout function, see [here for the parameters and the result](https://docs.madelineproto.xyz/logout.html).
<a href="https://docs.madelineproto.xyz/docs/FEATURES.html">Next section</a>
## Changing 2FA password
```php
$result = yield $MadelineProto->update_2fa(['password' => 'current password', 'new_password' => 'New password', 'email' => 'daniil@daniil.it', 'hint' => 'ponies']);
```
If you want to logout, you can use the update_2fa function, see [here for the parameters and the result](https://docs.madelineproto.xyz/update_2fa.html).
<a href="https://docs.madelineproto.xyz/docs/FEATURES.html">Next section</a>

View File

@ -302,7 +302,7 @@ Description: How many times should I try to get a response to a query before thr
Flood timeout settings
### `$settings['flood_timeout']['wait_if_lt']`
Default: 20
Default: `10*60`
Description: Sleeps if a `FLOOD_WAIT_` error is received with duration lower than this value
<hr>
@ -432,4 +432,4 @@ The settings array can be accessed and modified in the instantiated class by acc
$MadelineProto->settings['updates']['handle_updates'] = true; // reenable update fetching
```
<a href="https://docs.madelineproto.xyz/docs/SELF.html">Next section</a>
<a href="https://docs.madelineproto.xyz/docs/SELF.html">Next section</a>