-
-
Notifications
You must be signed in to change notification settings - Fork 964
Refactor Telegram.php #106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It would be nice to separate also the log part.
|
How exactly do you envision the database refilling? Have you thought of having a dedicated upgrade file that can be executed to update the database structure? Then, each time the schema is updated, the user can just run the "update" script and all the changes are made automatically. All we need to do then, is have a way to remember which database version we're on, so that only the new changes are applied. |
Incoming update (json string from webhook and getUpdates) can be logged in a text file with those options with the methods:
So if you store |
Aaaaah, now I understand what you mean! So basically what you're saying, is to save all updates to a separate file, which can be used as a data import on the database? Is this necessary? Wouldn't it be enough to just track the database schema changes and update the database after each new version? |
In the very beginning, there was just a table that stores everything.
Row json log are the only one that contain the 'truth'. |
In case of logging, maybe rely on standard LoggerInterface |
This issue is intended as a discussion board and checklist of tasks to refactor the
Telegram
class.(new class names are just suggestions and prone to change)
The main objective is to separate the responsibility and to decouple as much as possible.
The
Telegram
class should handle only the main Telegram API related functionality and thread all sub-processes together by saving necessary objects in member variables, making them available to modify certain features. (i.e. having a$commander
variable that handles all "command" functionality, etc.)Commander
class.Logger
class.The text was updated successfully, but these errors were encountered: