Updated changelog
This commit is contained in:
parent
0f6cccf941
commit
3b26ae40a1
74
CHANGELOG.md
74
CHANGELOG.md
@ -10,7 +10,7 @@ Powered by [amphp](https://amphp.org), MadelineProto wraps the AMPHP APIs to pro
|
|||||||
What exactly __is__ **async**, you may ask, and how is it better than **threading** or **multiprocessing**?
|
What exactly __is__ **async**, you may ask, and how is it better than **threading** or **multiprocessing**?
|
||||||
Async is a relatively new programming pattern that allows you to easily write **non-blocking** code **as if you were using standard** blocking functions, all without the need for complex message exchange systems and synchronization handling for threaded programs, that only add overhead and complexity to your programs, making everything slower and error-prone.
|
Async is a relatively new programming pattern that allows you to easily write **non-blocking** code **as if you were using standard** blocking functions, all without the need for complex message exchange systems and synchronization handling for threaded programs, that only add overhead and complexity to your programs, making everything slower and error-prone.
|
||||||
|
|
||||||
More simply put: with **MadelineProto 4.0**, each update is handled in **parallel** using a separate **thread**, and everything is done in **parallel** (even on restricted webhosts!).
|
More simply put: with **MadelineProto 4.0**, each update is handled in **parallel** using a separate **thread**, and everything is done in **parallel** (even on restricted webhosts, perfect for creating **file downloader bots**!).
|
||||||
|
|
||||||
To enable async, you have to do two simple things:
|
To enable async, you have to do two simple things:
|
||||||
1) [Load the latest version of MadelineProto](https://docs.madelineproto.xyz/docs/ASYNC.html#loading-the-latest-version-of-madelineproto)
|
1) [Load the latest version of MadelineProto](https://docs.madelineproto.xyz/docs/ASYNC.html#loading-the-latest-version-of-madelineproto)
|
||||||
@ -21,6 +21,29 @@ That's it!
|
|||||||
**No need** to set up thread pools (that don't even work in PHP), use synchronization primitives, and so on...
|
**No need** to set up thread pools (that don't even work in PHP), use synchronization primitives, and so on...
|
||||||
Just `yield $MadelineProto->messages->sendMessage` instead of `$MadelineProto->messages->sendMessage`.
|
Just `yield $MadelineProto->messages->sendMessage` instead of `$MadelineProto->messages->sendMessage`.
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
And now, on to the **API changes**:
|
||||||
|
* First of all, we've got several bucketloads of telegram API changes, that can be viewed in the first posts.
|
||||||
|
* Dropped support for PHP 5 and PHP 7.0: these versions of PHP have [officially reached their EOL](http://php.net/eol.php), so MadelineProto will not support them anymore.
|
||||||
|
You can use MadelineProto with PHP 7.3 (or PHP 7.2, PHP 7.1 is supported but not recommended).
|
||||||
|
* You can now use the `@support` username in sendMessage and other methods to send messages to the support user!
|
||||||
|
* Now MadelineProto will automatically try to get the access hash of users not present in the internal peer database (this should reduce errors)!
|
||||||
|
* If any file cannot be downloaded to due issues with the tg media server that is hosting it, it will be automatically sent to the `@support` user ([settings](https://docs.madelineproto.xyz/docs/SETTINGS.html#settingsdownloadreport_broken_media)).
|
||||||
|
* Added an [update_2fa](https://docs.madelineproto.xyz/update_2fa.html) method to update the login password
|
||||||
|
* Added a [get_full_dialogs](https://docs.madelineproto.xyz/docs/DIALOGS.html#get_full_dialogs-now-fully-async) method to get a full list of all chats you’re member of, including dialog info (such as the pinned/last message ID, unread count, tag count, notification settings and message drafts).
|
||||||
|
* [Added support for automatic file uploads by name in secret chats (as with normal chats); you can also now send secret chat messages using the sendMessage method as if it were a normal chat](https://github.com/danog/MadelineProto/blob/master/secret_bot.php)
|
||||||
|
* Added a [resetUpdateState](https://docs.madelineproto.xyz/docs/UPDATES.html#fetch-all-updates-from-the-beginning) method to reset the update state and fetch ALL updates from the beginning
|
||||||
|
* Improved chat message splitting algorithm (if the message you're trying to send is too long): performance improvements, and it will now notify you via the logs if there are too many entities in the logs, or if the entities are too long.
|
||||||
|
* Improved the get_self method.
|
||||||
|
* [Added a __magic_sleep](https://docs.madelineproto.xyz/docs/UPDATES.html#async-combined-event-driven) substitute for `__sleep` in the `CombinedEventHandler`
|
||||||
|
* Removed all dependencies to `curl`: now all HTTP requests are made asynchronously using a custom version of [artax](https://docs.madelineproto.xyz/docs/ASYNC.html#madelineproto-artax-http-client) (more on that later).
|
||||||
|
* Updated [php-libtgvoip](https://voip.madelineproto.xyz) and introduced a [common API](https://docs.madelineproto.xyz/docs/CALLS.html#changing-audio-quality) for changing phone call settings
|
||||||
|
* Improved the `madeline.php` loader
|
||||||
|
* Removed the old serialization APIs: now serialization is done automatically by MadelineProto!
|
||||||
|
* Increased the default flood wait limit to 10 minutes, since with async waiting for the flood wait isn't blocking anymore
|
||||||
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
Naturally, async is not the only feature present in MadelineProto 4.0: to implement async in MadelineProto, I rewrote the **entire codebase two times** over the course of the last six months, as shown in the diff:
|
Naturally, async is not the only feature present in MadelineProto 4.0: to implement async in MadelineProto, I rewrote the **entire codebase two times** over the course of the last six months, as shown in the diff:
|
||||||
@ -64,6 +87,8 @@ A **fourth signal loop** takes care of HTTP long polling.
|
|||||||
This guarantees maximum stability even if telegram's having server issues.
|
This guarantees maximum stability even if telegram's having server issues.
|
||||||
The write loop also greatly reduces overhead, increasing performances by automatically wrapping in containers multiple method calls: this is especially useful when making multiple method calls simultaneously with async (more on that later).
|
The write loop also greatly reduces overhead, increasing performances by automatically wrapping in containers multiple method calls: this is especially useful when making multiple method calls simultaneously with async (more on that later).
|
||||||
|
|
||||||
|
The update state is now stored using a custom `UpdatesState` API, that will simplify backup to a DBMS backend later on :).
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
Possibly the most __exciting__ thing to work on in this version of MadelineProto was the new **update management system**: I whipped it up in merely two days a few weeks ago, and it has **absolutely improved** the overall reliability of MadelineProto.
|
Possibly the most __exciting__ thing to work on in this version of MadelineProto was the new **update management system**: I whipped it up in merely two days a few weeks ago, and it has **absolutely improved** the overall reliability of MadelineProto.
|
||||||
@ -97,43 +122,6 @@ I've also rewritten the **APIFactory**, the abstraction layer that stands betwee
|
|||||||
The same cached method mapping system is also used for the **event handler**, which means that now the **event handler is the fastest update management method**.
|
The same cached method mapping system is also used for the **event handler**, which means that now the **event handler is the fastest update management method**.
|
||||||
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
And now, on to the **API changes and improvements**:
|
|
||||||
* First of all, we've got several bucketloads of telegram API changes, that can be viewed in the first posts
|
|
||||||
* Added an [update_2fa](https://docs.madelineproto.xyz/update_2fa.html) method to update the login password
|
|
||||||
* Added a [get_full_dialogs](https://docs.madelineproto.xyz/docs/DIALOGS.html#get_full_dialogs-now-fully-async) method to get a full list of all chats you’re member of, including dialog info (such as the pinned/last message ID, unread count, tag count, notification settings and message drafts).
|
|
||||||
* [Added support for automatic file uploads by name in secret chats (as with normal chats); you can also now send secret chat messages using the sendMessage method as if it were a normal chat](https://github.com/danog/MadelineProto/blob/master/secret_bot.php)
|
|
||||||
* Improved message splitting algorithm: performance improvements, and it will now notify you via the logs if there are too many entities in the logs, or if the entities are too long.
|
|
||||||
* Improved the get_self method.
|
|
||||||
|
|
||||||
* magic sleep
|
|
||||||
* Simultaneous method calls
|
|
||||||
* sendmessage with secret messages
|
|
||||||
* automatic secret chat file upload
|
|
||||||
* improved callfork
|
|
||||||
* new logging
|
|
||||||
* channel state
|
|
||||||
* async construct
|
|
||||||
* clean up repo, update dependencies and remove curl dependency
|
|
||||||
* new phone call config
|
|
||||||
* updated php-libtgvoip
|
|
||||||
* improved madeline.php loader
|
|
||||||
* async constructor
|
|
||||||
* removed old serialization
|
|
||||||
* rewrote combined update handler (async)
|
|
||||||
* modify amphp
|
|
||||||
* async logging
|
|
||||||
* phpdoc
|
|
||||||
* @support
|
|
||||||
* even without access hash for bots
|
|
||||||
* async HTTP requests internally
|
|
||||||
* custom HTTP client with DoH
|
|
||||||
* no more php 5
|
|
||||||
* reset PTS to 0
|
|
||||||
* arrayaccess on args
|
|
||||||
* increased flood wait
|
|
||||||
|
|
||||||
***
|
***
|
||||||
|
|
||||||
And now, let's elaborate on async:
|
And now, let's elaborate on async:
|
||||||
@ -145,6 +133,14 @@ When I say **thread**, I actually mean **green thread** ([wikipedia](https://en.
|
|||||||
In
|
In
|
||||||
|
|
||||||
|
|
||||||
|
* modify amphp
|
||||||
|
* phpdoc
|
||||||
|
* custom HTTP client with DoH
|
||||||
|
* Simultaneous method calls
|
||||||
|
* improved callfork
|
||||||
|
* new logging
|
||||||
|
* async construct
|
||||||
|
|
||||||
Things to expect in the next releases:
|
Things to expect in the next releases:
|
||||||
docs for get mime funcs
|
docs for get mime funcs
|
||||||
docs for HTML parser (div to avoid escaping)
|
docs for HTML parser (div to avoid escaping)
|
||||||
@ -172,5 +168,5 @@ video calls
|
|||||||
group calls
|
group calls
|
||||||
native calls
|
native calls
|
||||||
dnssec
|
dnssec
|
||||||
|
mytelegramorg docs
|
||||||
telegram passport
|
telegram passport
|
26
README.md
26
README.md
@ -76,10 +76,11 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
|
|||||||
* [GenericLoop](https://docs.madelineproto.xyz/docs/ASYNC.html#genericloop)
|
* [GenericLoop](https://docs.madelineproto.xyz/docs/ASYNC.html#genericloop)
|
||||||
* [Creating a client](https://docs.madelineproto.xyz/docs/CREATING_A_CLIENT.html)
|
* [Creating a client](https://docs.madelineproto.xyz/docs/CREATING_A_CLIENT.html)
|
||||||
* [Logging in](https://docs.madelineproto.xyz/docs/LOGIN.html)
|
* [Logging in](https://docs.madelineproto.xyz/docs/LOGIN.html)
|
||||||
* [Automatic](https://docs.madelineproto.xyz/docs/LOGIN.html#automatic)
|
* [Automatic](https://docs.madelineproto.xyz/docs/LOGIN.html#automatic-now-fully-async)
|
||||||
* [Manual (user)](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-user)
|
* [Manual (user)](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-user)
|
||||||
* [Manual (bot)](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-bot)
|
* [Manual (bot)](https://docs.madelineproto.xyz/docs/LOGIN.html#manual-bot)
|
||||||
* [Logout](https://docs.madelineproto.xyz/docs/LOGIN.html#logout)
|
* [Logout](https://docs.madelineproto.xyz/docs/LOGIN.html#logout)
|
||||||
|
* [Changing 2FA password](https://docs.madelineproto.xyz/docs/LOGIN.html#changing-2fa-password)
|
||||||
* [Features](https://docs.madelineproto.xyz/docs/FEATURES.html)
|
* [Features](https://docs.madelineproto.xyz/docs/FEATURES.html)
|
||||||
* [Requirements](https://docs.madelineproto.xyz/docs/REQUIREMENTS.html)
|
* [Requirements](https://docs.madelineproto.xyz/docs/REQUIREMENTS.html)
|
||||||
* [Installation](https://docs.madelineproto.xyz/docs/INSTALLATION.html)
|
* [Installation](https://docs.madelineproto.xyz/docs/INSTALLATION.html)
|
||||||
@ -87,11 +88,12 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
|
|||||||
* [Simple (manual)](https://docs.madelineproto.xyz/docs/INSTALLATION.html#simple-manual)
|
* [Simple (manual)](https://docs.madelineproto.xyz/docs/INSTALLATION.html#simple-manual)
|
||||||
* [Composer from scratch](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-scratch)
|
* [Composer from scratch](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-scratch)
|
||||||
* [Composer from existing project](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-existing-project)
|
* [Composer from existing project](https://docs.madelineproto.xyz/docs/INSTALLATION.html#composer-from-existing-project)
|
||||||
* [Handling updates](https://docs.madelineproto.xyz/docs/UPDATES.html)
|
* [Handling updates (new messages)](https://docs.madelineproto.xyz/docs/UPDATES.html)
|
||||||
* [Async Event driven](https://docs.madelineproto.xyz/docs/UPDATES.html#async-event-driven)
|
* [Async Event driven](https://docs.madelineproto.xyz/docs/UPDATES.html#async-event-driven)
|
||||||
* [Multi-account: Async Combined Event driven update handling](https://docs.madelineproto.xyz/docs/UPDATES.html#async-combined-event-driven)
|
* [Multi-account: Async Combined Event driven update handling](https://docs.madelineproto.xyz/docs/UPDATES.html#async-combined-event-driven)
|
||||||
* [Async Callback](https://docs.madelineproto.xyz/docs/UPDATES.html#async-callback)
|
* [Async Callback](https://docs.madelineproto.xyz/docs/UPDATES.html#async-callback)
|
||||||
* [Noop (default)](https://docs.madelineproto.xyz/docs/UPDATES.html#noop)
|
* [Noop (default)](https://docs.madelineproto.xyz/docs/UPDATES.html#noop)
|
||||||
|
* [Fetch all updates from the beginning](https://docs.madelineproto.xyz/docs/UPDATES.html#fetch-all-updates-from-the-beginning)
|
||||||
* [Settings](https://docs.madelineproto.xyz/docs/SETTINGS.html)
|
* [Settings](https://docs.madelineproto.xyz/docs/SETTINGS.html)
|
||||||
* [Getting info about the current user](https://docs.madelineproto.xyz/docs/SELF.html)
|
* [Getting info about the current user](https://docs.madelineproto.xyz/docs/SELF.html)
|
||||||
* [Exceptions](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html)
|
* [Exceptions](https://docs.madelineproto.xyz/docs/EXCEPTIONS.html)
|
||||||
@ -127,19 +129,18 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
|
|||||||
* [Download to browser (streaming)](https://docs.madelineproto.xyz/docs/FILES.html#download-to-browser-with-streams)
|
* [Download to browser (streaming)](https://docs.madelineproto.xyz/docs/FILES.html#download-to-browser-with-streams)
|
||||||
* [Getting progress](https://docs.madelineproto.xyz/docs/FILES.html#getting-progress)
|
* [Getting progress](https://docs.madelineproto.xyz/docs/FILES.html#getting-progress)
|
||||||
* [Getting info about chats](https://docs.madelineproto.xyz/docs/CHAT_INFO.html)
|
* [Getting info about chats](https://docs.madelineproto.xyz/docs/CHAT_INFO.html)
|
||||||
* [Full chat info with full list of participants](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_pwr_chat)
|
* [Full chat info with full list of participants](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_pwr_chat-now-fully-async)
|
||||||
* [Full chat info](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_full_info)
|
* [Full chat info](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_full_info-now-fully-async)
|
||||||
* [Reduced chat info (very fast)](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_info)
|
* [Reduced chat info (very fast)](https://docs.madelineproto.xyz/docs/CHAT_INFO.html#get_info-now-fully-async)
|
||||||
* [Getting all chats (dialogs)](https://docs.madelineproto.xyz/docs/DIALOGS.html)
|
* [Getting all chats (dialogs)](https://docs.madelineproto.xyz/docs/DIALOGS.html)
|
||||||
* [As user](https://docs.madelineproto.xyz/docs/DIALOGS.html#user-get_dialogs)
|
* [Dialog list](https://docs.madelineproto.xyz/docs/DIALOGS.html#get_dialogs-now-fully-async)
|
||||||
* [Full dialog info](https://docs.madelineproto.xyz/docs/DIALOGS.html#user-get_full_dialogs)
|
* [Full dialog info](https://docs.madelineproto.xyz/docs/DIALOGS.html#get_full_dialogs-now-fully-async)
|
||||||
* [As bot](https://docs.madelineproto.xyz/docs/DIALOGS.html#bot-internal-peer-database)
|
|
||||||
* [Inline buttons ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html))](https://docs.madelineproto.xyz/docs/INLINE_BUTTONS.html)
|
* [Inline buttons ([now fully async!](https://docs.madelineproto.xyz/docs/ASYNC.html))](https://docs.madelineproto.xyz/docs/INLINE_BUTTONS.html)
|
||||||
* [Secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html)
|
* [Secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html)
|
||||||
* [Requesting secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#requesting-secret-chats)
|
* [Requesting secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#requesting-secret-chats-now-fully-async)
|
||||||
* [Accepting secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#accepting-secret-chats)
|
* [Accepting secret chats](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#accepting-secret-chats-now-fully-async)
|
||||||
* [Checking secret chat status](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#checking-secret-chat-status)
|
* [Checking secret chat status](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#checking-secret-chat-status-now-fully-async)
|
||||||
* [Sending secret messages](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#sending-secret-messages)
|
* [Sending secret messages](https://docs.madelineproto.xyz/docs/SECRET_CHATS.html#sending-secret-messages-now-fully-async)
|
||||||
* [Lua binding](https://docs.madelineproto.xyz/docs/LUA.html)
|
* [Lua binding](https://docs.madelineproto.xyz/docs/LUA.html)
|
||||||
* [Using a proxy](https://docs.madelineproto.xyz/docs/PROXY.html)
|
* [Using a proxy](https://docs.madelineproto.xyz/docs/PROXY.html)
|
||||||
* [How to set a proxy](https://docs.madelineproto.xyz/docs/PROXY.html#how-to-set-a-proxy)
|
* [How to set a proxy](https://docs.madelineproto.xyz/docs/PROXY.html#how-to-set-a-proxy)
|
||||||
@ -152,6 +153,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
|
|||||||
* [FULL API Documentation with descriptions](https://docs.madelineproto.xyz/API_docs/methods/)
|
* [FULL API Documentation with descriptions](https://docs.madelineproto.xyz/API_docs/methods/)
|
||||||
* [Logout](https://docs.madelineproto.xyz/logout.html)
|
* [Logout](https://docs.madelineproto.xyz/logout.html)
|
||||||
* [Login](https://docs.madelineproto.xyz/docs/LOGIN.html)
|
* [Login](https://docs.madelineproto.xyz/docs/LOGIN.html)
|
||||||
|
* [Change 2FA password](https://docs.madelineproto.xyz/update_2fa.html)
|
||||||
* [Get all chats, broadcast a message to all chats](https://docs.madelineproto.xyz/docs/DIALOGS.html)
|
* [Get all chats, broadcast a message to all chats](https://docs.madelineproto.xyz/docs/DIALOGS.html)
|
||||||
* [Get the full participant list of a channel/group/supergroup](https://docs.madelineproto.xyz/get_pwr_chat.html)
|
* [Get the full participant list of a channel/group/supergroup](https://docs.madelineproto.xyz/get_pwr_chat.html)
|
||||||
* [Get full info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/get_full_info.html)
|
* [Get full info about a user/chat/supergroup/channel](https://docs.madelineproto.xyz/get_full_info.html)
|
||||||
|
2
docs
2
docs
@ -1 +1 @@
|
|||||||
Subproject commit 6fe646f4a22e8e0ccf5d8a8c562c6d7499a8a17c
|
Subproject commit 04a2ff69f3524e7ce684791cd51614e9261c4d82
|
@ -23,42 +23,6 @@ use danog\MadelineProto\Async\AsyncConstruct;
|
|||||||
|
|
||||||
class APIFactory extends AsyncConstruct
|
class APIFactory extends AsyncConstruct
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* @internal this is a internal property generated by build_docs.php, don't change manually
|
|
||||||
*
|
|
||||||
* @var langpack
|
|
||||||
*/
|
|
||||||
public $langpack;
|
|
||||||
/**
|
|
||||||
* @internal this is a internal property generated by build_docs.php, don't change manually
|
|
||||||
*
|
|
||||||
* @var phone
|
|
||||||
*/
|
|
||||||
public $phone;
|
|
||||||
/**
|
|
||||||
* @internal this is a internal property generated by build_docs.php, don't change manually
|
|
||||||
*
|
|
||||||
* @var stickers
|
|
||||||
*/
|
|
||||||
public $stickers;
|
|
||||||
/**
|
|
||||||
* @internal this is a internal property generated by build_docs.php, don't change manually
|
|
||||||
*
|
|
||||||
* @var payments
|
|
||||||
*/
|
|
||||||
public $payments;
|
|
||||||
/**
|
|
||||||
* @internal this is a internal property generated by build_docs.php, don't change manually
|
|
||||||
*
|
|
||||||
* @var bots
|
|
||||||
*/
|
|
||||||
public $bots;
|
|
||||||
/**
|
|
||||||
* @internal this is a internal property generated by build_docs.php, don't change manually
|
|
||||||
*
|
|
||||||
* @var channels
|
|
||||||
*/
|
|
||||||
public $channels;
|
|
||||||
/**
|
/**
|
||||||
* @internal this is a internal property generated by build_docs.php, don't change manually
|
* @internal this is a internal property generated by build_docs.php, don't change manually
|
||||||
*
|
*
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user